From 557821943e160f80f4cea767cb194dad49532b54 Mon Sep 17 00:00:00 2001 From: mstaylor Date: Thu, 16 Mar 2023 18:31:18 -0400 Subject: [PATCH 01/19] New branch for merge to cylondata cylon --- aws/README.md | 5 + aws/scripts/Join_Weak_Scaling.ipynb | 279 ++ aws/scripts/S3_run_script.py | 67 + aws/scripts/clearDb.py | 25 + .../cloudformation/cylon-elasticache.yaml | 71 + aws/scripts/cloudformation/cylon-redis.yaml | 90 + aws/scripts/cylon-redis-task-def.json | 112 + aws/scripts/cylon_scaling.py | 294 ++ ...on_scaling_ec2_strong_145000000_16node.txt | 75 + ...lon_scaling_ec2_strong_145000000_1node.txt | 75 + ...lon_scaling_ec2_strong_145000000_2node.txt | 75 + ...lon_scaling_ec2_strong_145000000_4node.txt | 75 + ...lon_scaling_ec2_strong_145000000_8node.txt | 75 + ...mmary_test_ec2_strong_145000000_16node.txt | 10 + ...ummary_test_ec2_strong_145000000_1node.txt | 10 + ...ummary_test_ec2_strong_145000000_2node.txt | 10 + ...mmary_test_ec2_strongt_145000000_4node.txt | 10 + ...mmary_test_ec2_strongt_145000000_8node.txt | 10 + .../cylon_scaling_ec2_weak_9100000_16node.txt | 75 + .../cylon_scaling_ec2_weak_9100000_1node.txt | 75 + .../cylon_scaling_ec2_weak_9100000_2node.txt | 75 + .../cylon_scaling_ec2_weak_9100000_4node.txt | 75 + .../cylon_scaling_ec2_weak_9100000_8node.txt | 75 + .../cylon_summary_test_ec2_9100000_16node.txt | 10 + ...on_summary_test_ec2_weak_9100000_1node.txt | 10 + ...on_summary_test_ec2_weak_9100000_2node.txt | 10 + ...on_summary_test_ec2_weak_9100000_4node.txt | 10 + ...on_summary_test_ec2_weak_9100000_8node.txt | 10 + aws/scripts/runCylon.sh | 16 + .../cylon/net/ucx/mpi_ucx_ucc_oob_context.cpp | 5 + .../cylon/net/ucx/mpi_ucx_ucc_oob_context.hpp | 2 + .../net/ucx/redis_ucx_ucc_oob_context.cpp | 8 + .../net/ucx/redis_ucx_ucc_oob_context.hpp | 2 + cpp/src/cylon/net/ucx/ucc_oob_context.hpp | 2 + cpp/src/cylon/net/ucx/ucx_communicator.cpp | 655 ++-- cpp/src/cylon/net/ucx/ucx_communicator.hpp | 56 +- cpp/src/cylon/thridparty/cereal/access.hpp | 351 +++ .../thridparty/cereal/archives/adapters.hpp | 163 + .../thridparty/cereal/archives/binary.hpp | 169 ++ .../cylon/thridparty/cereal/archives/json.hpp | 1041 +++++++ .../cereal/archives/portable_binary.hpp | 334 +++ .../cylon/thridparty/cereal/archives/xml.hpp | 956 ++++++ cpp/src/cylon/thridparty/cereal/cereal.hpp | 1120 +++++++ .../thridparty/cereal/details/helpers.hpp | 422 +++ .../cereal/details/polymorphic_impl.hpp | 825 +++++ .../cereal/details/polymorphic_impl_fwd.hpp | 65 + .../cereal/details/static_object.hpp | 128 + .../thridparty/cereal/details/traits.hpp | 1411 +++++++++ .../cylon/thridparty/cereal/details/util.hpp | 84 + .../cylon/thridparty/cereal/external/LICENSE | 21 + .../thridparty/cereal/external/base64.hpp | 134 + .../cereal/external/rapidjson/LICENSE | 13 + .../cereal/external/rapidjson/allocators.h | 284 ++ .../external/rapidjson/cursorstreamwrapper.h | 78 + .../cereal/external/rapidjson/document.h | 2659 +++++++++++++++++ .../cereal/external/rapidjson/encodedstream.h | 299 ++ .../cereal/external/rapidjson/encodings.h | 716 +++++ .../cereal/external/rapidjson/error/en.h | 74 + .../cereal/external/rapidjson/error/error.h | 161 + .../external/rapidjson/filereadstream.h | 99 + .../external/rapidjson/filewritestream.h | 104 + .../cereal/external/rapidjson/fwd.h | 151 + .../external/rapidjson/internal/biginteger.h | 290 ++ .../external/rapidjson/internal/diyfp.h | 271 ++ .../cereal/external/rapidjson/internal/dtoa.h | 245 ++ .../external/rapidjson/internal/ieee754.h | 78 + .../cereal/external/rapidjson/internal/itoa.h | 308 ++ .../cereal/external/rapidjson/internal/meta.h | 186 ++ .../external/rapidjson/internal/pow10.h | 55 + .../external/rapidjson/internal/regex.h | 740 +++++ .../external/rapidjson/internal/stack.h | 232 ++ .../external/rapidjson/internal/strfunc.h | 69 + .../external/rapidjson/internal/strtod.h | 290 ++ .../cereal/external/rapidjson/internal/swap.h | 46 + .../external/rapidjson/istreamwrapper.h | 128 + .../cereal/external/rapidjson/memorybuffer.h | 70 + .../cereal/external/rapidjson/memorystream.h | 71 + .../external/rapidjson/msinttypes/LICENSE | 29 + .../external/rapidjson/msinttypes/inttypes.h | 316 ++ .../external/rapidjson/msinttypes/stdint.h | 300 ++ .../external/rapidjson/ostreamwrapper.h | 81 + .../cereal/external/rapidjson/pointer.h | 1414 +++++++++ .../cereal/external/rapidjson/prettywriter.h | 277 ++ .../cereal/external/rapidjson/rapidjson.h | 656 ++++ .../cereal/external/rapidjson/reader.h | 2230 ++++++++++++++ .../cereal/external/rapidjson/schema.h | 2497 ++++++++++++++++ .../cereal/external/rapidjson/stream.h | 223 ++ .../cereal/external/rapidjson/stringbuffer.h | 121 + .../cereal/external/rapidjson/writer.h | 709 +++++ .../cereal/external/rapidxml/license.txt | 52 + .../cereal/external/rapidxml/manual.html | 406 +++ .../cereal/external/rapidxml/rapidxml.hpp | 2624 ++++++++++++++++ .../external/rapidxml/rapidxml_iterators.hpp | 175 ++ .../external/rapidxml/rapidxml_print.hpp | 428 +++ .../external/rapidxml/rapidxml_utils.hpp | 123 + cpp/src/cylon/thridparty/cereal/macros.hpp | 156 + .../cylon/thridparty/cereal/specialize.hpp | 139 + .../cylon/thridparty/cereal/types/array.hpp | 79 + .../cylon/thridparty/cereal/types/atomic.hpp | 55 + .../thridparty/cereal/types/base_class.hpp | 203 ++ .../cylon/thridparty/cereal/types/bitset.hpp | 176 ++ .../thridparty/cereal/types/boost_variant.hpp | 164 + .../cylon/thridparty/cereal/types/chrono.hpp | 72 + .../cylon/thridparty/cereal/types/common.hpp | 129 + .../cylon/thridparty/cereal/types/complex.hpp | 56 + .../concepts/pair_associative_container.hpp | 73 + .../cylon/thridparty/cereal/types/deque.hpp | 62 + .../thridparty/cereal/types/forward_list.hpp | 68 + .../thridparty/cereal/types/functional.hpp | 43 + .../cylon/thridparty/cereal/types/list.hpp | 62 + cpp/src/cylon/thridparty/cereal/types/map.hpp | 36 + .../cylon/thridparty/cereal/types/memory.hpp | 425 +++ .../thridparty/cereal/types/optional.hpp | 65 + .../thridparty/cereal/types/polymorphic.hpp | 483 +++ .../cylon/thridparty/cereal/types/queue.hpp | 132 + cpp/src/cylon/thridparty/cereal/types/set.hpp | 103 + .../cylon/thridparty/cereal/types/stack.hpp | 76 + .../cylon/thridparty/cereal/types/string.hpp | 61 + .../cylon/thridparty/cereal/types/tuple.hpp | 123 + .../thridparty/cereal/types/unordered_map.hpp | 36 + .../thridparty/cereal/types/unordered_set.hpp | 99 + .../cylon/thridparty/cereal/types/utility.hpp | 47 + .../thridparty/cereal/types/valarray.hpp | 89 + .../cylon/thridparty/cereal/types/variant.hpp | 108 + .../cylon/thridparty/cereal/types/vector.hpp | 112 + cpp/src/cylon/thridparty/cereal/version.hpp | 52 + docker/aws/Dockerfile | 90 + docker/aws/README.md | 36 + docker/ucc-redis/Dockerfile | 68 + docker/ucc-redis/README.md | 36 + python/pycylon/examples/redis_example.py | 2 +- python/pycylon/pycylon/api/lib.pxd | 16 +- python/pycylon/pycylon/api/lib.pyx | 30 +- python/pycylon/pycylon/ctx/context.pxd | 2 +- python/pycylon/pycylon/ctx/context.pyx | 21 +- python/pycylon/pycylon/data/ctype.pxd | 75 + python/pycylon/pycylon/data/ctype.pyx | 73 + python/pycylon/pycylon/data/data_type.pxd | 69 +- python/pycylon/pycylon/data/data_type.pyx | 68 +- python/pycylon/pycylon/data/layout.pxd | 21 + python/pycylon/pycylon/data/layout.pyx | 22 + python/pycylon/pycylon/net/communicator.pxd | 24 +- python/pycylon/pycylon/net/communicator.pyx | 10 +- .../pycylon/pycylon/net/mpi_communicator.pxd | 41 + .../pycylon/pycylon/net/mpi_communicator.pyx | 43 + .../pycylon/net/redis_ucc_oob_context.pxd | 2 + .../pycylon/net/redis_ucx_oob_context.pyx | 2 +- python/pycylon/pycylon/net/reduce_op.pxd | 29 + python/pycylon/pycylon/net/reduce_op.pyx | 29 + .../pycylon/net/ucc_ucx_communicator.pxd | 43 + .../pycylon/net/ucc_ucx_communicator.pyx | 48 + .../pycylon/pycylon/net/ucx_communicator.pxd | 43 + .../pycylon/pycylon/net/ucx_communicator.pyx | 44 + 153 files changed, 34226 insertions(+), 486 deletions(-) create mode 100644 aws/README.md create mode 100644 aws/scripts/Join_Weak_Scaling.ipynb create mode 100644 aws/scripts/S3_run_script.py create mode 100644 aws/scripts/clearDb.py create mode 100644 aws/scripts/cloudformation/cylon-elasticache.yaml create mode 100644 aws/scripts/cloudformation/cylon-redis.yaml create mode 100644 aws/scripts/cylon-redis-task-def.json create mode 100644 aws/scripts/cylon_scaling.py create mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt create mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt create mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt create mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt create mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt create mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt create mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt create mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt create mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt create mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt create mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt create mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt create mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt create mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt create mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt create mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt create mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt create mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt create mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt create mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt create mode 100644 aws/scripts/runCylon.sh create mode 100644 cpp/src/cylon/thridparty/cereal/access.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/archives/adapters.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/archives/binary.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/archives/json.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/archives/xml.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/cereal.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/helpers.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/static_object.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/traits.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/details/util.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/external/LICENSE create mode 100644 cpp/src/cylon/thridparty/cereal/external/base64.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/macros.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/specialize.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/array.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/atomic.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/base_class.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/bitset.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/chrono.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/common.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/complex.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/deque.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/forward_list.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/functional.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/list.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/map.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/memory.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/optional.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/queue.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/set.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/stack.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/string.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/tuple.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/utility.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/valarray.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/variant.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/types/vector.hpp create mode 100644 cpp/src/cylon/thridparty/cereal/version.hpp create mode 100644 docker/aws/Dockerfile create mode 100644 docker/aws/README.md create mode 100644 docker/ucc-redis/Dockerfile create mode 100644 docker/ucc-redis/README.md create mode 100644 python/pycylon/pycylon/data/ctype.pxd create mode 100644 python/pycylon/pycylon/data/ctype.pyx create mode 100644 python/pycylon/pycylon/data/layout.pxd create mode 100644 python/pycylon/pycylon/data/layout.pyx create mode 100644 python/pycylon/pycylon/net/mpi_communicator.pxd create mode 100644 python/pycylon/pycylon/net/mpi_communicator.pyx create mode 100644 python/pycylon/pycylon/net/reduce_op.pxd create mode 100644 python/pycylon/pycylon/net/reduce_op.pyx create mode 100644 python/pycylon/pycylon/net/ucc_ucx_communicator.pxd create mode 100644 python/pycylon/pycylon/net/ucc_ucx_communicator.pyx create mode 100644 python/pycylon/pycylon/net/ucx_communicator.pxd create mode 100644 python/pycylon/pycylon/net/ucx_communicator.pyx diff --git a/aws/README.md b/aws/README.md new file mode 100644 index 000000000..378b7eb52 --- /dev/null +++ b/aws/README.md @@ -0,0 +1,5 @@ +# Running Cylon on AWS ECS + +Mills Wellons Staylor, III + + diff --git a/aws/scripts/Join_Weak_Scaling.ipynb b/aws/scripts/Join_Weak_Scaling.ipynb new file mode 100644 index 000000000..b962f6948 --- /dev/null +++ b/aws/scripts/Join_Weak_Scaling.ipynb @@ -0,0 +1,279 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "DdPziLudpalX", + "outputId": "3c63ebcd-b960-425e-9733-7e06a43dc28d" + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAHFCAYAAAAHcXhbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABeFUlEQVR4nO3deVwU9f8H8NdwLTcICCyCiCep4IUHXoCKV3lXfr2vzNREK+8yj1SMb/XVvqaVmUfl8fUiTUUpATXR8MYjNQVFhfAEQQSBz++P+bG5csjKsQy8no/HPGQ+Mzvz3l2WffmZz8xIQggBIiIiIoUy0HcBRERERCXBMENERESKxjBDREREisYwQ0RERIrGMENERESKxjBDREREisYwQ0RERIrGMENERESKxjBDREREisYwQ4q3detWSJKEzZs351vWpEkTSJKEffv25VtWp04dNG/evExqmjdvHiRJwt27d1/q8ceOHUO/fv1Qs2ZN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bt++LSZOnCjc3d2FiYmJqFGjhujdu7eIiIgQQggxdOhQ8eGHH+bbfkpKinjvvfdE3bp1hampqahbt66YMmWKePjwYb51w8PDRbdu3US1atWEqamp8PT0FFOnThW3b98WT548EQ0bNhRjx47N97iffvpJmJqaij///FN89NFHWgNmhSg8zOTm5ooGDRqI8ePHCyHkYDR8+HDh4OAgVCqVqF27thg7dqzm7/7Tp0/F5MmThbW1tbC1tRXvv/9+kadmHzp0SPj5+Ylq1aoJMzMz4e3tLTZv3pz/zRJCbN26VRgYGIikpKQCl3t5eYlJkyYJIeTfS5VKJSwtLbXeo8zMTGFubi7MzMxEZmampv3OnTsiKChING7cWFhaWgorKyvh5eUlPvvsM5GTk1Pg/vK86H1/9rV0d3cXPXv2zLeNwk7NtrGxEWZmZqJbt24Fnpr9rPIKM5IQ5XAwS49SU1NhY2ODlJQUrWPORFR5PXnyBHFxcfDw8Mg3/kAXOTnAoUNAYiKgVgMdOgCGhqVYqJ7l5OTA0dERe/fuRatWrfRai7e3Nz766KNCTwumsvH48WO4uLjg+++/R//+/ct9/0V9VnX5/jYqyyKJiJTM0BB4ZmhDpXPv3j289957aNmypV7ryMrKwoABA9CjRw+91lGV5ObmIikpCZ9//jlsbGxeOFapomOYISKqohwdHfHRRx/puwyYmJhg7ty5+i6jSrlx4wY8PDzg6uqKtWvXwshI2XFA2dUTERGRzmrVqlUup0yXF56aTURERIrGMENElVZl+p8nUWVUWp9RhhkiqnSevQkhEVVceZ/R568crCuOmSGiSsfQ0BC2traaS96bm5vrdA8hIipbQgg8fvwYycnJsLW1hWEJr3nAMENElZKzszMAlMtN7ojo5dja2mo+qyXBMENElZIkSVCr1XB0dMTTp0/1XQ4RPcfY2LjEPTJ5GGaIqFIzNDQstT+YRFQxcQAwERERKRrDDBERESkawwwREREpGsMMERERKRrDDBERESkawwwREREpGsMMERERKRrDDBERESkawwwREREpGsMMERERKRrDDBERESkawwwREREpGsMMERERKRrDDBERESlahQkzwcHBkCQJU6ZM0bSNH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RoBAQH45JNP4ObmVqx96HLMjYiIiCoGxYyZeVGOMjMzw759+8qpGiIiIlKiCnWdGSIiIiJdMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaIxzBAREZGiMcwQERGRojHMEBERkaLpNcwEBwejZcuWsLKygqOjI/r27YtLly5prSOEwLx58+Di4gIzMzP4+/vj/PnzeqqYiIiIKhq9hpmoqChMnDgRR48eRXh4OLKzs9G1a1ekp6dr1gkJCcEXX3yB5cuXIyYmBs7OzggMDMSjR4/0WDkRERFVFJIQQui7iDx37tyBo6MjoqKi0LFjRwgh4OLigilTpmDGjBkAgMzMTDg5OeHTTz/FuHHjXrjN1NRU2NjYICUlBdbW1mX9FIiIiKgU6PL9XaHGzKSkpAAA7OzsAABxcXFISkpC165dNeuoVCr4+fnhyJEjBW4jMzMTqampWhMRERFVXhUmzAgh8P7776N9+/Zo3LgxACApKQkA4OTkpLWuk5OTZtnzgoODYWNjo5nc3NzKtnAiIiLSqwoTZt59912cPXsWGzduzLdMkiSteSFEvrY8s2bNQkpKimZKSEgok3qJiIioYjDSdwEAMGnSJOzcuRMHDx6Eq6urpt3Z2RmA3EOjVqs17cnJyfl6a/KoVCqoVKqyLZiIiIgqDL32zAgh8O6772L79u04cOAAPDw8tJZ7eHjA2dkZ4eHhmrasrCxERUWhbdu25V0uERERVUB67ZmZOHEiNmzYgJ9//hlWVlaacTA2NjYwMzODJEmYMmUKFi9ejHr16qFevXpYvHgxzM3NMXjwYH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XviYe/fuISEhQRNiatWqBRcXlwI/uz169Cj1mhlmXiAtLQ1//fWXZj4uLg6nT5+GnZ0datasiWnTpmHgwIHo2LEjAgICEBYWhl27diEyMlJ/RZPG7Nmz0aNHD7i5ueHRo0fYtGkTIiMjERYWhuzsbLz++us4efIkfvnlF+Tk5CApKQmAPNDNxMREz9UTALz33nto27YtFi9ejDfffBN//PEHvv32W3z77bcAAHt7+3xfhsbGxnB2dkaDBg30UXKVV9TfTRcXlxd+7jw9PVG3bl2MGzcOn332Gezt7REaGorw8HD88ssv+npaVcbEiROxYcMG/Pzzz7CystK8PzY2NjAzM0NaWhrmzZuHAQMGQK1WIz4+HrNnz4aDgwP69esHAJAkCdOmTcPcuXPRpEkTNG3aFOvWrcOff/5ZNtcLKvUDV5VMRESEAJBvGjFihGad1atXi7p16wpTU1PRpEkTERoaqr+CScvo0aOFu7u7MDExEdWrVxedO3fWDCKMi4sr8L0FICIiIvRbOGnZtWuXaNy4sVCpVMLT01N8++23Ra7PMTP6VdTfzeJ+7i5fviz69+8vHB0dhbm5ufD29s53qjaVjcLenzVr1gghhHj8+LHo2rWrqF69ujA2NhY1a9YUI0aMEDdu3Mi3reDgYOHq6irMzc2Fr6+vOHToUJnULP1/4URERESKxAHAREREpGgMM0RERKRoDDNERESkaAwzREREpGgMM0RERKRoDDNERESkaAwzREREpGgMM0SkePPmzUPTpk31XQYR6QnDDBERESkawwwREREpGsMMEZUrf39/BAUFYfr06bCzs4OzszPmzZunWX7jxg306dMHlpaWsLa2xptvvom///5baxtLliyBk5MTrKysMGbMGDx58iTfftasWYNXXnkFpqam8PT0xIoVKzTLsrKy8O6770KtVsPU1BS1atVCcHBwmT1nIipbDDNEVO7WrVsHCwsLHDt2DCEhIViwYAHCw8MhhEDfvn1x//59REVFITw8HFevXsXAgQM1j/3f//6HuXPnYtGiRTh+/DjUarVWUAGAVatW4cMPP8SiRYtw8eJFLF68GHPmzMG6desAAF9++SV27tyJ//3vf7h06RJ+/PFH1KpVqzxfAiIqRbzRJBGVK39/f+Tk5ODQoUOatlatWqFTp07o3LkzevTogbi4OLi5uQEALly4gEaNGuGPP/5Ay5Yt0bZtWzRp0gQrV67UPL5NmzZ48uQJTp8+DQCoWbMmPv30UwwaNEizzsKFC7Fnzx4cOXIEQUFBOH/+PH799VdIklQ+T5yIygx7Zoio3Hl7e2vNq9VqJCcn4+LFi3Bzc9MEGQBo2LAhbG1tcfHiRQDAxYsX4evrq/X4Z+fv3LmDhIQEjBkzBpaWlppp4cKFuHr1KgBg5MiROH36NBo0aICgoCDs37+/rJ4qEZUDI30XQERVj7Gxsda8JEnIzc2FEKLAnpLC2guSm5sLQD7U1Lp1a61lhoaGAIDmzZsjLi4Oe/fuxa+//oo333wTXbp0wdatW1/m6RCRnrFnhogqjIYNG+LGjRtISEjQtF24cAEpKSl45ZVXAACvvPIKjh49qvW4Z+ednJxQo0YNXLt2DXXr1tWaPDw8NOtZW1tj4MCBWLVqFTZv3oxt27bh/v37ZfwMiagssGeGiCqMLl26wNvbG0OGDMHSpUuRnZ2NCRMmwM/PDz4+PgCAyZMnY8SIEfDx8UH79u3x008/4fz586hdu7ZmO/PmzUNQUBCsra3Ro0cPZGZm4vjx43jw4AHef/99/Oc//4FarUbTpk1hYGCALVu2wNnZGba2tnp65kRUEuyZIaIKQ5IkhIaGolq1aujYsSO6dOmC2rVrY/PmzZp1Bg4ciI8//hgzZsxAixYtcP36dYwfP15rO2+99Ra+++47rF27Fl5eXvDz88PatWs1PTOWlpb49NNP4ePjg5YtWyI+Ph579uyBgQH/JBIpEc9mIiIiIkXjf0OIiIhI0RhmiIiISNEYZoiIiEjRGGaIiIhI0RhmiIiISNEYZoiIiEjRGGaIiIhI0RhmiIiISNEYZoiIiEjRGGaIiIhI0RhmiIiISNEYZoiIiEjR/g8TwGLPdIpx8wAAAABJRU5ErkJggg==" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "# Given data\n", + "world_size = ['16', '32', '64', '128', '256']\n", + "aws_cylon = [32.217067956924437, 39.07124400138855, 38.860756039619446, 38.852088809013364, 40.244505405426025]\n", + "\n", + "\n", + "#rp_cylon_err = [1.324570749, 0.5838053194, 0.9581813981, 0.4103170195, 0.7644938386]\n", + "\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, aws_cylon, marker='o', color='b', label='UCC/UCX/Redis AWS Cylon')\n", + "#plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "#plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "#plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "custom_text = \"9.1m rows\"\n", + "plt.text(0.3, 29, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "plt.ylim(15, 50)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('nodes')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Join Operation')\n", + "\n", + "# Add a legend\n", + "plt.legend()\n", + "\n", + "plt.savefig('join-w-scaling.svg', format='svg')\n", + "\n", + "# Display the chart\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "# Given data\n", + "world_size = ['16', '32', '64', '128', '256']\n", + "aws_cylon = [56.612007474899292, 33.886670994758606, 16.14104320406913, 8.0112933546304703, 3.9909562155604362]\n", + "#rp_cylon = [14.48042241, 9.80326847, 7.814679284, 6.180011416, 5.271671858, 4.710637883]\n", + "\n", + "#rp_cylon_err = [1.009763211, 0.7171293985, 0.8766151569, 1.457741798, 1.666529573, 1.440726585]\n", + "#bm_cylon_err = [1.324570749, 0.5838053194, 0.9581813981, 0.4103170195, 0.7644938386, 1.53159382]\n", + "\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, aws_cylon, marker='o', color='b', label='UCC/UCX/Redis AWS Cylon')\n", + "#plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "\n", + "#plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "#plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "custom_text = \"145m rows\"\n", + "plt.text(0.3, 17, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "plt.ylim(1, 60)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('nodes')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Strong Scaling of Join Operation')\n", + "\n", + "# Add a legend\n", + "plt.legend()\n", + "\n", + "plt.savefig('join-s-scaling.svg', format='svg')\n", + "\n", + "# Display the chart\n", + "plt.show()\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "HvgUPka-uMRo", + "outputId": "7fd8d45a-823b-4360-c1f1-593e70d31515" + }, + "execution_count": 18, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAHFCAYAAAAHcXhbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABs7klEQVR4nO3dd1hT1/8H8HfYGxRlCQJuEXDhAAc4cNbdat1W2/qtWsWtrVZrW1FrHa1Wa7Vq66yz2rpoBVy4xYHWiVvqBgEFgfP74/yIRECJEi6B9+t58pjcnNx8Eoh5c+4556qEEAJEREREespA6QKIiIiI3gbDDBEREek1hhkiIiLSawwzREREpNcYZoiIiEivMcwQERGRXmOYISIiIr3GMENERER6jWGGiIiI9BrDDOmlQ4cOoVOnTihbtixMTU3h6OgIf39/jBw5UqPdjz/+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Gl5cXrl+/jhs3bqi3nT17FvHx8ahatSoAoGrVqjh48KDG47LednR0RJkyZXDlyhVUqFBB4+Lp6aluZ2Njg27duuHnn3/G2rVrsWHDBjx8+FDHr5CIdIE9M0RUaDRv3hy+vr7o2bMn5syZg7S0NAwaNAiBgYHw8/MDAAwbNgx9+/aFn58fGjZsiJUrVyImJgblypVT72fy5MkYOnQobGxs0Lp1a6SkpODo0aN49OgRRowYgdmzZ8PZ2Rk1atSAgYEB1q1bBycnJ9jZ2Sn0yonobbBnhogKDZVKhc2bN6NEiRJo3LgxmjdvjnLlymHt2rXqNt26dcMXX3yBsWPHonbt2rh27Ro++eQTjf18+OGHWLx4MZYtWwYfHx8EBgZi2bJl6p4ZKysrTJ8+HX5+fqhTpw6uXr2Kbdu2wcCA/yUS6SPOZiIiIiK9xj9DiIiISK8xzBAREZFeY5ghIiIivcYwQ0RERHqNYYaIiIj0GsMMERER6TWGGSIiItJrDDNERESk1xhmiIiISK8xzBAREZFeY5ghIiIivcYwQ0RERHrt/wAzjHbLe59UqQAAAABJRU5ErkJggg==" + }, + "metadata": {}, + "output_type": "display_data" + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "2vSanYys6E68" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from IPython.core.display import SVG\n", + "from matplotlib import markers\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data loading\n", + "\n", + "world_size = ['4|148', '6|222', '8|296', '10|370', '12|444', '14|518']\n", + "baremetal_cylon = [18.93717813, 19.75821758, 19.84387813, 20.68476873, 21.04591821, 21.59903709]\n", + "rp_cylon = [19.27405391, 20.4443211, 20.7198427, 21.2812939, 21.50566909, 21.78800784]\n", + "\n", + "rp_cylon_err = [0.2107801437, 0.3222160003, 1.022121528, 0.349553999, 0.3169727816, 1.534950139]\n", + "bm_cylon_err = [0.6005659103, 1.614059141, 0.8212216271, 0.2230492727, 0.1857792821, 2.082797966]\n", + "\n", + "plt.plot(world_size, baremetal_cylon, marker='o', color='b', label='BM-Cylon')\n", + "plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "\n", + "plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "custom_text = \"35m rows\"\n", + "plt.text(4, 24, custom_text, fontsize=10, color='orange', ha='center')\n", + "\n", + "plt.ylim(15, 25)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "plt.xlabel('nodes | parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Sort Operation')\n", + "\n", + "plt.legend()\n", + "\n", + "#save the figure\n", + "plt.savefig('sort-w-scaling.svg', format='svg')\n", + "\n", + "#display the graph\n", + "\n", + "plt.show()\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "eg1zeZcSLRAI", + "outputId": "3ab2569d-7c8c-4317-8a24-ea9de8c62b34" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAHICAYAAABZM3D8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB99ElEQVR4nO3deXhMVwMG8Hey74lEVrLZEvteJCGoXa0tRVVSWvrZq9TWNlFFUVsVpVW0itZatZUiSGIpFaXUToIQa/Z15nx/3GaSMZNkJvsk7+95pjL3nrlz7k2aeXPOuefIhBACRERERHrMoKwrQERERFRUDDRERESk9xhoiIiISO8x0BAREZHeY6AhIiIivcdAQ0RERHqPgYaIiIj0HgMNERER6T0GGiIiItJ7DDRExSg4OBhWVlZlXQ2dtG/fH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jsXPnTvTt21e5PykpCdOmTcOuXbvw9OlTeHt7Y/z48Xj//ffLrtJUYjjfDxERFVaZBprk5GQ0btwYw4cPR//+/dX2T5o0CUeOHMHGjRvh5eWFgwcPYvTo0XBzc0PvwnzyUbnGriMiIiqsMg003bt3R/fu3fPcHxkZiaCgILRv3x4AMHLkSKxevRpnzpxhoCEiIiKlcn2Xk5+fH3bv3o379+9DCIGjR4/i2rVr6NKlS56vSU9PR0JCgsqDiIiIKrZyHWiWL1+OevXqoXr16jAxMUG3bt2wYsUKtGvXLs/XzJs3D7a2tsqHu7t7KdaYiIiIykK5DzSnTp3C7t27ce7cOSxatAhjxozBH3/8kedrpk+fjvj4eOUjJiamFGtMREREZaHc3radmpqKGTNmYOfOnejZsycAoFGjRoiKisKXX36JTp06aXydqakpTE1NS7OqREREVMbKbQtNZmYmMjMzYWCgWkVDQ0MoFIoyqhURERGVR2XaQpOUlIQbN24on9++fRtRUVGwt7eHh4cHAgMDMWXKFJibm8PT0xPHjh3DDz/8gMWLF5dhrYmIiKi8kQkhRFm9eVhYGDp06KC2PSgoCOvXr8fDhw8xffp0HDx4EM+ePYOnpydGjhyJDz74ADKZTKv3SEhIgK2tLeLj42FjY1Pcp0BEREQlQNfP7zINNKWBgYaIiEj/6Pr5XW7H0BARERFpi4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvlWmgOX78OHr16gU3NzfIZDLs2rVLrcyVK1fQu3dv2NrawtLSEi1btkR0dHTpV5aIiIjKrTINNMnJyWjcuDFWrFihcf/NmzcREBAAX19fhIWF4e+//8Ynn3wCMzOzUq4pERERlWcyIYQo60oAgEwmw86dO9G3b1/ltkGDBsHY2Bg//vhjoY+bkJAAW1tbxMfHw8bGphhqSkRERCVN18/vcjuGRqFQYO/evahTpw66du0KJycntGrVSmO3FBEREVVu5TbQxMXFISkpCV988QW6deuGgwcPol+/fujfvz+OHTuW5+vS09ORkJCg8iAiIqKKzaisK5AXhUIBAOjTpw8++OADAECTJk0QGRmJb775BoGBgRpfN2/ePMyaNavU6klERERlr9y20FStWhVGRkaoV6+eyva6devme5fT9OnTER8fr3zExMSUdFWJiIiojJXbFhoTExO0bNkSV69eVdl+7do1eHp65vk6U1NTmJqalnT1iIiIqBwp00CTlJSEGzduKJ/fvn0bUVFRsLe3h4eHB6ZMmYI333wT7dq1Q4cOHXDgwAH89ttvCAsLK7tKExERUblTprdth4WFoUOHDmrbg4KCsH79egDA999/j3nz5uHevXvw8fHBrFmz0KdPH63fg7dtExER6R9dP7/LzTw0JYWBhoiISP9UmHloiIiIiLTFQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr3HQENERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPeMyroCJU0IAQBISEgo45oQERGRtrI/t7M/xwtS4QNNYmI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oE+fPhg6dCgAaazRtWvXlNekIM2aNcPDhw9hZGRU6LFCMpkM/v7+8Pf3x6effgpPT0/s3LkTkyZNKtTxiCo7BhqiCqxTp05o2LAh3nrrLSxduhRZWVkYPXo0AgMDld0wEyZMQHBwMFq0aAF/f3/89NNP+Oeff1CjRg3lcWbNmoXx48fD1tYW3bp1Q3p6Os6ePYvnz59j0qRJWLx4MVxdXdG0aVMYGBhg69atcHFx0aq1Ij8ZGRkYMWIEPv74Y9y5cwchISEYO3YsDAwMUKVKFTg4OGDNmjVwdXVFdHQ0pk2bptVxa9eujW3btiEyMhJVqlTB4sWL8ejRI60DTadOndCmTRv07dsXCxYsQJ06dfDgwQPs3bsX/fr1U+vietnp06dx+PBhdOnSBU5OTjh9+jQeP36MunXravX+RKSOgYaoApPJZPj1118xbtw4tGvXDgYGBujWrRuWL1+uLPPmm2/i5s2b+Oijj5CWlobXX38d//vf//D7778ry7z77ruwsLDAwoULMWXKFFhaWqJhw4bKmXStra2xYMECXL9+HYaGhmjZsiX27dunMgakMF599VXUrl0b7dq1Q3p6OgYPHqy8Ld3AwABbtmzB+PHj0aBBA/j4+OCrr75C+/btCzzuxx9/jFu3bqFr166wsLDAyJEj0bdvX8THx2tVL5lMhn379mHmzJl455138PjxY7i4uKBdu3ZwdnYu8PU2NjY4fvw4li5dioSEBHh6emLRokXo3r27Vu9PROpkQnDqSiIqXXfu3IG3t3e+M+cGBwfjxYsX2LVrV+lVjIj0Fu9yIiIiIr3HQENERER6j2NoiKjU2dnZISQkJN8y69evL53KEFGFwDE0REREpPfY5URERER6j4GGiIiI9B4DDREREek9BhoiIiLSeww0REREpPcYaIiIiEjvMdAQERGR3mOgISIiIr33f73LRnPSSL+kAAAAAElFTkSuQmCC\n" + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "from IPython.core.display import SVG\n", + "from matplotlib import markers\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data loading\n", + "\n", + "world_size = ['4|148', '6|222', '8|296', '10|370', '12|444', '14|518']\n", + "baremetal_cylon = [12.48204808, 8.280943102, 6.334967629, 5.099316477, 4.445687452, 3.851617681]\n", + "rp_cylon = [12.55294192, 8.420808574, 6.376633428, 5.131316051, 4.446267159, 3.95247161]\n", + "\n", + "rp_cylon_err = [0.6438074455, 0.6394383387, 0.8082996274, 1.177945473, 1.520513786, 1.981052724]\n", + "bm_cylon_err = [0.5287349256, 0.5657937827, 0.3046811328, 1.282029453, 1.70061018, 1.693347512]\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, baremetal_cylon, marker='o', color='b', label='BM-Cylon')\n", + "plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "custom_text = \"3.5B rows\"\n", + "plt.text(0.3, 14, custom_text, fontsize=10, color='orange', ha='center')\n", + "\n", + "plt.ylim(1, 15)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "plt.xlabel('nodes | parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Strong Scaling of Sort Operation')\n", + "\n", + "plt.legend()\n", + "\n", + "#save the figure\n", + "plt.savefig('sort-s-scaling.svg', format='svg')\n", + "\n", + "#display the graph\n", + "\n", + "plt.show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "dFHyhBGqR8cL", + "outputId": "2f2f0768-20ff-4b13-baee-fd61c2c97c8a" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAHICAYAAABZM3D8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9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gL02seDBw+oVq0aMTEx9O3bFxcXFxYuXEjz5s1ZtWoVrVq1olatWixatIhOnTrRsGFDOnfu/No2fXx8APjzzz/54YcfXjs4dfv27TRu3JhChQoRFBREbGwsv/32G9WrV+fkyZP4+vrq1H/1c1W+fHnu3bvHtm3bWLRo0RuPd//+/YSFhdGvX780ezA6d+7M/Pnz2bhxI++//762PCQkhE8++YSvvvqKgIAA5s+fz8cff8w///xDw4YNAc24ltq1a3P37l169OhBgQIFOHjwIMOGDSM0NDTFQOr58+cTFxfHl19+iaWlJc7OzkRERDB37lw6dOjAF198QWRkJPPmzaNRo0YcPXqUcuXK4erqysyZM/n6669p1aoVrVu3BsDf3z/NY8/of38ilzF0RiVEevz777+KqampYmpqqlStWlUZPHiwsnXrViUhISFFXVtbW22vzMue/2XYoUMHnfLnPQaff/65Tvk333yjADp/ffr4+CiAsnfvXm3Zw4cPFUtLS2XQoEHasj59+igqlUo5deqUtuzJkyeKs7OzXj008+bNUwDFwsJCqVu3rjJ8+HBl3759On9JK4qi7Ny5UwGUvn37pmhDrVZrX8fExKRY36hRI6VQoUI6Zfr20ADKyJEjdbYtX768UrFiRe371atXK4AyZcoUbVlycrJSr149vXpo+vfvrwDKvn37tGWRkZFKwYIFFV9fX51zASi9evV6bXuKojkPfn5+CqD4+PgoXbp0UebNm6c8ePAgRd1y5copbm5uypMnT7Rlp0+fVkxMTJTOnTtry9L6XCmKovTq1eu1vTIvmzJligIoa9euTbPO06dPFUBp3bq1tuz5Z/LlHpnw8HDFw8NDKV++vLZs1KhRiq2trXL58mWdNocOHaqYmpoqt27dUhTlxc/cwcFBefjwoU7dpKQkJT4+XqcsLCxMyZcvn9KtWzdt2aNHj3R6ZV72ag9NZvz7E7mL3OUkjErDhg05dOgQzZs35/Tp04wfP55GjRqRP39+NmzYkK62vvrqK533mzdvBmDgwIE65YMGDQJg06ZNOuUlS5akZs2a2veurq74+flx7do1bdk///xD1apVKVeunLbM2dmZjh076hVjt27d+Oeff6hTpw779+9n1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nx5FxnDTnPWUPOc9aQ85w1stN5zvGDgoUQQgiR80kPjRBCCCGMniQ0QgghhDB6ktAIIYQQwuhJQpOKoKAgunTpYugwcoUFCxZQp04dQ4eR48l5NowuXboQFBRk6DByPDnPWSc7n+tcn9CMGzcOlUpF//7906wTFxdHly5dKFOmDGZmZrRs2fK1bR44cAAzMzPKlSunU56cnMzw4cMpWLAg1tbWFC5cmFGjRun9nApjdPfuXT777DNcXFywtramTJkyHD9+PM36p0+fpkOHDnh7e2NtbU2JEiWYOnWqTp01a9bQsGFDXF1dcXBwoGrVqmzdulWnztixY6lcuTL29va4ubnRsmVLLl26lCnHaGhv87nS5zwDTJ8+nRIlSmBtbY2fnx9//vlnijrPnj2jV69eeHh4YGlpSbFixdi8eXOGHqMh7N27l2bNmuHp6YlKpWLdunU66xVF4ccff8TDwwNra2saNGhASEjIa9vcv38/1atX1/57KF68OJMnT9ap4+vri0qlSrH06tVLWycuLo5evXrh4uKCnZ0dbdq04cGDBxl27Fnpdec5MTGRIUOGUKZMGWxtbfH09KRz587cu3dP7/bT+n38sjd9DyiKQuPGjVP9HBiTN32mX/bVV1+hUqmYMmXKa9vcvXt3qp/X+/fvp2u/UVFR9O7dGy8vL6ytrSlZsiS///57uo4vx88U/DrHjh1j1qxZ+Pv7v7ZecnIy1tbW9O3bl9WrV7+27rNnz+jcuTP169dP8Qvm559/ZubMmSxcuJBSpUpx/PhxunbtiqOjI3379n3n48luwsLCqF69OnXr1mXLli24uroSEhJCnjx50tzmxIkTuLm5sXjxYry9vTl48CBffvklpqam9O7dG9D842jYsCFjxozBycmJ+fPn06xZM44cOUL58uUB2LNnD7169aJy5cokJSXx3Xff8cEHH3D+/HlsbW2z5Pizytt8rvQ5zzNnzmTYsGHMmTOHypUrc/ToUb744gvy5MlDs2bNAEhISKBhw4a4ubmxatUq8ufPz82bN3Fycsqqw8800dHRlC1blm7dutG6desU68ePH8+vv/7KwoULKViwIMOHD6dRo0acP38eKyurVNu0tbWld+/e+Pv7Y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fUV7eztGRkZwfn4Ot9uNnp4eCIIAlUqFjIwMTE9PQ6vV4uLiAkNDQ3GNq9frsbi4iGAwCJVKBa/Xi5ubm7gDjdlsRnl5OaxWKzweD/Ly8nB1dYXV1VU0NDS8W+L6p1AohM3NTdTU1CAzMxOhUAiRSAQFBQVxzU9E7zHQEP1gMpkMKysr6O3thclkgiAIsFgs8Pv9YhubzYazszMMDg7i5eUFjY2N6Orqwtramtimo6MDCoUC4+PjGBgYQFJSEgwGg3iSbkpKCjweD05PTyGXy1FWVoZAIPC3PSBfUV1dDb1eD5PJhFgshubmZvGzdEEQMD8/D6fTiaKiIuTn52NqagpVVVWfjjsyMoJwOIza2looFAp0dnbCarXi4eEhrrpkMhkCgQCGh4fR1taGSCQCjUYDk8kEtVr9aX+lUont7W34fD48Pj4iJycHExMTqKuri2t+InpP9usXj64kou91fn4OnU734cm5DocD0WgUy8vL31cYEUkWv3IiIiIiyWOgISIiIsnjHhoi+nZpaWlwu90ftpmdnf2eYojoR+AeGiIiIpI8LjkRERGR5DHQEBERkeQx0BAREZHkMdAQERGR5DHQEBERkeQx0BAREZHkMdAQERGR5DHQEBERkeT9Bok5eWGxVJtBAAAAAElFTkSuQmCC\n" + }, + "metadata": {} + } + ] + } + ] +} diff --git a/aws/scripts/S3_run_script.py b/aws/scripts/S3_run_script.py new file mode 100644 index 000000000..84bd94db0 --- /dev/null +++ b/aws/scripts/S3_run_script.py @@ -0,0 +1,67 @@ +import subprocess +import time +import argparse + +import boto3 +from botocore.exceptions import ClientError +import os + +import logging + +def environ_or_required(key, required: bool = True): + return ( + {'default': os.environ.get(key)} if os.environ.get(key) + else {'required': required} + ) + +def get_file(file_name, bucket, object_name=None): + """Upload a file to an S3 bucket + + :param file_name: File to upload + :param bucket: Bucket to upload to + :param object_name: S3 object name. If not specified then file_name is used + :return: True if file was uploaded, else False + """ + + # If S3 object_name was not specified, use file_name + if object_name is None: + object_name = os.path.basename(file_name) + + # download the file + s3_client = boto3.client('s3') + try: + with open(file_name, 'wb') as f: + s3_client.download_fileobj(bucket, object_name, f) + return f + except ClientError as e: + logging.error(e) + return None + + + +def join(data=None): + script = get_file(file_name=data['output_filename'], bucket=data['s3_bucket'], object_name=data['s3_object_name']) + + if script is None: + print(f"unable to retrieve file {data['output_filename']} from AWS S3") + + scriptargs = data['args'] + if scriptargs is not None: + cmd = scriptargs.split() + subprocess.call(['python'] + [data['output_filename']] + cmd, shell=False) + else: + subprocess.call(['python'] + [data['output_filename']], shell=False) +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="run S3 script") + + parser.add_argument('-b', dest='s3_bucket', type=str, help="S3 Bucket Name", **environ_or_required('S3_BUCKET')) + parser.add_argument('-o', dest='s3_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_OBJECT_NAME')) + parser.add_argument('-f', dest='output_filename', type=str, help="Output filename", + **environ_or_required('OUTPUT_FILENAME')) + parser.add_argument('-a', dest='args', type=str, help="script exec arguments", + **environ_or_required('EXEC_ARGS', required=False)) + + + + args = vars(parser.parse_args()) + join(args) diff --git a/aws/scripts/clearDb.py b/aws/scripts/clearDb.py new file mode 100644 index 000000000..c2a1e7347 --- /dev/null +++ b/aws/scripts/clearDb.py @@ -0,0 +1,25 @@ +import redis +import argparse +import os + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="clear redis db") + parser.add_argument("-r", dest='redis_host', type=str, help="redis address, default to 127.0.0.1", + **environ_or_required('REDIS_HOST')) #127.0.0.1 + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", **environ_or_required('REDIS_PORT')) #6379 + + + + args = vars(parser.parse_args()) + + r = redis.Redis(host=args['redis_host'], port=args['redis_port'], db=0) + if r is not None: + r.flushdb() + print("flushed redisDB") + else: + print("warn - could not flush db") + + + + diff --git a/aws/scripts/cloudformation/cylon-elasticache.yaml b/aws/scripts/cloudformation/cylon-elasticache.yaml new file mode 100644 index 000000000..771b20270 --- /dev/null +++ b/aws/scripts/cloudformation/cylon-elasticache.yaml @@ -0,0 +1,71 @@ +AWSTemplateFormatVersion: 2010-09-09 + +Parameters: + AvailabilityZone1: + Type: String + + AvailabilityZone2: + Type: String + + CacheEngine: + Type: String + + CacheEngineVersion: + Type: String + + CacheNodeType: + Type: String + + CacheParameterGroupName: + Type: String + + CacheSecurityGroup: + Type: String + + CacheSubnet1: + Type: String + + CacheSubnet2: + Type: String + + Prefix: + Type: String + + RedisPort: + Type: Number + + ReplicaCount: + Type: Number + + +Resources: + SubnetGroup: + Type: AWS::ElastiCache::SubnetGroup + Properties: + CacheSubnetGroupName: !Sub "${Prefix}-subnetgroup" + Description: !Sub "${Prefix}-SubnetGroup" + SubnetIds: + - !Ref CacheSubnet1 + - !Ref CacheSubnet2 + Tags: + - Key: "name" + Value: !Sub "${Prefix}-Redis SubnetGroup" + + + + + CacheCluster: + Type: AWS::ElastiCache::CacheCluster + Properties: + ClusterName: !Sub "${Prefix}-Redis" + CacheNodeType: !Ref CacheNodeType + CacheSubnetGroupName: !Ref SubnetGroup + Engine: !Ref CacheEngine + EngineVersion: 7.0 + NumCacheNodes: 1 #has to be 1 for redis + VpcSecurityGroupIds: + - !Ref CacheSecurityGroup + Tags: + - Key: "name" + Value: !Sub "${Prefix}-Redis Cluster" + DependsOn: SubnetGroup \ No newline at end of file diff --git a/aws/scripts/cloudformation/cylon-redis.yaml b/aws/scripts/cloudformation/cylon-redis.yaml new file mode 100644 index 000000000..0046250af --- /dev/null +++ b/aws/scripts/cloudformation/cylon-redis.yaml @@ -0,0 +1,90 @@ +AWSTemplateFormatVersion: "2010-09-09" +Parameters: + TemplateBucketName: + Type: String + Default: staylor.dev2 + + Prefix: + Type: String + Default: cylon + + Architecture: + Type: String + Default: arm64 + + AvailabilityZone1: + Type: String + Default: us-east-1c + + AvailabilityZone2: + Type: String + Default: us-east-1d + + CacheEngine: + Type: String + Default: redis + + CacheEngineVersion: + Type: String + Default: 6.2 + + CacheNodeType: + Type: String + Default: cache.t4g.micro + + CacheParameterGroupName: + Type: String + Default: default.redis7.cluster.on + + CacheSecurityGroupName: + Type: String + Default: sg-0da3e3dcebe706315 + + CacheSubnet1: + Type: String + Default: subnet-07995eea6c462cd73 + + CacheSubnet2: + Type: String + Default: subnet-039df5ab7fd94f516 + + ImageId: + Type: String + Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-arm64-gp2 + + InstanceType: + Type: String + Default: t4g.nano + + ReplicaCount: + Type: Number + Default: 1 + + Runtime: + Type: String + Default: python3.8 + + RedisPort: + Type: Number + Default: 6379 + + +Resources: + ElastiCacheStack: + Type: AWS::CloudFormation::Stack + "DeletionPolicy" : "Delete" + Properties: + TemplateURL: !Sub "https://s3.amazonaws.com/${TemplateBucketName}/${Prefix}/${Prefix}-elasticache.yaml" + Parameters: + AvailabilityZone1: !Ref AvailabilityZone1 + AvailabilityZone2: !Ref AvailabilityZone2 + CacheEngine: !Ref CacheEngine + CacheEngineVersion: !Ref CacheEngineVersion + CacheNodeType: !Ref CacheNodeType + CacheParameterGroupName: !Ref CacheParameterGroupName + CacheSecurityGroup: !Ref CacheSecurityGroupName + CacheSubnet1: !Ref CacheSubnet1 + CacheSubnet2: !Ref CacheSubnet2 + Prefix: !Ref Prefix + RedisPort: !Ref RedisPort + ReplicaCount: !Ref ReplicaCount diff --git a/aws/scripts/cylon-redis-task-def.json b/aws/scripts/cylon-redis-task-def.json new file mode 100644 index 000000000..322d75f0a --- /dev/null +++ b/aws/scripts/cylon-redis-task-def.json @@ -0,0 +1,112 @@ +{ + "taskDefinition": { + "containerDefinitions": [ + { + "name": "cylon-ucc-ucx-redis", + "image": "448324707516.dkr.ecr.us-east-1.amazonaws.com/cylon-ucc-ucx-redis:latest", + "cpu": 8192, + "memory": 32768, + "portMappings": [], + "essential": true, + "command": [ + "python", + "/cylon/aws/scripts/S3_run_script.py" + ], + "environment": [ + { + "name": "S3_BUCKET", + "value": "staylor.dev2" + }, + { + "name": "S3_OBJECT_NAME", + "value": "cylon/scripts/cylon_scaling.py" + }, + { + "name": "OUTPUT_FILENAME", + "value": "cylon_scaling.py" + }, + { + "name": "EXEC_ARGS", + "value": "-n 5000 -s w -w 1 -r cylon-redis.mveu6e.0001.use1.cache.amazonaws.com -f1 cylon_scaling_test_fargate -b staylor.dev2 -o1 cylon/scaling/cylon_scaling_test_fargate.txt -f2 cylon_summary_test_fargate -o2 cylon/scaling/cylon_summary_test_fargate.txt" + } + ], + "environmentFiles": [], + "mountPoints": [], + "volumesFrom": [], + "ulimits": [], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-create-group": "true", + "awslogs-group": "/ecs/cylon-ucc-ucx-redis-task", + "awslogs-region": "us-east-1", + "awslogs-stream-prefix": "ecs" + } + }, + "linuxParameters": { + "sharedMemorySize": 8589934592 + } + } + ], + "family": "cylon-ucc-ucx-redis-task", + "taskRoleArn": "arn:aws:iam::448324707516:role/ECSTaskRole", + "executionRoleArn": "arn:aws:iam::448324707516:role/ecsTaskExecutionRole", + "networkMode": "awsvpc", + "revision": 1, + "volumes": [], + "status": "ACTIVE", + "requiresAttributes": [ + { + "name": "com.amazonaws.ecs.capability.logging-driver.awslogs" + }, + { + "name": "ecs.capability.execution-role-awslogs" + }, + { + "name": "com.amazonaws.ecs.capability.ecr-auth" + }, + { + "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19" + }, + { + "name": "ecs.capability.increased-task-cpu-limit" + }, + { + "name": "com.amazonaws.ecs.capability.task-iam-role" + }, + { + "name": "ecs.capability.execution-role-ecr-pull" + }, + { + "name": "ecs.capability.extensible-ephemeral-storage" + }, + { + "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18" + }, + { + "name": "ecs.capability.task-eni" + }, + { + "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29" + } + ], + "placementConstraints": [], + "compatibilities": [ + "EC2", + "FARGATE" + ], + "runtimePlatform": { + "cpuArchitecture": "X86_64", + "operatingSystemFamily": "LINUX" + }, + "requiresCompatibilities": [ + "FARGATE" + ], + "cpu": "8192", + "memory": "32768", + "ephemeralStorage": { + "sizeInGiB": 100 + } + }, + "tags": [] +} \ No newline at end of file diff --git a/aws/scripts/cylon_scaling.py b/aws/scripts/cylon_scaling.py new file mode 100644 index 000000000..34ba2015b --- /dev/null +++ b/aws/scripts/cylon_scaling.py @@ -0,0 +1,294 @@ +import time +import argparse + +import pandas as pd +from numpy.random import default_rng +from pycylon.frame import CylonEnv, DataFrame +from cloudmesh.common.StopWatch import StopWatch +from cloudmesh.common.dotdict import dotdict +from cloudmesh.common.Shell import Shell +from cloudmesh.common.util import writefile +from pycylon.net.ucc_config import UCCConfig +from pycylon.net.redis_ucc_oob_context import UCCRedisOOBContext +from pycylon.net.reduce_op import ReduceOp +import boto3 +from botocore.exceptions import ClientError +import os + +import logging + +def environ_or_required(key): + return ( + {'default': os.environ.get(key)} if os.environ.get(key) + else {'required': True} + ) +def upload_file(file_name, bucket, object_name=None): + """Upload a file to an S3 bucket + + :param file_name: File to upload + :param bucket: Bucket to upload to + :param object_name: S3 object name. If not specified then file_name is used + :return: True if file was uploaded, else False + """ + + # If S3 object_name was not specified, use file_name + if object_name is None: + object_name = os.path.basename(file_name) + + # Upload the file + s3_client = boto3.client('s3') + try: + response = s3_client.upload_file(file_name, bucket, object_name) + except ClientError as e: + logging.error(e) + return False + return True + + +def cylon_join(data=None): + global ucc_config + StopWatch.start(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) * 1000 + # sum_t = comm.reduce(t) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + + +def cylon_sort(data=None): + StopWatch.start(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.sort_values(by=[0], env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + + + StopWatch.stop(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + redis_context.clearDB() + + +def cylon_slice(data=None): + StopWatch.start(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1[0:20000000, env] # distributed slice + # print(df3) + # df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="cylon scaling") + parser.add_argument('-n', dest='rows', type=int, **environ_or_required('ROWS')) + parser.add_argument('-i', dest='it', type=int, **environ_or_required('PARTITIONS')) #10 + parser.add_argument('-u', dest='unique', type=float, **environ_or_required('UNIQUENESS'), help="unique factor") #0.9 + parser.add_argument('-s', dest='scaling', type=str, **environ_or_required('SCALING'), choices=['s', 'w'], + help="s=strong w=weak") #w + parser.add_argument('-o', dest='operation', type=str, **environ_or_required('CYLON_OPERATION'), choices=['join', 'sort', 'slice'], + help="s=strong w=weak") # w + parser.add_argument('-w', dest='world_size', type=int, help="world size", **environ_or_required('WORLD_SIZE')) + parser.add_argument("-r", dest='redis_host', type=str, help="redis address, default to 127.0.0.1", + **environ_or_required('REDIS_HOST')) #127.0.0.1 + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", **environ_or_required('REDIS_PORT')) #6379 + parser.add_argument('-f1', dest='output_scaling_filename', type=str, help="Output filename for scaling results", + **environ_or_required('OUTPUT_SCALING_FILENAME')) + parser.add_argument('-f2', dest='output_summary_filename', type=str, help="Output filename for scaling summary results", + **environ_or_required('OUTPUT_SUMMARY_FILENAME')) + parser.add_argument('-b', dest='s3_bucket', type=str, help="S3 Bucket Name", **environ_or_required('S3_BUCKET')) + parser.add_argument('-o1', dest='s3_stopwatch_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_STOPWATCH_OBJECT_NAME')) + parser.add_argument('-o2', dest='s3_summary_object_name', type=str, help="S3 Object Name", + **environ_or_required('S3_SUMMARY_OBJECT_NAME')) + + args = vars(parser.parse_args()) + args['host'] = "aws" + if args['operation'] == 'join': + print("executing cylon join operation") + cylon_join(args) + elif args['operation'] == 'sort': + print("executing cylon sort operation") + cylon_sort(args) + else: + print ("executing cylon slice operation") + cylon_slice(args) + + + # os.system(f"{git} branch | fgrep '*' ") + # os.system(f"{git} rev-parse HEAD") diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt new file mode 100644 index 000000000..0aa62291c --- /dev/null +++ b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-17 20:26:30.358977 | +| frequency | scpufreq(current=3409.9529375, min=0.0, max=0.0) | +| mem.active | 1.4 GiB | +| mem.available | 28.5 GiB | +| mem.free | 23.6 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 6.4 % | +| mem.total | 30.4 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-84-64.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------| +| join_total_aws_145000000_10 | ok | 117.427 | 117.427 | 2023-08-17 20:24:32 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_145000000_10 | ok | 4.032 | 4.032 | 2023-08-17 20:25:50 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_145000000_10 | ok | 3.958 | 3.958 | 2023-08-17 20:25:54 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_145000000_10 | ok | 4.009 | 4.009 | 2023-08-17 20:25:58 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_145000000_10 | ok | 4.168 | 4.168 | 2023-08-17 20:26:02 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_145000000_10 | ok | 3.938 | 3.938 | 2023-08-17 20:26:06 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_145000000_10 | ok | 3.96 | 3.96 | 2023-08-17 20:26:10 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_145000000_10 | ok | 3.95 | 3.95 | 2023-08-17 20:26:14 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_145000000_10 | ok | 3.934 | 3.934 | 2023-08-17 20:26:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_145000000_10 | ok | 4.016 | 4.016 | 2023-08-17 20:26:22 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_145000000_10 | ok | 3.966 | 3.966 | 2023-08-17 20:26:26 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_145000000_10,ok,117.427,117.427,2023-08-17 20:24:32,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_145000000_10,ok,4.032,4.032,2023-08-17 20:25:50,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_145000000_10,ok,3.958,3.958,2023-08-17 20:25:54,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_145000000_10,ok,4.009,4.009,2023-08-17 20:25:58,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_145000000_10,ok,4.168,4.168,2023-08-17 20:26:02,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_145000000_10,ok,3.938,3.938,2023-08-17 20:26:06,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_145000000_10,ok,3.96,3.96,2023-08-17 20:26:10,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_145000000_10,ok,3.95,3.95,2023-08-17 20:26:14,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_145000000_10,ok,3.934,3.934,2023-08-17 20:26:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_145000000_10,ok,4.016,4.016,2023-08-17 20:26:22,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_145000000_10,ok,3.966,3.966,2023-08-17 20:26:26,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt new file mode 100644 index 000000000..735e9b9ec --- /dev/null +++ b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-17 19:51:44.964867 | +| frequency | scpufreq(current=3407.9141250000002, min=0.0, max=0.0) | +| mem.active | 14.0 GiB | +| mem.available | 15.8 GiB | +| mem.free | 10.9 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 48.1 % | +| mem.total | 30.4 GiB | +| mem.used | 14.2 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-85-157.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_145000000_10 | ok | 570.749 | 570.749 | 2023-08-17 19:42:13 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_145000000_10 | ok | 56.413 | 56.413 | 2023-08-17 19:42:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_145000000_10 | ok | 56.52 | 56.52 | 2023-08-17 19:43:14 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_145000000_10 | ok | 56.702 | 56.702 | 2023-08-17 19:44:11 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_145000000_10 | ok | 56.717 | 56.717 | 2023-08-17 19:45:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_145000000_10 | ok | 56.617 | 56.617 | 2023-08-17 19:46:04 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_145000000_10 | ok | 56.766 | 56.766 | 2023-08-17 19:47:01 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_145000000_10 | ok | 56.604 | 56.604 | 2023-08-17 19:47:58 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_145000000_10 | ok | 56.641 | 56.641 | 2023-08-17 19:48:54 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_145000000_10 | ok | 56.554 | 56.554 | 2023-08-17 19:49:51 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_145000000_10 | ok | 56.589 | 56.589 | 2023-08-17 19:50:48 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_145000000_10,ok,570.749,570.749,2023-08-17 19:42:13,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_145000000_10,ok,56.413,56.413,2023-08-17 19:42:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_145000000_10,ok,56.52,56.52,2023-08-17 19:43:14,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_145000000_10,ok,56.702,56.702,2023-08-17 19:44:11,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_145000000_10,ok,56.717,56.717,2023-08-17 19:45:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_145000000_10,ok,56.617,56.617,2023-08-17 19:46:04,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_145000000_10,ok,56.766,56.766,2023-08-17 19:47:01,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_145000000_10,ok,56.604,56.604,2023-08-17 19:47:58,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_145000000_10,ok,56.641,56.641,2023-08-17 19:48:54,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_145000000_10,ok,56.554,56.554,2023-08-17 19:49:51,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_145000000_10,ok,56.589,56.589,2023-08-17 19:50:48,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt new file mode 100644 index 000000000..48316cd02 --- /dev/null +++ b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-17 20:00:57.494629 | +| frequency | scpufreq(current=3412.046875, min=0.0, max=0.0) | +| mem.active | 7.3 GiB | +| mem.available | 22.5 GiB | +| mem.free | 17.7 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 25.9 % | +| mem.total | 30.4 GiB | +| mem.used | 7.4 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-80-245.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_145000000_10 | ok | 408.51 | 408.51 | 2023-08-17 19:54:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_145000000_10 | ok | 33.83 | 33.83 | 2023-08-17 19:55:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_145000000_10 | ok | 33.802 | 33.802 | 2023-08-17 19:55:52 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_145000000_10 | ok | 34.12 | 34.12 | 2023-08-17 19:56:26 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_145000000_10 | ok | 33.824 | 33.824 | 2023-08-17 19:57:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_145000000_10 | ok | 33.869 | 33.869 | 2023-08-17 19:57:34 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_145000000_10 | ok | 33.84 | 33.84 | 2023-08-17 19:58:07 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_145000000_10 | ok | 33.806 | 33.806 | 2023-08-17 19:58:41 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_145000000_10 | ok | 33.812 | 33.812 | 2023-08-17 19:59:15 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_145000000_10 | ok | 33.872 | 33.872 | 2023-08-17 19:59:49 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_145000000_10 | ok | 34.1 | 34.1 | 2023-08-17 20:00:23 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_145000000_10,ok,408.51,408.51,2023-08-17 19:54:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_145000000_10,ok,33.83,33.83,2023-08-17 19:55:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_145000000_10,ok,33.802,33.802,2023-08-17 19:55:52,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_145000000_10,ok,34.12,34.12,2023-08-17 19:56:26,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_145000000_10,ok,33.824,33.824,2023-08-17 19:57:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_145000000_10,ok,33.869,33.869,2023-08-17 19:57:34,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_145000000_10,ok,33.84,33.84,2023-08-17 19:58:07,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_145000000_10,ok,33.806,33.806,2023-08-17 19:58:41,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_145000000_10,ok,33.812,33.812,2023-08-17 19:59:15,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_145000000_10,ok,33.872,33.872,2023-08-17 19:59:49,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_145000000_10,ok,34.1,34.1,2023-08-17 20:00:23,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt new file mode 100644 index 000000000..80ebe27db --- /dev/null +++ b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-17 20:13:37.510078 | +| frequency | scpufreq(current=3408.3013124999998, min=0.0, max=0.0) | +| mem.active | 3.9 GiB | +| mem.available | 25.9 GiB | +| mem.free | 21.1 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 14.7 % | +| mem.total | 30.4 GiB | +| mem.used | 4.0 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-81-123.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_145000000_10 | ok | 226.103 | 226.103 | 2023-08-17 20:09:51 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_145000000_10 | ok | 16.183 | 16.183 | 2023-08-17 20:10:55 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_145000000_10 | ok | 16.174 | 16.174 | 2023-08-17 20:11:11 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_145000000_10 | ok | 16.17 | 16.17 | 2023-08-17 20:11:28 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_145000000_10 | ok | 16.14 | 16.14 | 2023-08-17 20:11:44 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_145000000_10 | ok | 16.133 | 16.133 | 2023-08-17 20:12:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_145000000_10 | ok | 16.126 | 16.126 | 2023-08-17 20:12:16 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_145000000_10 | ok | 16.107 | 16.107 | 2023-08-17 20:12:32 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_145000000_10 | ok | 16.143 | 16.143 | 2023-08-17 20:12:48 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_145000000_10 | ok | 16.114 | 16.114 | 2023-08-17 20:13:04 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_145000000_10 | ok | 16.132 | 16.132 | 2023-08-17 20:13:21 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_145000000_10,ok,226.103,226.103,2023-08-17 20:09:51,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_145000000_10,ok,16.183,16.183,2023-08-17 20:10:55,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_145000000_10,ok,16.174,16.174,2023-08-17 20:11:11,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_145000000_10,ok,16.17,16.17,2023-08-17 20:11:28,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_145000000_10,ok,16.14,16.14,2023-08-17 20:11:44,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_145000000_10,ok,16.133,16.133,2023-08-17 20:12:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_145000000_10,ok,16.126,16.126,2023-08-17 20:12:16,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_145000000_10,ok,16.107,16.107,2023-08-17 20:12:32,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_145000000_10,ok,16.143,16.143,2023-08-17 20:12:48,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_145000000_10,ok,16.114,16.114,2023-08-17 20:13:04,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_145000000_10,ok,16.132,16.132,2023-08-17 20:13:21,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt new file mode 100644 index 000000000..9bfa3ace4 --- /dev/null +++ b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-17 20:18:16.286547 | +| frequency | scpufreq(current=3613.2064375, min=0.0, max=0.0) | +| mem.active | 2.2 GiB | +| mem.available | 27.8 GiB | +| mem.free | 23.0 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 9.1 % | +| mem.total | 30.6 GiB | +| mem.used | 2.3 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-83-169.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_145000000_10 | ok | 142.303 | 142.303 | 2023-08-17 20:15:53 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_145000000_10 | ok | 7.954 | 7.954 | 2023-08-17 20:16:56 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_145000000_10 | ok | 8.154 | 8.154 | 2023-08-17 20:17:03 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_145000000_10 | ok | 7.971 | 7.971 | 2023-08-17 20:17:12 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_145000000_10 | ok | 7.972 | 7.972 | 2023-08-17 20:17:20 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_145000000_10 | ok | 8.02 | 8.02 | 2023-08-17 20:17:28 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_145000000_10 | ok | 7.99 | 7.99 | 2023-08-17 20:17:36 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_145000000_10 | ok | 8 | 8 | 2023-08-17 20:17:44 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_145000000_10 | ok | 8.073 | 8.073 | 2023-08-17 20:17:52 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_145000000_10 | ok | 7.917 | 7.917 | 2023-08-17 20:18:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_145000000_10 | ok | 8.08 | 8.08 | 2023-08-17 20:18:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_145000000_10,ok,142.303,142.303,2023-08-17 20:15:53,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_145000000_10,ok,7.954,7.954,2023-08-17 20:16:56,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_145000000_10,ok,8.154,8.154,2023-08-17 20:17:03,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_145000000_10,ok,7.971,7.971,2023-08-17 20:17:12,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_145000000_10,ok,7.972,7.972,2023-08-17 20:17:20,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_145000000_10,ok,8.02,8.02,2023-08-17 20:17:28,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_145000000_10,ok,7.99,7.99,2023-08-17 20:17:36,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_145000000_10,ok,8.0,8.0,2023-08-17 20:17:44,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_145000000_10,ok,8.073,8.073,2023-08-17 20:17:52,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_145000000_10,ok,7.917,7.917,2023-08-17 20:18:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_145000000_10,ok,8.08,8.08,2023-08-17 20:18:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt new file mode 100644 index 000000000..c3063187b --- /dev/null +++ b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt @@ -0,0 +1,10 @@ +### s 16 9062500 145000000 0 4029.546871781349 161101524 +### s 16 9062500 145000000 1 3956.2147110700607 161101524 +### s 16 9062500 145000000 2 4006.7496597766876 161101524 +### s 16 9062500 145000000 3 4166.1305874586105 161101524 +### s 16 9062500 145000000 4 3935.5630427598953 161101524 +### s 16 9062500 145000000 5 3957.828611135483 161101524 +### s 16 9062500 145000000 6 3947.746455669403 161101524 +### s 16 9062500 145000000 7 3931.699424982071 161101524 +### s 16 9062500 145000000 8 4014.2249763011932 161101524 +### s 16 9062500 145000000 9 3963.857814669609 161101524 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt new file mode 100644 index 000000000..ded10b15b --- /dev/null +++ b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt @@ -0,0 +1,10 @@ +### s 1 145000000 145000000 0 56412.89281845093 161109857 +### s 1 145000000 145000000 1 56519.5152759552 161109857 +### s 1 145000000 145000000 2 56701.70569419861 161109857 +### s 1 145000000 145000000 3 56716.846227645874 161109857 +### s 1 145000000 145000000 4 56616.804361343384 161109857 +### s 1 145000000 145000000 5 56765.65957069397 161109857 +### s 1 145000000 145000000 6 56603.74593734741 161109857 +### s 1 145000000 145000000 7 56640.29383659363 161109857 +### s 1 145000000 145000000 8 56553.63416671753 161109857 +### s 1 145000000 145000000 9 56588.97686004639 161109857 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt new file mode 100644 index 000000000..0369d4a15 --- /dev/null +++ b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt @@ -0,0 +1,10 @@ +### s 2 72500000 145000000 0 33829.18119430542 161098554 +### s 2 72500000 145000000 1 33800.89461803436 161098554 +### s 2 72500000 145000000 2 34119.54045295715 161098554 +### s 2 72500000 145000000 3 33823.59731197357 161098554 +### s 2 72500000 145000000 4 33868.10278892517 161098554 +### s 2 72500000 145000000 5 33839.05518054962 161098554 +### s 2 72500000 145000000 6 33805.309772491455 161098554 +### s 2 72500000 145000000 7 33811.1287355423 161098554 +### s 2 72500000 145000000 8 33870.83053588867 161098554 +### s 2 72500000 145000000 9 34099.069356918335 161098554 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt new file mode 100644 index 000000000..9e1f02f59 --- /dev/null +++ b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt @@ -0,0 +1,10 @@ +### s 4 36250000 145000000 0 16181.42455816269 161112331 +### s 4 36250000 145000000 1 16173.18880558014 161112331 +### s 4 36250000 145000000 2 16169.183850288391 161112331 +### s 4 36250000 145000000 3 16138.943433761597 161112331 +### s 4 36250000 145000000 4 16131.615221500397 161112331 +### s 4 36250000 145000000 5 16124.849140644073 161112331 +### s 4 36250000 145000000 6 16106.135249137878 161112331 +### s 4 36250000 145000000 7 16141.386568546295 161112331 +### s 4 36250000 145000000 8 16113.233029842377 161112331 +### s 4 36250000 145000000 9 16130.472183227539 161112331 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt new file mode 100644 index 000000000..4056d6925 --- /dev/null +++ b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt @@ -0,0 +1,10 @@ +### s 8 18125000 145000000 0 7952.463746070862 161104569 +### s 8 18125000 145000000 1 8151.8765687942505 161104569 +### s 8 18125000 145000000 2 7969.114989042282 161104569 +### s 8 18125000 145000000 3 7970.205038785934 161104569 +### s 8 18125000 145000000 4 8018.117159605026 161104569 +### s 8 18125000 145000000 5 7988.0905747413635 161104569 +### s 8 18125000 145000000 6 7998.181223869324 161104569 +### s 8 18125000 145000000 7 8070.7429349422455 161104569 +### s 8 18125000 145000000 8 7915.852248668671 161104569 +### s 8 18125000 145000000 9 8078.289061784744 161104569 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt new file mode 100644 index 000000000..c38ee3162 --- /dev/null +++ b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-15 21:07:32.993134 | +| frequency | scpufreq(current=3410.8410625, min=0.0, max=0.0) | +| mem.active | 1.4 GiB | +| mem.available | 28.5 GiB | +| mem.free | 23.6 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 6.4 % | +| mem.total | 30.4 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-89-59.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------| +| join_total_aws_9100000_10 | ok | 118.549 | 118.549 | 2023-08-15 21:05:34 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_9100000_10 | ok | 3.957 | 3.957 | 2023-08-15 21:06:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_9100000_10 | ok | 3.955 | 3.955 | 2023-08-15 21:06:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_9100000_10 | ok | 3.966 | 3.966 | 2023-08-15 21:07:00 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_9100000_10 | ok | 4.084 | 4.084 | 2023-08-15 21:07:04 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_9100000_10 | ok | 4.091 | 4.091 | 2023-08-15 21:07:08 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_9100000_10 | ok | 3.971 | 3.971 | 2023-08-15 21:07:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_9100000_10 | ok | 3.99 | 3.99 | 2023-08-15 21:07:16 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_9100000_10 | ok | 4.294 | 4.294 | 2023-08-15 21:07:20 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_9100000_10 | ok | 4.027 | 4.027 | 2023-08-15 21:07:24 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_9100000_10 | ok | 3.93 | 3.93 | 2023-08-15 21:07:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_9100000_10,ok,118.549,118.549,2023-08-15 21:05:34,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_9100000_10,ok,3.957,3.957,2023-08-15 21:06:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_9100000_10,ok,3.955,3.955,2023-08-15 21:06:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_9100000_10,ok,3.966,3.966,2023-08-15 21:07:00,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_9100000_10,ok,4.084,4.084,2023-08-15 21:07:04,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_9100000_10,ok,4.091,4.091,2023-08-15 21:07:08,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_9100000_10,ok,3.971,3.971,2023-08-15 21:07:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_9100000_10,ok,3.99,3.99,2023-08-15 21:07:16,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_9100000_10,ok,4.294,4.294,2023-08-15 21:07:20,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_9100000_10,ok,4.027,4.027,2023-08-15 21:07:24,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_9100000_10,ok,3.93,3.93,2023-08-15 21:07:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt new file mode 100644 index 000000000..ccbc22c56 --- /dev/null +++ b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-15 16:57:19.199896 | +| frequency | scpufreq(current=3404.932875, min=0.0, max=0.0) | +| mem.active | 1.4 GiB | +| mem.available | 28.5 GiB | +| mem.free | 23.7 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 6.3 % | +| mem.total | 30.4 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-84-135.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_9100000_10 | ok | 32.554 | 32.554 | 2023-08-15 16:56:46 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_9100000_10 | ok | 3.21 | 3.21 | 2023-08-15 16:56:46 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_9100000_10 | ok | 3.22 | 3.22 | 2023-08-15 16:56:49 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_9100000_10 | ok | 3.221 | 3.221 | 2023-08-15 16:56:53 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_9100000_10 | ok | 3.223 | 3.223 | 2023-08-15 16:56:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_9100000_10 | ok | 3.216 | 3.216 | 2023-08-15 16:56:59 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_9100000_10 | ok | 3.22 | 3.22 | 2023-08-15 16:57:02 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_9100000_10 | ok | 3.225 | 3.225 | 2023-08-15 16:57:05 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_9100000_10 | ok | 3.245 | 3.245 | 2023-08-15 16:57:09 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_9100000_10 | ok | 3.218 | 3.218 | 2023-08-15 16:57:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_9100000_10 | ok | 3.224 | 3.224 | 2023-08-15 16:57:15 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_9100000_10,ok,32.554,32.554,2023-08-15 16:56:46,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_9100000_10,ok,3.21,3.21,2023-08-15 16:56:46,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_9100000_10,ok,3.22,3.22,2023-08-15 16:56:49,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_9100000_10,ok,3.221,3.221,2023-08-15 16:56:53,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_9100000_10,ok,3.223,3.223,2023-08-15 16:56:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_9100000_10,ok,3.216,3.216,2023-08-15 16:56:59,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_9100000_10,ok,3.22,3.22,2023-08-15 16:57:02,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_9100000_10,ok,3.225,3.225,2023-08-15 16:57:05,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_9100000_10,ok,3.245,3.245,2023-08-15 16:57:09,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_9100000_10,ok,3.218,3.218,2023-08-15 16:57:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_9100000_10,ok,3.224,3.224,2023-08-15 16:57:15,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt new file mode 100644 index 000000000..0a2f26f30 --- /dev/null +++ b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-15 20:50:34.410137 | +| frequency | scpufreq(current=3610.8821875000003, min=0.0, max=0.0) | +| mem.active | 1.3 GiB | +| mem.available | 28.7 GiB | +| mem.free | 23.9 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 6.3 % | +| mem.total | 30.6 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-92-255.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_9100000_10 | ok | 39.566 | 39.566 | 2023-08-15 20:49:54 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_9100000_10 | ok | 3.887 | 3.887 | 2023-08-15 20:49:54 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_9100000_10 | ok | 3.888 | 3.888 | 2023-08-15 20:49:58 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_9100000_10 | ok | 3.897 | 3.897 | 2023-08-15 20:50:02 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_9100000_10 | ok | 3.902 | 3.902 | 2023-08-15 20:50:06 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_9100000_10 | ok | 3.903 | 3.903 | 2023-08-15 20:50:10 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_9100000_10 | ok | 3.903 | 3.903 | 2023-08-15 20:50:14 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_9100000_10 | ok | 3.978 | 3.978 | 2023-08-15 20:50:18 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_9100000_10 | ok | 3.917 | 3.917 | 2023-08-15 20:50:22 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_9100000_10 | ok | 3.906 | 3.906 | 2023-08-15 20:50:26 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_9100000_10 | ok | 3.902 | 3.902 | 2023-08-15 20:50:30 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_9100000_10,ok,39.566,39.566,2023-08-15 20:49:54,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_9100000_10,ok,3.887,3.887,2023-08-15 20:49:54,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_9100000_10,ok,3.888,3.888,2023-08-15 20:49:58,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_9100000_10,ok,3.897,3.897,2023-08-15 20:50:02,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_9100000_10,ok,3.902,3.902,2023-08-15 20:50:06,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_9100000_10,ok,3.903,3.903,2023-08-15 20:50:10,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_9100000_10,ok,3.903,3.903,2023-08-15 20:50:14,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_9100000_10,ok,3.978,3.978,2023-08-15 20:50:18,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_9100000_10,ok,3.917,3.917,2023-08-15 20:50:22,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_9100000_10,ok,3.906,3.906,2023-08-15 20:50:26,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_9100000_10,ok,3.902,3.902,2023-08-15 20:50:30,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt new file mode 100644 index 000000000..bbd7f2bef --- /dev/null +++ b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-15 20:56:08.292875 | +| frequency | scpufreq(current=3406.7418124999995, min=0.0, max=0.0) | +| mem.active | 1.4 GiB | +| mem.available | 28.5 GiB | +| mem.free | 23.7 GiB | +| mem.inactive | 4.7 GiB | +| mem.percent | 6.3 % | +| mem.total | 30.4 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-80-213.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_9100000_10 | ok | 99.147 | 99.147 | 2023-08-15 20:54:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_9100000_10 | ok | 3.916 | 3.916 | 2023-08-15 20:55:29 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_9100000_10 | ok | 3.918 | 3.918 | 2023-08-15 20:55:33 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_9100000_10 | ok | 3.907 | 3.907 | 2023-08-15 20:55:36 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_9100000_10 | ok | 3.92 | 3.92 | 2023-08-15 20:55:40 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_9100000_10 | ok | 3.905 | 3.905 | 2023-08-15 20:55:44 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_9100000_10 | ok | 3.867 | 3.867 | 2023-08-15 20:55:48 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_9100000_10 | ok | 3.847 | 3.847 | 2023-08-15 20:55:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_9100000_10 | ok | 3.845 | 3.845 | 2023-08-15 20:55:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_9100000_10 | ok | 3.865 | 3.865 | 2023-08-15 20:56:00 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_9100000_10 | ok | 3.883 | 3.883 | 2023-08-15 20:56:04 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_9100000_10,ok,99.147,99.147,2023-08-15 20:54:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_9100000_10,ok,3.916,3.916,2023-08-15 20:55:29,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_9100000_10,ok,3.918,3.918,2023-08-15 20:55:33,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_9100000_10,ok,3.907,3.907,2023-08-15 20:55:36,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_9100000_10,ok,3.92,3.92,2023-08-15 20:55:40,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_9100000_10,ok,3.905,3.905,2023-08-15 20:55:44,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_9100000_10,ok,3.867,3.867,2023-08-15 20:55:48,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_9100000_10,ok,3.847,3.847,2023-08-15 20:55:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_9100000_10,ok,3.845,3.845,2023-08-15 20:55:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_9100000_10,ok,3.865,3.865,2023-08-15 20:56:00,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_9100000_10,ok,3.883,3.883,2023-08-15 20:56:04,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt new file mode 100644 index 000000000..c1120355f --- /dev/null +++ b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt @@ -0,0 +1,75 @@ + ++---------------------+-------------------------------------------------------------------+ +| Attribute | Value | +|---------------------+-------------------------------------------------------------------| +| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | +| DISTRIB_CODENAME | jammy | +| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | +| DISTRIB_ID | Ubuntu | +| DISTRIB_RELEASE | 22.04 | +| HOME_URL | "https://www.ubuntu.com/" | +| ID | ubuntu | +| ID_LIKE | debian | +| NAME | "Ubuntu" | +| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | +| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | +| SUPPORT_URL | "https://help.ubuntu.com/" | +| UBUNTU_CODENAME | jammy | +| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | +| VERSION_CODENAME | jammy | +| VERSION_ID | "22.04" | +| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | +| cpu_cores | 8 | +| cpu_count | 16 | +| cpu_threads | 16 | +| date | 2023-08-15 20:59:59.876528 | +| frequency | scpufreq(current=3407.778312499999, min=0.0, max=0.0) | +| mem.active | 1.4 GiB | +| mem.available | 28.5 GiB | +| mem.free | 23.6 GiB | +| mem.inactive | 4.6 GiB | +| mem.percent | 6.3 % | +| mem.total | 30.4 GiB | +| mem.used | 1.5 GiB | +| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | +| | [GCC 12.3.0] | +| python.pip | 23.2.1 | +| python.version | 3.9.17 | +| sys.platform | linux | +| uname.machine | x86_64 | +| uname.node | ip-172-31-80-213.ec2.internal | +| uname.processor | x86_64 | +| uname.release | 4.14.318-241.531.amzn2.x86_64 | +| uname.system | Linux | +| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| user | root | ++---------------------+-------------------------------------------------------------------+ + ++---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | +|---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| +| join_total_aws_9100000_10 | ok | 107.328 | 107.328 | 2023-08-15 20:58:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_0_aws_9100000_10 | ok | 3.878 | 3.878 | 2023-08-15 20:59:20 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_1_aws_9100000_10 | ok | 3.874 | 3.874 | 2023-08-15 20:59:24 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_2_aws_9100000_10 | ok | 3.862 | 3.862 | 2023-08-15 20:59:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_3_aws_9100000_10 | ok | 3.898 | 3.898 | 2023-08-15 20:59:32 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_4_aws_9100000_10 | ok | 3.884 | 3.884 | 2023-08-15 20:59:36 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_5_aws_9100000_10 | ok | 3.884 | 3.884 | 2023-08-15 20:59:40 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_6_aws_9100000_10 | ok | 3.978 | 3.978 | 2023-08-15 20:59:44 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_7_aws_9100000_10 | ok | 3.876 | 3.876 | 2023-08-15 20:59:48 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_8_aws_9100000_10 | ok | 3.858 | 3.858 | 2023-08-15 20:59:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | +| join_9_aws_9100000_10 | ok | 3.878 | 3.878 | 2023-08-15 20:59:55 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | ++---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ +# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version +# csv,join_total_aws_9100000_10,ok,107.328,107.328,2023-08-15 20:58:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_0_aws_9100000_10,ok,3.878,3.878,2023-08-15 20:59:20,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_1_aws_9100000_10,ok,3.874,3.874,2023-08-15 20:59:24,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_2_aws_9100000_10,ok,3.862,3.862,2023-08-15 20:59:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_3_aws_9100000_10,ok,3.898,3.898,2023-08-15 20:59:32,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_4_aws_9100000_10,ok,3.884,3.884,2023-08-15 20:59:36,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_5_aws_9100000_10,ok,3.884,3.884,2023-08-15 20:59:40,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_6_aws_9100000_10,ok,3.978,3.978,2023-08-15 20:59:44,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_7_aws_9100000_10,ok,3.876,3.876,2023-08-15 20:59:48,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_8_aws_9100000_10,ok,3.858,3.858,2023-08-15 20:59:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 +# csv,join_9_aws_9100000_10,ok,3.878,3.878,2023-08-15 20:59:55,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt new file mode 100644 index 000000000..55c4ae2bd --- /dev/null +++ b/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt @@ -0,0 +1,10 @@ +### w 16 9100000 145600000 0 3955.1253616809845 161774191 +### w 16 9100000 145600000 1 3952.8827369213104 161774191 +### w 16 9100000 145600000 2 3963.8237208127975 161774191 +### w 16 9100000 145600000 3 4081.855833530426 161774191 +### w 16 9100000 145600000 4 4089.3873125314713 161774191 +### w 16 9100000 145600000 5 3968.8504487276077 161774191 +### w 16 9100000 145600000 6 3987.659439444542 161774191 +### w 16 9100000 145600000 7 4291.653141379356 161774191 +### w 16 9100000 145600000 8 4025.2812802791595 161774191 +### w 16 9100000 145600000 9 3927.98613011837 161774191 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt new file mode 100644 index 000000000..baaf6cf47 --- /dev/null +++ b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt @@ -0,0 +1,10 @@ +### w 1 9100000 9100000 0 3209.0532779693604 10111764 +### w 1 9100000 9100000 1 3219.9573516845703 10111764 +### w 1 9100000 9100000 2 3220.4110622406006 10111764 +### w 1 9100000 9100000 3 3222.269296646118 10111764 +### w 1 9100000 9100000 4 3215.7342433929443 10111764 +### w 1 9100000 9100000 5 3219.4266319274902 10111764 +### w 1 9100000 9100000 6 3224.6077060699463 10111764 +### w 1 9100000 9100000 7 3244.480609893799 10111764 +### w 1 9100000 9100000 8 3217.606782913208 10111764 +### w 1 9100000 9100000 9 3223.5209941864014 10111764 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt new file mode 100644 index 000000000..476f70d4c --- /dev/null +++ b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt @@ -0,0 +1,10 @@ +### w 2 9100000 18200000 0 3885.681986808777 20222454 +### w 2 9100000 18200000 1 3887.1185779571533 20222454 +### w 2 9100000 18200000 2 3895.438075065613 20222454 +### w 2 9100000 18200000 3 3900.550603866577 20222454 +### w 2 9100000 18200000 4 3901.926279067993 20222454 +### w 2 9100000 18200000 5 3901.6456604003906 20222454 +### w 2 9100000 18200000 6 3976.7285585403442 20222454 +### w 2 9100000 18200000 7 3916.15629196167 20222454 +### w 2 9100000 18200000 8 3904.7634601593018 20222454 +### w 2 9100000 18200000 9 3901.23450756073 20222454 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt new file mode 100644 index 000000000..1b8301f1b --- /dev/null +++ b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt @@ -0,0 +1,10 @@ +### w 4 9100000 36400000 0 3914.8510694503784 40437898 +### w 4 9100000 36400000 1 3916.4035320281982 40437898 +### w 4 9100000 36400000 2 3906.2851667404175 40437898 +### w 4 9100000 36400000 3 3919.1325306892395 40437898 +### w 4 9100000 36400000 4 3903.8299918174744 40437898 +### w 4 9100000 36400000 5 3865.3509616851807 40437898 +### w 4 9100000 36400000 6 3845.4021215438843 40437898 +### w 4 9100000 36400000 7 3843.4287309646606 40437898 +### w 4 9100000 36400000 8 3863.954722881317 40437898 +### w 4 9100000 36400000 9 3882.117211818695 40437898 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt new file mode 100644 index 000000000..197c45745 --- /dev/null +++ b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt @@ -0,0 +1,10 @@ +### w 8 9100000 72800000 0 3875.7028579711914 80888085 +### w 8 9100000 72800000 1 3871.913105249405 80888085 +### w 8 9100000 72800000 2 3860.0634932518005 80888085 +### w 8 9100000 72800000 3 3897.0689177513123 80888085 +### w 8 9100000 72800000 4 3882.505089044571 80888085 +### w 8 9100000 72800000 5 3882.448524236679 80888085 +### w 8 9100000 72800000 6 3976.4296114444733 80888085 +### w 8 9100000 72800000 7 3874.1161227226257 80888085 +### w 8 9100000 72800000 8 3856.1716079711914 80888085 +### w 8 9100000 72800000 9 3875.669479370117 80888085 diff --git a/aws/scripts/runCylon.sh b/aws/scripts/runCylon.sh new file mode 100644 index 000000000..dce201c9a --- /dev/null +++ b/aws/scripts/runCylon.sh @@ -0,0 +1,16 @@ +#!/bin/bash --login + +# Enable strict mode. +set -euo pipefail +# ... Run whatever commands ... + +# Temporarily disable strict mode and activate conda: +set +euo pipefail +conda activate cylon_dev + +# Re-enable strict mode: +set -euo pipefail + +export LD_LIBRARY_PATH=/cylon/install/lib + +exec python /cylon/aws/scripts/S3_run_script.py \ No newline at end of file diff --git a/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.cpp b/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.cpp index 3fbab51d6..eb4b1f3d2 100644 --- a/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.cpp +++ b/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.cpp @@ -74,6 +74,11 @@ ucc_status_t UCCMPIOOBContext::oob_allgather_free(void *req) { (void)req; return UCC_OK; } + + Status UCCMPIOOBContext::Finalize() { + return Status::OK(); + } + #endif } // namespace net } // namespace cylon \ No newline at end of file diff --git a/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.hpp b/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.hpp index 78a96d394..2ec98f403 100644 --- a/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.hpp +++ b/cpp/src/cylon/net/ucx/mpi_ucx_ucc_oob_context.hpp @@ -61,6 +61,8 @@ class UCCMPIOOBContext : public UCCOOBContext { static ucc_status_t oob_allgather_test(void *req); static ucc_status_t oob_allgather_free(void *req); + + Status Finalize() override; }; #endif diff --git a/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.cpp b/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.cpp index 99c2dbb22..2ba75e690 100644 --- a/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.cpp +++ b/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.cpp @@ -132,6 +132,14 @@ namespace cylon { return std::make_shared(world_size, redis_addr); } + Status UCCRedisOOBContext::Finalize() { + + return Status::OK(); + + } + + + #endif } diff --git a/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.hpp b/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.hpp index e4c7d05b0..cdd7f79c9 100644 --- a/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.hpp +++ b/cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.hpp @@ -97,6 +97,8 @@ namespace cylon { int getRank(); + Status Finalize() override; + private: int world_size; int rank = -1; diff --git a/cpp/src/cylon/net/ucx/ucc_oob_context.hpp b/cpp/src/cylon/net/ucx/ucc_oob_context.hpp index 76cbf7588..0dd96e0c9 100644 --- a/cpp/src/cylon/net/ucx/ucc_oob_context.hpp +++ b/cpp/src/cylon/net/ucx/ucc_oob_context.hpp @@ -36,6 +36,8 @@ namespace cylon { virtual void InitOOB(int rank) = 0; virtual void *getCollInfo() = 0; + + virtual Status Finalize() = 0; }; #endif diff --git a/cpp/src/cylon/net/ucx/ucx_communicator.cpp b/cpp/src/cylon/net/ucx/ucx_communicator.cpp index 148e4728a..36a71bd60 100644 --- a/cpp/src/cylon/net/ucx/ucx_communicator.cpp +++ b/cpp/src/cylon/net/ucx/ucx_communicator.cpp @@ -17,7 +17,6 @@ #include #include -#include #include "cylon/net/communicator.hpp" #include "cylon/net/ucx/ucx_channel.hpp" @@ -46,17 +45,17 @@ void mpi_check_and_finalize() { CommType UCXConfig::Type() { return CommType::UCX; } -UCXConfig::UCXConfig(std::shared_ptr oobContext) - : oobContext_(std::move(oobContext)) { +UCXConfig::UCXConfig(std::shared_ptr oobContext) { + this->oobContext = oobContext; } std::shared_ptr UCXConfig::Make( std::shared_ptr oobContext) { - return std::make_shared(std::move(oobContext)); + return std::make_shared(oobContext); } std::shared_ptr UCXConfig::Make(MPI_Comm comm) { - return std::make_shared(comm); + return std::make_shared(comm); } UCXConfig::UCXConfig(MPI_Comm comm) : comm_(comm) {} @@ -64,18 +63,18 @@ UCXConfig::UCXConfig(MPI_Comm comm) : comm_(comm) {} MPI_Comm UCXConfig::GetMPIComm() const { return comm_; } void UCXConfig::setOOBContext(std::shared_ptr oobContext) { - this->oobContext_ = std::move(oobContext); + this->oobContext = oobContext; } std::shared_ptr UCXConfig::getOOBContext() { - return this->oobContext_; + return this->oobContext; } #ifdef BUILD_CYLON_UCC CommType UCCConfig::Type() { return CommType::UCC; } UCCConfig::UCCConfig(std::shared_ptr oob_context) - : oobContext_(std::move(oob_context)) {} + : oobContext(oob_context) {} std::shared_ptr UCCConfig::Make( std::shared_ptr &oob_context) { @@ -83,15 +82,23 @@ std::shared_ptr UCCConfig::Make( } void UCCConfig::setOOBContext(std::shared_ptr oobContext) { - this->oobContext_ = std::move(oobContext); + this->oobContext = oobContext; } -std::shared_ptr UCCConfig::getOOBContext() { return oobContext_; } +std::shared_ptr UCCConfig::getOOBContext() { return oobContext; } + + UCCConfig::~UCCConfig() { + auto context = this->oobContext.get(); + if (context != nullptr) { + context->Finalize(); + } + } + #endif std::unique_ptr UCXCommunicator::CreateChannel() const { - return std::make_unique(this); + return std::make_unique(this); } int UCXCommunicator::GetRank() const { return this->rank; } int UCXCommunicator::GetWorldSize() const { return this->world_size; } @@ -135,8 +142,8 @@ UCXCommunicator::UCXCommunicator(MemoryPool *pool) : Communicator(pool, -1, -1) {} UCXCommunicator::UCXCommunicator(MemoryPool *pool, bool externally_init, MPI_Comm comm) - : Communicator(pool, -1, -1), - externally_init(externally_init), mpi_comm(comm) {} + : Communicator(pool, -1, -1), + externally_init(externally_init), mpi_comm(comm) {} Status UCXCommunicator::AllReduce(const std::shared_ptr &values, net::ReduceOp reduce_op, @@ -164,189 +171,191 @@ Status UCXCommunicator::Allgather(const std::shared_ptr &value, Status UCXCommunicator::MakeOOB(const std::shared_ptr &config, MemoryPool *pool, std::shared_ptr *out) { - const auto &ucc_config = std::static_pointer_cast(config); - auto oob_context = ucc_config->getOOBContext(); - - *out = std::make_shared(pool); - auto &comm = dynamic_cast(**out); - comm.oobContext = oob_context; - - // Int variable used when iterating - int sIndx; - // Address of the UCP Worker for receiving - cylon::ucx::ucxWorkerAddr *ucpRecvWorkerAddr; - // Address of the UCP Worker for sending - cylon::ucx::ucxWorkerAddr *ucpSendWorkerAddr; - - // Status check when creating end-points - ucs_status_t ucxStatus; - // Variable to hold the current ucp address - ucp_address_t *address; - - RETURN_CYLON_STATUS_IF_FAILED(oob_context->InitOOB()); - - // Get the rank for checking send to self, and initializations - RETURN_CYLON_STATUS_IF_FAILED( - oob_context->getWorldSizeAndRank(comm.world_size, comm.rank)); - - int rank = comm.rank, world_size = comm.world_size; - - // Init context - RETURN_CYLON_STATUS_IF_FAILED( - cylon::ucx::initContext(&comm.ucpContext, nullptr)); - - // Init recv worker and get address - ucpRecvWorkerAddr = - cylon::ucx::initWorker(comm.ucpContext, &comm.ucpRecvWorker); - // Init send worker - ucpSendWorkerAddr = - cylon::ucx::initWorker(comm.ucpContext, &comm.ucpSendWorker); - - // Gather all worker addresses - // All addresses buffer for allGather - auto allAddresses = - std::make_unique(ucpRecvWorkerAddr->addrSize * world_size); - - RETURN_CYLON_STATUS_IF_FAILED(oob_context->OOBAllgather( - (uint8_t *) ucpRecvWorkerAddr->addr, allAddresses.get(), - (int) ucpRecvWorkerAddr->addrSize, (int) ucpRecvWorkerAddr->addrSize)); - - // Iterate and set the sends - comm.endPointMap.reserve(world_size); - for (sIndx = 0; sIndx < world_size; sIndx++) { - ucp_ep_params_t epParams; - ucp_ep_h ep; - - // If not self, then check if the worker address has been received. - // If self,then assign local worker - if (rank != sIndx) { - address = reinterpret_cast( - allAddresses.get() + sIndx * ucpRecvWorkerAddr->addrSize); - } else { - address = ucpRecvWorkerAddr->addr; + const auto &ucc_config = std::static_pointer_cast(config); + auto oob_context = ucc_config->getOOBContext(); + + *out = std::make_shared(pool); + auto &comm = static_cast(**out); + comm.oobContext = oob_context; + + // Int variable used when iterating + int sIndx; + // Address of the UCP Worker for receiving + cylon::ucx::ucxWorkerAddr *ucpRecvWorkerAddr; + // Address of the UCP Worker for sending + cylon::ucx::ucxWorkerAddr *ucpSendWorkerAddr; + + // Status check when creating end-points + ucs_status_t ucxStatus; + // Variable to hold the current ucp address + ucp_address_t *address; + + RETURN_CYLON_STATUS_IF_FAILED(oob_context->InitOOB()); + + // Get the rank for checking send to self, and initializations + RETURN_CYLON_STATUS_IF_FAILED( + oob_context->getWorldSizeAndRank(comm.world_size, comm.rank)); + + int rank = comm.rank, world_size = comm.world_size; + + // Init context + RETURN_CYLON_STATUS_IF_FAILED( + cylon::ucx::initContext(&comm.ucpContext, nullptr)); + + // Init recv worker and get address + ucpRecvWorkerAddr = + cylon::ucx::initWorker(comm.ucpContext, &comm.ucpRecvWorker); + // Init send worker + ucpSendWorkerAddr = + cylon::ucx::initWorker(comm.ucpContext, &comm.ucpSendWorker); + + // Gather all worker addresses + // All addresses buffer for allGather + auto allAddresses = + std::make_unique(ucpRecvWorkerAddr->addrSize * world_size); + + RETURN_CYLON_STATUS_IF_FAILED(oob_context->OOBAllgather( + (uint8_t *)ucpRecvWorkerAddr->addr, allAddresses.get(), + (int)ucpRecvWorkerAddr->addrSize, (int)ucpRecvWorkerAddr->addrSize)); + + // Iterate and set the sends + comm.endPointMap.reserve(world_size); + for (sIndx = 0; sIndx < world_size; sIndx++) { + ucp_ep_params_t epParams; + ucp_ep_h ep; + + // If not self, then check if the worker address has been received. + // If self,then assign local worker + if (rank != sIndx) { + address = reinterpret_cast( + allAddresses.get() + sIndx * ucpRecvWorkerAddr->addrSize); + } else { + address = ucpRecvWorkerAddr->addr; + } + + // Set params for the endpoint + epParams.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS | + UCP_EP_PARAM_FIELD_ERR_HANDLING_MODE; + epParams.address = address; + epParams.err_mode = UCP_ERR_HANDLING_MODE_NONE; + + // Create an endpoint + ucxStatus = ucp_ep_create(comm.ucpSendWorker, &epParams, &ep); + + comm.endPointMap[sIndx] = ep; + // Check if the endpoint was created properly + if (ucxStatus != UCS_OK) { + LOG(FATAL) << "Error when creating the endpoint."; + return {Code::ExecutionError, + "Error when creating the endpoint: " + + std::string(ucs_status_string(ucxStatus))}; + } } - // Set params for the endpoint - epParams.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS | - UCP_EP_PARAM_FIELD_ERR_HANDLING_MODE; - epParams.address = address; - epParams.err_mode = UCP_ERR_HANDLING_MODE_NONE; - - // Create an endpoint - ucxStatus = ucp_ep_create(comm.ucpSendWorker, &epParams, &ep); - - comm.endPointMap[sIndx] = ep; - // Check if the endpoint was created properly - if (ucxStatus != UCS_OK) { - LOG(FATAL) << "Error when creating the endpoint."; - return {Code::ExecutionError, - "Error when creating the endpoint: " + - std::string(ucs_status_string(ucxStatus))}; - } - } - - // Cleanup - delete (ucpRecvWorkerAddr); - delete (ucpSendWorkerAddr); + // Cleanup + delete (ucpRecvWorkerAddr); + delete (ucpSendWorkerAddr); - return Status::OK(); + return Status::OK(); } + + Status UCXCommunicator::Make(const std::shared_ptr &config, MemoryPool *pool, std::shared_ptr *out) { - const auto &mpi_config = std::static_pointer_cast(config); - auto mpi_comm = mpi_config->GetMPIComm(); - - // MPI init - int initialized; - MPI_Initialized(&initialized); - if (!initialized) { - RETURN_CYLON_STATUS_IF_MPI_FAILED(MPI_Init(nullptr, nullptr)); - } - - if (mpi_comm == MPI_COMM_NULL) { - mpi_comm = MPI_COMM_WORLD; - } + const auto &mpi_config = std::static_pointer_cast(config); + auto mpi_comm = mpi_config->GetMPIComm(); + + // MPI init + int initialized; + MPI_Initialized(&initialized); + if (!initialized) { + RETURN_CYLON_STATUS_IF_MPI_FAILED(MPI_Init(nullptr, nullptr)); + } - *out = std::make_shared(pool, initialized, mpi_comm); - auto &comm = dynamic_cast(**out); - - // Int variable used when iterating - int sIndx; - // Address of the UCP Worker for receiving - cylon::ucx::ucxWorkerAddr *ucpRecvWorkerAddr; - // Address of the UCP Worker for sending - cylon::ucx::ucxWorkerAddr *ucpSendWorkerAddr; - - // Status check when creating end-points - ucs_status_t ucxStatus; - // Variable to hold the current ucp address - ucp_address_t *address; - - // Get the rank for checking send to self, and initializations - MPI_Comm_rank(mpi_comm, &comm.rank); - MPI_Comm_size(mpi_comm, &comm.world_size); - - int rank = comm.rank, world_size = comm.world_size; - - // Init context - RETURN_CYLON_STATUS_IF_FAILED(cylon::ucx::initContext(&comm.ucpContext, nullptr)); - - // Init recv worker and get address - ucpRecvWorkerAddr = cylon::ucx::initWorker(comm.ucpContext, &comm.ucpRecvWorker); - // Init send worker - ucpSendWorkerAddr = cylon::ucx::initWorker(comm.ucpContext, &comm.ucpSendWorker); - - // Gather all worker addresses - // All addresses buffer for allGather - auto allAddresses = std::make_unique(ucpRecvWorkerAddr->addrSize * world_size); - RETURN_CYLON_STATUS_IF_MPI_FAILED(MPI_Allgather(ucpRecvWorkerAddr->addr, - (int) ucpRecvWorkerAddr->addrSize, - MPI_BYTE, - allAddresses.get(), - (int) ucpRecvWorkerAddr->addrSize, - MPI_BYTE, - mpi_comm)); - - // Iterate and set the sends - comm.endPointMap.reserve(world_size); - for (sIndx = 0; sIndx < world_size; sIndx++) { - ucp_ep_params_t epParams; - ucp_ep_h ep; - - // If not self, then check if the worker address has been received. - // If self,then assign local worker - if (rank != sIndx) { - address = reinterpret_cast(allAddresses.get() - + sIndx * ucpRecvWorkerAddr->addrSize); - } else { - address = ucpRecvWorkerAddr->addr; + if (mpi_comm == MPI_COMM_NULL) { + mpi_comm = MPI_COMM_WORLD; } - // Set params for the endpoint - epParams.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS | - UCP_EP_PARAM_FIELD_ERR_HANDLING_MODE; - epParams.address = address; - epParams.err_mode = UCP_ERR_HANDLING_MODE_NONE; - - // Create an endpoint - ucxStatus = ucp_ep_create(comm.ucpSendWorker, &epParams, &ep); - - comm.endPointMap[sIndx] = ep; - // Check if the endpoint was created properly - if (ucxStatus != UCS_OK) { - LOG(FATAL) << "Error when creating the endpoint."; - return {Code::ExecutionError, - "Error when creating the endpoint: " + std::string(ucs_status_string(ucxStatus))}; + *out = std::make_shared(pool, initialized, mpi_comm); + auto &comm = dynamic_cast(**out); + + // Int variable used when iterating + int sIndx; + // Address of the UCP Worker for receiving + cylon::ucx::ucxWorkerAddr *ucpRecvWorkerAddr; + // Address of the UCP Worker for sending + cylon::ucx::ucxWorkerAddr *ucpSendWorkerAddr; + + // Status check when creating end-points + ucs_status_t ucxStatus; + // Variable to hold the current ucp address + ucp_address_t *address; + + // Get the rank for checking send to self, and initializations + MPI_Comm_rank(mpi_comm, &comm.rank); + MPI_Comm_size(mpi_comm, &comm.world_size); + + int rank = comm.rank, world_size = comm.world_size; + + // Init context + RETURN_CYLON_STATUS_IF_FAILED(cylon::ucx::initContext(&comm.ucpContext, nullptr)); + + // Init recv worker and get address + ucpRecvWorkerAddr = cylon::ucx::initWorker(comm.ucpContext, &comm.ucpRecvWorker); + // Init send worker + ucpSendWorkerAddr = cylon::ucx::initWorker(comm.ucpContext, &comm.ucpSendWorker); + + // Gather all worker addresses + // All addresses buffer for allGather + auto allAddresses = std::make_unique(ucpRecvWorkerAddr->addrSize * world_size); + RETURN_CYLON_STATUS_IF_MPI_FAILED(MPI_Allgather(ucpRecvWorkerAddr->addr, + (int) ucpRecvWorkerAddr->addrSize, + MPI_BYTE, + allAddresses.get(), + (int) ucpRecvWorkerAddr->addrSize, + MPI_BYTE, + mpi_comm)); + + // Iterate and set the sends + comm.endPointMap.reserve(world_size); + for (sIndx = 0; sIndx < world_size; sIndx++) { + ucp_ep_params_t epParams; + ucp_ep_h ep; + + // If not self, then check if the worker address has been received. + // If self,then assign local worker + if (rank != sIndx) { + address = reinterpret_cast(allAddresses.get() + + sIndx * ucpRecvWorkerAddr->addrSize); + } else { + address = ucpRecvWorkerAddr->addr; + } + + // Set params for the endpoint + epParams.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS | + UCP_EP_PARAM_FIELD_ERR_HANDLING_MODE; + epParams.address = address; + epParams.err_mode = UCP_ERR_HANDLING_MODE_NONE; + + // Create an endpoint + ucxStatus = ucp_ep_create(comm.ucpSendWorker, &epParams, &ep); + + comm.endPointMap[sIndx] = ep; + // Check if the endpoint was created properly + if (ucxStatus != UCS_OK) { + LOG(FATAL) << "Error when creating the endpoint."; + return {Code::ExecutionError, + "Error when creating the endpoint: " + std::string(ucs_status_string(ucxStatus))}; + } } - } - // Cleanup - delete (ucpRecvWorkerAddr); - delete (ucpSendWorkerAddr); + // Cleanup + delete (ucpRecvWorkerAddr); + delete (ucpSendWorkerAddr); - return Status::OK(); + return Status::OK(); } void UCXCommunicator::Finalize() { @@ -365,6 +374,8 @@ CommType UCXCommunicator::GetCommType() const { return UCX; } + + #ifdef BUILD_CYLON_UCC static ucc_status_t oob_allgather(void *sbuf, void *rbuf, size_t msglen, @@ -391,109 +402,119 @@ static ucc_status_t oob_allgather_free(void *req) { return UCC_OK; } -UCXUCCCommunicator::UCXUCCCommunicator(const std::shared_ptr &ucx_comm) - : Communicator(ucx_comm->GetMemoryPool(), ucx_comm->GetRank(), ucx_comm->GetWorldSize()), - ucx_comm_(std::static_pointer_cast(ucx_comm)) {} + UCXUCCCommunicator::UCXUCCCommunicator(const std::shared_ptr &ucx_comm) + : Communicator(ucx_comm->GetMemoryPool(), ucx_comm->GetRank(), ucx_comm->GetWorldSize()), + ucx_comm_(std::static_pointer_cast(ucx_comm)) {} + + + + UCXUCCCommunicator::UCXUCCCommunicator( std::shared_ptr ucx_comm, - std::shared_ptr oobContext) + std::shared_ptr &oob_context) : Communicator(ucx_comm->GetMemoryPool(), ucx_comm->GetRank(), ucx_comm->GetWorldSize()), ucx_comm_(std::static_pointer_cast(ucx_comm)), - oobContext(std::move(oobContext)) {} + oobContext(oob_context) {} Status UCXUCCCommunicator::MakeOOB(std::shared_ptr &ucc_oob_ctx, MemoryPool *pool, std::shared_ptr *out) { - std::shared_ptr ucx_comm; - auto ucx_config = - std::make_shared(ucc_oob_ctx->makeUCXOOBContext()); + std::shared_ptr ucx_comm; + auto ucx_config = + std::make_shared(ucc_oob_ctx->makeUCXOOBContext()); - UCXCommunicator::MakeOOB(ucx_config, pool, &ucx_comm); + UCXCommunicator::MakeOOB(ucx_config, pool, &ucx_comm); - *out = std::make_shared(std::move(ucx_comm), ucc_oob_ctx); + *out = std::make_shared(std::move(ucx_comm), ucc_oob_ctx); - auto &comm = *std::static_pointer_cast(*out); - comm.oobContext = ucc_oob_ctx; - comm.oobContext->InitOOB(comm.GetRank()); + auto &comm = *std::static_pointer_cast(*out); + comm.oobContext = ucc_oob_ctx; + comm.oobContext->InitOOB(comm.GetRank()); - // initialize UCC team and context - ucc_context_params_t ctx_params; - ucc_team_params_t team_params; - ucc_context_config_h ctx_config; - ucc_status_t status; - ucc_lib_h lib; - ucc_lib_config_h lib_config; + // initialize UCC team and context + ucc_context_params_t ctx_params; + ucc_team_params_t team_params; + ucc_context_config_h ctx_config; + ucc_status_t status; + ucc_lib_h lib; + ucc_lib_config_h lib_config; - // init ucc lib - ucc_lib_params_t lib_params = {.mask = UCC_LIB_PARAM_FIELD_THREAD_MODE, - .thread_mode = UCC_THREAD_SINGLE, - .coll_types = {}, - .reduction_types = {}, - .sync_type = {}}; + // init ucc lib + ucc_lib_params_t lib_params = {.mask = UCC_LIB_PARAM_FIELD_THREAD_MODE, + .thread_mode = UCC_THREAD_SINGLE, + .coll_types = {}, + .reduction_types = {}, + .sync_type = {}}; - RETURN_CYLON_STATUS_IF_UCC_FAILED( - ucc_lib_config_read(nullptr, nullptr, &lib_config)); - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_init(&lib_params, lib_config, &lib)); - ucc_lib_config_release(lib_config); + RETURN_CYLON_STATUS_IF_UCC_FAILED( + ucc_lib_config_read(nullptr, nullptr, &lib_config)); + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_init(&lib_params, lib_config, &lib)); + ucc_lib_config_release(lib_config); - // init ucc context - ctx_params.mask = UCC_CONTEXT_PARAM_FIELD_OOB; + // init ucc context + ctx_params.mask = UCC_CONTEXT_PARAM_FIELD_OOB; - if (ucc_oob_ctx->Type() == OOBType::OOB_REDIS) { + if (ucc_oob_ctx->Type() == OOBType::OOB_REDIS) { #ifdef BUILD_CYLON_REDIS - ctx_params.oob.allgather = team_params.oob.allgather = - UCCRedisOOBContext::oob_allgather; -ctx_params.oob.req_test = team_params.oob.req_test = - UCCRedisOOBContext::oob_allgather_test; -ctx_params.oob.req_free = team_params.oob.req_free = - UCCRedisOOBContext::oob_allgather_free; -#else - return {Code::NotImplemented, - "UCC OOB Type set as Redis, but Cylon is not built with Redis"}; -#endif - } else if (ucc_oob_ctx->Type() == OOBType::OOB_MPI) { - ctx_params.oob.allgather = team_params.oob.allgather = - UCCMPIOOBContext::oob_allgather; + ctx_params.oob.allgather = team_params.oob.allgather = + UCCRedisOOBContext::oob_allgather; ctx_params.oob.req_test = team_params.oob.req_test = - UCCMPIOOBContext::oob_allgather_test; + UCCRedisOOBContext::oob_allgather_test; ctx_params.oob.req_free = team_params.oob.req_free = - UCCMPIOOBContext::oob_allgather_free; - } else { - return {Code::NotImplemented, "UCC OOB communication type not supported."}; - } + UCCRedisOOBContext::oob_allgather_free; +#else + ctx_params.oob.allgather = team_params.oob.allgather = + UCCMPIOOBContext::oob_allgather; + ctx_params.oob.req_test = team_params.oob.req_test = + UCCMPIOOBContext::oob_allgather_test; + ctx_params.oob.req_free = team_params.oob.req_free = + UCCMPIOOBContext::oob_allgather_free; +#endif + } else if (ucc_oob_ctx->Type() == OOBType::OOB_MPI) { + ctx_params.oob.allgather = team_params.oob.allgather = + UCCMPIOOBContext::oob_allgather; + ctx_params.oob.req_test = team_params.oob.req_test = + UCCMPIOOBContext::oob_allgather_test; + ctx_params.oob.req_free = team_params.oob.req_free = + UCCMPIOOBContext::oob_allgather_free; + } else { + return {Code::NotImplemented, "UCC OOB communication type not supported."}; + } - ctx_params.oob.coll_info = ucc_oob_ctx->getCollInfo(); + ctx_params.oob.coll_info = ucc_oob_ctx->getCollInfo(); - ctx_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); - ctx_params.oob.oob_ep = static_cast(comm.GetRank()); + ctx_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); + ctx_params.oob.oob_ep = static_cast(comm.GetRank()); - RETURN_CYLON_STATUS_IF_UCC_FAILED( - ucc_context_config_read(lib, nullptr, &ctx_config)); + RETURN_CYLON_STATUS_IF_UCC_FAILED( + ucc_context_config_read(lib, nullptr, &ctx_config)); - RETURN_CYLON_STATUS_IF_UCC_FAILED( - ucc_context_create(lib, &ctx_params, ctx_config, &comm.uccContext)); + RETURN_CYLON_STATUS_IF_UCC_FAILED( + ucc_context_create(lib, &ctx_params, ctx_config, &comm.uccContext)); - ucc_context_config_release(ctx_config); + ucc_context_config_release(ctx_config); - // init ucc team - team_params.mask = UCC_TEAM_PARAM_FIELD_OOB; + // init ucc team + team_params.mask = UCC_TEAM_PARAM_FIELD_OOB; - team_params.oob.coll_info = ucc_oob_ctx->getCollInfo(); + team_params.oob.coll_info = ucc_oob_ctx->getCollInfo(); - team_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); - team_params.oob.oob_ep = static_cast(comm.GetRank()); - RETURN_CYLON_STATUS_IF_UCC_FAILED( - ucc_team_create_post(&comm.uccContext, 1, &team_params, &comm.uccTeam)); + team_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); + team_params.oob.oob_ep = static_cast(comm.GetRank()); + RETURN_CYLON_STATUS_IF_UCC_FAILED( + ucc_team_create_post(&comm.uccContext, 1, &team_params, &comm.uccTeam)); - while (UCC_INPROGRESS == (status = ucc_team_create_test(comm.uccTeam))) { - // RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_progress(comm.uccContext)); - } + while (UCC_INPROGRESS == (status = ucc_team_create_test(comm.uccTeam))) { + // RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_progress(comm.uccContext)); + } + + RETURN_CYLON_STATUS_IF_UCC_FAILED(status); + return Status::OK(); - RETURN_CYLON_STATUS_IF_UCC_FAILED(status); - return Status::OK(); } + Status UCXUCCCommunicator::Make(const std::shared_ptr &config, MemoryPool *pool, std::shared_ptr *out) { @@ -501,67 +522,67 @@ Status UCXUCCCommunicator::Make(const std::shared_ptr &config, auto ucc_oob_ctx = ucc_config->getOOBContext(); if (ucc_oob_ctx != nullptr) { //call MPI Com - return UCXUCCCommunicator::MakeOOB(ucc_oob_ctx, pool, out); + return UCXUCCCommunicator::MakeOOB(ucc_oob_ctx, pool, out); } - std::shared_ptr ucx_comm; - RETURN_CYLON_STATUS_IF_FAILED(UCXCommunicator::Make(config, pool, &ucx_comm)); - - *out = std::make_shared(std::move(ucx_comm)); - auto &comm = *std::static_pointer_cast(*out); - - auto mpi_comm = comm.ucx_comm_->mpi_comm; - - // initialize UCC team and context - ucc_context_params_t ctx_params; - ucc_team_params_t team_params; - ucc_context_config_h ctx_config; - ucc_status_t status; - ucc_lib_h lib; - ucc_lib_config_h lib_config; - - // init ucc lib - ucc_lib_params_t lib_params = {.mask = UCC_LIB_PARAM_FIELD_THREAD_MODE, - .thread_mode = UCC_THREAD_SINGLE, - .coll_types = {}, - .reduction_types = {}, - .sync_type = {}}; - - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_lib_config_read(nullptr, nullptr, &lib_config)); - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_init(&lib_params, lib_config, &lib)); - ucc_lib_config_release(lib_config); - - // init ucc context - ctx_params.mask = UCC_CONTEXT_PARAM_FIELD_OOB; - ctx_params.oob.allgather = oob_allgather; - ctx_params.oob.req_test = oob_allgather_test; - ctx_params.oob.req_free = oob_allgather_free; - ctx_params.oob.coll_info = (void *) mpi_comm; - ctx_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); - ctx_params.oob.oob_ep = static_cast(comm.GetRank()); - - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_config_read(lib, nullptr, &ctx_config)); - - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_create(lib, &ctx_params, ctx_config, - &comm.uccContext)); - ucc_context_config_release(ctx_config); - - // init ucc team - team_params.mask = UCC_TEAM_PARAM_FIELD_OOB; - team_params.oob.allgather = oob_allgather; - team_params.oob.req_test = oob_allgather_test; - team_params.oob.req_free = oob_allgather_free; - team_params.oob.coll_info = (void *) mpi_comm; - team_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); - team_params.oob.oob_ep = static_cast(comm.GetRank()); - RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_team_create_post(&comm.uccContext, 1, &team_params, - &comm.uccTeam)); - while (UCC_INPROGRESS == (status = ucc_team_create_test(comm.uccTeam))) { + std::shared_ptr ucx_comm; + RETURN_CYLON_STATUS_IF_FAILED(UCXCommunicator::Make(config, pool, &ucx_comm)); + + *out = std::make_shared(std::move(ucx_comm)); + auto &comm = *std::static_pointer_cast(*out); + + auto mpi_comm = comm.ucx_comm_->mpi_comm; + + // initialize UCC team and context + ucc_context_params_t ctx_params; + ucc_team_params_t team_params; + ucc_context_config_h ctx_config; + ucc_status_t status; + ucc_lib_h lib; + ucc_lib_config_h lib_config; + + // init ucc lib + ucc_lib_params_t lib_params = {.mask = UCC_LIB_PARAM_FIELD_THREAD_MODE, + .thread_mode = UCC_THREAD_SINGLE, + .coll_types = {}, + .reduction_types = {}, + .sync_type = {}}; + + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_lib_config_read(nullptr, nullptr, &lib_config)); + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_init(&lib_params, lib_config, &lib)); + ucc_lib_config_release(lib_config); + + // init ucc context + ctx_params.mask = UCC_CONTEXT_PARAM_FIELD_OOB; + ctx_params.oob.allgather = oob_allgather; + ctx_params.oob.req_test = oob_allgather_test; + ctx_params.oob.req_free = oob_allgather_free; + ctx_params.oob.coll_info = (void *) mpi_comm; + ctx_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); + ctx_params.oob.oob_ep = static_cast(comm.GetRank()); + + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_config_read(lib, nullptr, &ctx_config)); + + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_create(lib, &ctx_params, ctx_config, + &comm.uccContext)); + ucc_context_config_release(ctx_config); + + // init ucc team + team_params.mask = UCC_TEAM_PARAM_FIELD_OOB; + team_params.oob.allgather = oob_allgather; + team_params.oob.req_test = oob_allgather_test; + team_params.oob.req_free = oob_allgather_free; + team_params.oob.coll_info = (void *) mpi_comm; + team_params.oob.n_oob_eps = static_cast(comm.GetWorldSize()); + team_params.oob.oob_ep = static_cast(comm.GetRank()); + RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_team_create_post(&comm.uccContext, 1, &team_params, + &comm.uccTeam)); + while (UCC_INPROGRESS == (status = ucc_team_create_test(comm.uccTeam))) { // RETURN_CYLON_STATUS_IF_UCC_FAILED(ucc_context_progress(comm.uccContext)); - } + } - RETURN_CYLON_STATUS_IF_UCC_FAILED(status); - return Status::OK(); + RETURN_CYLON_STATUS_IF_UCC_FAILED(status); + return Status::OK(); } CommType UCXUCCCommunicator::GetCommType() const { return UCX; } @@ -572,19 +593,29 @@ std::unique_ptr UCXUCCCommunicator::CreateChannel() const { void UCXUCCCommunicator::Finalize() { if (!this->IsFinalized()) { + + auto uccoobCtx = oobContext.get(); + + if (uccoobCtx != nullptr) { + uccoobCtx->Finalize(); + } + ucc_status_t status; while (uccTeam && - (UCC_INPROGRESS == (status = ucc_team_destroy(uccTeam)))) { + (UCC_INPROGRESS == (status = ucc_team_destroy(uccTeam)))) { if (UCC_OK != status) { LOG(ERROR) << "ucc_team_destroy failed"; break; } } - if (!ucx_comm_->externally_init) { + if (!ucx_comm_->externally_init){ ucc_context_destroy(uccContext); } + + + ucx_comm_->Finalize(); // this will handle MPI_Finalize finalized = true; } diff --git a/cpp/src/cylon/net/ucx/ucx_communicator.hpp b/cpp/src/cylon/net/ucx/ucx_communicator.hpp index c6c5cb3e3..b3e9e234f 100644 --- a/cpp/src/cylon/net/ucx/ucx_communicator.hpp +++ b/cpp/src/cylon/net/ucx/ucx_communicator.hpp @@ -20,8 +20,10 @@ #include #include + #include "cylon/util/macros.hpp" + #ifdef BUILD_CYLON_UCC #include #endif @@ -29,8 +31,10 @@ namespace cylon { namespace net { class UCXConfig : public CommConfig { + + public: - CommType Type() override; + CommType Type() override; explicit UCXConfig(std::shared_ptr oobContext); explicit UCXConfig(MPI_Comm comm = MPI_COMM_NULL); @@ -44,34 +48,43 @@ class UCXConfig : public CommConfig { MPI_Comm GetMPIComm() const; private: - std::shared_ptr oobContext_ = nullptr; - MPI_Comm comm_ = MPI_COMM_NULL; + std::shared_ptr oobContext = nullptr; + MPI_Comm comm_; }; #ifdef BUILD_CYLON_UCC class UCCConfig : public CommConfig { + public: - CommType Type() override; - explicit UCCConfig(std::shared_ptr oobContext); + CommType Type() override; + + ~UCCConfig() override; + + explicit UCCConfig(std::shared_ptr oobContext); static std::shared_ptr Make( std::shared_ptr &oobContext); void setOOBContext(std::shared_ptr oobContext); std::shared_ptr getOOBContext(); private: - std::shared_ptr oobContext_; + std::shared_ptr oobContext; }; #endif class UCXCommunicator : public Communicator { public: - explicit UCXCommunicator(MemoryPool *pool); - UCXCommunicator(MemoryPool *pool, bool externally_init, MPI_Comm comm); + explicit UCXCommunicator(MemoryPool *pool); + UCXCommunicator(MemoryPool *pool, bool externally_init, MPI_Comm comm); - ~UCXCommunicator() override = default; - std::unique_ptr CreateChannel() const override; + + + ~UCXCommunicator() override = default; + + + + std::unique_ptr CreateChannel() const override; int GetRank() const override; int GetWorldSize() const override; void Finalize() override; @@ -99,8 +112,8 @@ class UCXCommunicator : public Communicator { static Status Make(const std::shared_ptr &config, MemoryPool *pool, std::shared_ptr *out); - static Status MakeOOB(const std::shared_ptr &config, - MemoryPool *pool, std::shared_ptr *out); + static Status MakeOOB(const std::shared_ptr &config, + MemoryPool *pool, std::shared_ptr *out); // # UCX specific attributes - These need to be passed to the channels created // from the communicator The worker for receiving @@ -114,8 +127,8 @@ class UCXCommunicator : public Communicator { std::shared_ptr oobContext = nullptr; - bool externally_init = false; - MPI_Comm mpi_comm; + bool externally_init = false; + MPI_Comm mpi_comm; }; @@ -123,13 +136,18 @@ class UCXCommunicator : public Communicator { class UCXUCCCommunicator : public Communicator { public: explicit UCXUCCCommunicator(std::shared_ptr ucx_comm, - std::shared_ptr oobContext); + std::shared_ptr &oobContext); + + explicit UCXUCCCommunicator(const std::shared_ptr& ucx_comm); + - explicit UCXUCCCommunicator(const std::shared_ptr &ucx_comm); static Status Make(const std::shared_ptr &config, MemoryPool *pool, std::shared_ptr *out); + + + CommType GetCommType() const override; std::unique_ptr CreateChannel() const override; void Finalize() override; @@ -157,9 +175,9 @@ class UCXUCCCommunicator : public Communicator { std::shared_ptr ucx_comm_; std::shared_ptr oobContext; - private: - static Status MakeOOB(std::shared_ptr &ucc_oob_ctx, - MemoryPool *pool, std::shared_ptr *out); +private: + static Status MakeOOB(std::shared_ptr &ucc_oob_ctx, + MemoryPool *pool, std::shared_ptr *out); }; #endif diff --git a/cpp/src/cylon/thridparty/cereal/access.hpp b/cpp/src/cylon/thridparty/cereal/access.hpp new file mode 100644 index 000000000..af92469df --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/access.hpp @@ -0,0 +1,351 @@ +/*! \file access.hpp + \brief Access control and default construction */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ACCESS_HPP_ +#define CEREAL_ACCESS_HPP_ + +#include +#include +#include +#include + +#include "cylon/thridparty/cereal/macros.hpp" +#include "cylon/thridparty/cereal/specialize.hpp" +#include "cylon/thridparty/cereal/details/helpers.hpp" + +namespace cereal +{ + // ###################################################################### + //! A class that allows cereal to load smart pointers to types that have no default constructor + /*! If your class does not have a default constructor, cereal will not be able + to load any smart pointers to it unless you overload LoadAndConstruct + for your class, and provide an appropriate load_and_construct method. You can also + choose to define a member static function instead of specializing this class. + + The specialization of LoadAndConstruct must be placed within the cereal namespace: + + @code{.cpp} + struct MyType + { + MyType( int x ); // note: no default ctor + int myX; + + // Define a serialize or load/save pair as you normally would + template + void serialize( Archive & ar ) + { + ar( myX ); + } + }; + + // Provide a specialization for LoadAndConstruct for your type + namespace cereal + { + template <> struct LoadAndConstruct + { + // load_and_construct will be passed the archive that you will be loading + // from as well as a construct object which you can use as if it were the + // constructor for your type. cereal will handle all memory management for you. + template + static void load_and_construct( Archive & ar, cereal::construct & construct ) + { + int x; + ar( x ); + construct( x ); + } + + // if you require versioning, simply add a const std::uint32_t as the final parameter, e.g.: + // load_and_construct( Archive & ar, cereal::construct & construct, std::uint32_t const version ) + }; + } // end namespace cereal + @endcode + + Please note that just as in using external serialization functions, you cannot get + access to non-public members of your class by befriending cereal::access. If you + have the ability to modify the class you wish to serialize, it is recommended that you + use member serialize functions and a static member load_and_construct function. + + load_and_construct functions, regardless of whether they are static members of your class or + whether you create one in the LoadAndConstruct specialization, have the following signature: + + @code{.cpp} + // generally Archive will be templated, but it can be specific if desired + template + static void load_and_construct( Archive & ar, cereal::construct & construct ); + // with an optional last parameter specifying the version: const std::uint32_t version + @endcode + + Versioning behaves the same way as it does for standard serialization functions. + + @tparam T The type to specialize for + @ingroup Access */ + template + struct LoadAndConstruct + { }; + + // forward decl for construct + //! @cond PRIVATE_NEVERDEFINED + namespace memory_detail{ template struct LoadAndConstructLoadWrapper; } + namespace boost_variant_detail{ template struct LoadAndConstructLoadWrapper; } + //! @endcond + + //! Used to construct types with no default constructor + /*! When serializing a type that has no default constructor, cereal + will attempt to call either the class static function load_and_construct + or the appropriate template specialization of LoadAndConstruct. cereal + will pass that function a reference to the archive as well as a reference + to a construct object which should be used to perform the allocation once + data has been appropriately loaded. + + @code{.cpp} + struct MyType + { + // note the lack of default constructor + MyType( int xx, int yy ); + + int x, y; + double notInConstructor; + + template + void serialize( Archive & ar ) + { + ar( x, y ); + ar( notInConstructor ); + } + + template + static void load_and_construct( Archive & ar, cereal::construct & construct ) + { + int x, y; + ar( x, y ); + + // use construct object to initialize with loaded data + construct( x, y ); + + // access to member variables and functions via -> operator + ar( construct->notInConstructor ); + + // could also do the above section by: + double z; + ar( z ); + construct->notInConstructor = z; + } + }; + @endcode + + @tparam T The class type being serialized + */ + template + class construct + { + public: + //! Construct and initialize the type T with the given arguments + /*! This will forward all arguments to the underlying type T, + calling an appropriate constructor. + + Calling this function more than once will result in an exception + being thrown. + + @param args The arguments to the constructor for T + @throw Exception If called more than once */ + template + void operator()( Args && ... args ); + // implementation deferred due to reliance on cereal::access + + //! Get a reference to the initialized underlying object + /*! This must be called after the object has been initialized. + + @return A reference to the initialized object + @throw Exception If called before initialization */ + T * operator->() + { + if( !itsValid ) + throw Exception("Object must be initialized prior to accessing members"); + + return itsPtr; + } + + //! Returns a raw pointer to the initialized underlying object + /*! This is mainly intended for use with passing an instance of + a constructed object to cereal::base_class. + + It is strongly recommended to avoid using this function in + any other circumstance. + + @return A raw pointer to the initialized type */ + T * ptr() + { + return operator->(); + } + + private: + template friend struct ::cereal::memory_detail::LoadAndConstructLoadWrapper; + template friend struct ::cereal::boost_variant_detail::LoadAndConstructLoadWrapper; + + construct( T * p ) : itsPtr( p ), itsEnableSharedRestoreFunction( [](){} ), itsValid( false ) {} + construct( T * p, std::function enableSharedFunc ) : // g++4.7 ice with default lambda to std func + itsPtr( p ), itsEnableSharedRestoreFunction( enableSharedFunc ), itsValid( false ) {} + construct( construct const & ) = delete; + construct & operator=( construct const & ) = delete; + + T * itsPtr; + std::function itsEnableSharedRestoreFunction; + bool itsValid; + }; + + // ###################################################################### + //! A class that can be made a friend to give cereal access to non public functions + /*! If you desire non-public serialization functions within a class, cereal can only + access these if you declare cereal::access a friend. + + @code{.cpp} + class MyClass + { + private: + friend class cereal::access; // gives access to the private serialize + + template + void serialize( Archive & ar ) + { + // some code + } + }; + @endcode + @ingroup Access */ + class access + { + public: + // ####### Standard Serialization ######################################## + template inline + static auto member_serialize(Archive & ar, T & t) -> decltype(t.CEREAL_SERIALIZE_FUNCTION_NAME(ar)) + { return t.CEREAL_SERIALIZE_FUNCTION_NAME(ar); } + + template inline + static auto member_save(Archive & ar, T const & t) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar)) + { return t.CEREAL_SAVE_FUNCTION_NAME(ar); } + + template inline + static auto member_save_non_const(Archive & ar, T & t) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar)) + { return t.CEREAL_SAVE_FUNCTION_NAME(ar); } + + template inline + static auto member_load(Archive & ar, T & t) -> decltype(t.CEREAL_LOAD_FUNCTION_NAME(ar)) + { return t.CEREAL_LOAD_FUNCTION_NAME(ar); } + + template inline + static auto member_save_minimal(Archive const & ar, T const & t) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar)) + { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar); } + + template inline + static auto member_save_minimal_non_const(Archive const & ar, T & t) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar)) + { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar); } + + template inline + static auto member_load_minimal(Archive const & ar, T & t, U && u) -> decltype(t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u))) + { return t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u)); } + + // ####### Versioned Serialization ####################################### + template inline + static auto member_serialize(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_SERIALIZE_FUNCTION_NAME(ar, version)) + { return t.CEREAL_SERIALIZE_FUNCTION_NAME(ar, version); } + + template inline + static auto member_save(Archive & ar, T const & t, const std::uint32_t version ) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar, version)) + { return t.CEREAL_SAVE_FUNCTION_NAME(ar, version); } + + template inline + static auto member_save_non_const(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar, version)) + { return t.CEREAL_SAVE_FUNCTION_NAME(ar, version); } + + template inline + static auto member_load(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_LOAD_FUNCTION_NAME(ar, version)) + { return t.CEREAL_LOAD_FUNCTION_NAME(ar, version); } + + template inline + static auto member_save_minimal(Archive const & ar, T const & t, const std::uint32_t version) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version)) + { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version); } + + template inline + static auto member_save_minimal_non_const(Archive const & ar, T & t, const std::uint32_t version) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version)) + { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version); } + + template inline + static auto member_load_minimal(Archive const & ar, T & t, U && u, const std::uint32_t version) -> decltype(t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u), version)) + { return t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u), version); } + + // ####### Other Functionality ########################################## + // for detecting inheritance from enable_shared_from_this + template inline + static auto shared_from_this(T & t) -> decltype(t.shared_from_this()); + + // for placement new + template inline + static void construct( T *& ptr, Args && ... args ) + { + new (ptr) T( std::forward( args )... ); + } + + // for non-placement new with a default constructor + template inline + static T * construct() + { + return new T(); + } + + template inline + static std::false_type load_and_construct(...) + { return std::false_type(); } + + template inline + static auto load_and_construct(Archive & ar, ::cereal::construct & construct) -> decltype(T::load_and_construct(ar, construct)) + { + T::load_and_construct( ar, construct ); + } + + template inline + static auto load_and_construct(Archive & ar, ::cereal::construct & construct, const std::uint32_t version) -> decltype(T::load_and_construct(ar, construct, version)) + { + T::load_and_construct( ar, construct, version ); + } + }; // end class access + + // ###################################################################### + // Deferred Implementation, see construct for more information + template template inline + void construct::operator()( Args && ... args ) + { + if( itsValid ) + throw Exception("Attempting to construct an already initialized object"); + + ::cereal::access::construct( itsPtr, std::forward( args )... ); + itsEnableSharedRestoreFunction(); + itsValid = true; + } +} // namespace cereal + +#endif // CEREAL_ACCESS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp b/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp new file mode 100644 index 000000000..9615c604a --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp @@ -0,0 +1,163 @@ +/*! \file adapters.hpp + \brief Archive adapters that provide additional functionality + on top of an existing archive */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ARCHIVES_ADAPTERS_HPP_ +#define CEREAL_ARCHIVES_ADAPTERS_HPP_ + +#include "cylon/thridparty/cereal/details/helpers.hpp" +#include + +namespace cereal +{ + #ifdef CEREAL_FUTURE_EXPERIMENTAL + + // Forward declaration for friend access + template U & get_user_data( A & ); + + //! Wraps an archive and gives access to user data + /*! This adapter is useful if you require access to + either raw pointers or references within your + serialization functions. + + While cereal does not directly support serialization + raw pointers or references, it is sometimes the case + that you may want to supply something such as a raw + pointer or global reference to some constructor. + In this situation this adapter would likely be used + with the construct class to allow for non-default + constructors. + + @note This feature is experimental and may be altered or removed in a future release. See issue #46. + + @code{.cpp} + struct MyUserData + { + int * myRawPointer; + std::reference_wrapper myReference; + }; + + struct MyClass + { + // Note the raw pointer parameter + MyClass( int xx, int * rawP ); + + int x; + + template + void serialize( Archive & ar ) + { ar( x ); } + + template + static void load_and_construct( Archive & ar, cereal::construct & construct ) + { + int xx; + ar( xx ); + // note the need to use get_user_data to retrieve user data from the archive + construct( xx, cereal::get_user_data( ar ).myRawPointer ); + } + }; + + int main() + { + { + MyUserData md; + md.myRawPointer = &something; + md.myReference = someInstanceOfType; + + std::ifstream is( "data.xml" ); + cereal::UserDataAdapter ar( md, is ); + + std::unique_ptr sc; + ar( sc ); // use as normal + } + + return 0; + } + @endcode + + @relates get_user_data + + @tparam UserData The type to give the archive access to + @tparam Archive The archive to wrap */ + template + class UserDataAdapter : public Archive + { + public: + //! Construct the archive with some user data struct + /*! This will forward all arguments (other than the user + data) to the wrapped archive type. The UserDataAdapter + can then be used identically to the wrapped archive type + + @tparam Args The arguments to pass to the constructor of + the archive. */ + template + UserDataAdapter( UserData & ud, Args && ... args ) : + Archive( std::forward( args )... ), + userdata( ud ) + { } + + private: + //! Overload the rtti function to enable dynamic_cast + void rtti() {} + friend UserData & get_user_data( Archive & ar ); + UserData & userdata; //!< The actual user data + }; + + //! Retrieves user data from an archive wrapped by UserDataAdapter + /*! This will attempt to retrieve the user data associated with + some archive wrapped by UserDataAdapter. If this is used on + an archive that is not wrapped, a run-time exception will occur. + + @note This feature is experimental and may be altered or removed in a future release. See issue #46. + + @note The correct use of this function cannot be enforced at compile + time. + + @relates UserDataAdapter + @tparam UserData The data struct contained in the archive + @tparam Archive The archive, which should be wrapped by UserDataAdapter + @param ar The archive + @throws Exception if the archive this is used upon is not wrapped with + UserDataAdapter. */ + template + UserData & get_user_data( Archive & ar ) + { + try + { + return dynamic_cast &>( ar ).userdata; + } + catch( std::bad_cast const & ) + { + throw ::cereal::Exception("Attempting to get user data from archive not wrapped in UserDataAdapter"); + } + } + #endif // CEREAL_FUTURE_EXPERIMENTAL +} // namespace cereal + +#endif // CEREAL_ARCHIVES_ADAPTERS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/binary.hpp b/cpp/src/cylon/thridparty/cereal/archives/binary.hpp new file mode 100644 index 000000000..4c22cdf17 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/archives/binary.hpp @@ -0,0 +1,169 @@ +/*! \file binary.hpp + \brief Binary input and output archives */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ARCHIVES_BINARY_HPP_ +#define CEREAL_ARCHIVES_BINARY_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + // ###################################################################### + //! An output archive designed to save data in a compact binary representation + /*! This archive outputs data to a stream in an extremely compact binary + representation with as little extra metadata as possible. + + This archive does nothing to ensure that the endianness of the saved + and loaded data is the same. If you need to have portability over + architectures with different endianness, use PortableBinaryOutputArchive. + + When using a binary archive and a file stream, you must use the + std::ios::binary format flag to avoid having your data altered + inadvertently. + + \ingroup Archives */ + class BinaryOutputArchive : public OutputArchive + { + public: + //! Construct, outputting to the provided stream + /*! @param stream The stream to output to. Can be a stringstream, a file stream, or + even cout! */ + BinaryOutputArchive(std::ostream & stream) : + OutputArchive(this), + itsStream(stream) + { } + + ~BinaryOutputArchive() CEREAL_NOEXCEPT = default; + + //! Writes size bytes of data to the output stream + void saveBinary( const void * data, std::streamsize size ) + { + auto const writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); + + if(writtenSize != size) + throw Exception("Failed to write " + std::to_string(size) + " bytes to output stream! Wrote " + std::to_string(writtenSize)); + } + + private: + std::ostream & itsStream; + }; + + // ###################################################################### + //! An input archive designed to load data saved using BinaryOutputArchive + /* This archive does nothing to ensure that the endianness of the saved + and loaded data is the same. If you need to have portability over + architectures with different endianness, use PortableBinaryOutputArchive. + + When using a binary archive and a file stream, you must use the + std::ios::binary format flag to avoid having your data altered + inadvertently. + + \ingroup Archives */ + class BinaryInputArchive : public InputArchive + { + public: + //! Construct, loading from the provided stream + BinaryInputArchive(std::istream & stream) : + InputArchive(this), + itsStream(stream) + { } + + ~BinaryInputArchive() CEREAL_NOEXCEPT = default; + + //! Reads size bytes of data from the input stream + void loadBinary( void * const data, std::streamsize size ) + { + auto const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); + + if(readSize != size) + throw Exception("Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize)); + } + + private: + std::istream & itsStream; + }; + + // ###################################################################### + // Common BinaryArchive serialization functions + + //! Saving for POD types to binary + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive & ar, T const & t) + { + ar.saveBinary(std::addressof(t), sizeof(t)); + } + + //! Loading for POD types from binary + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive & ar, T & t) + { + ar.loadBinary(std::addressof(t), sizeof(t)); + } + + //! Serializing NVP types to binary + template inline + CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) + CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, NameValuePair & t ) + { + ar( t.value ); + } + + //! Serializing SizeTags to binary + template inline + CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) + CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, SizeTag & t ) + { + ar( t.size ); + } + + //! Saving binary data + template inline + void CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive & ar, BinaryData const & bd) + { + ar.saveBinary( bd.data, static_cast( bd.size ) ); + } + + //! Loading binary data + template inline + void CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive & ar, BinaryData & bd) + { + ar.loadBinary(bd.data, static_cast( bd.size ) ); + } +} // namespace cereal + +// register archives for polymorphic support +CEREAL_REGISTER_ARCHIVE(cereal::BinaryOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::BinaryInputArchive) + +// tie input and output archives together +CEREAL_SETUP_ARCHIVE_TRAITS(cereal::BinaryInputArchive, cereal::BinaryOutputArchive) + +#endif // CEREAL_ARCHIVES_BINARY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/json.hpp b/cpp/src/cylon/thridparty/cereal/archives/json.hpp new file mode 100644 index 000000000..37a1e1337 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/archives/json.hpp @@ -0,0 +1,1041 @@ +/*! \file json.hpp + \brief JSON input and output archives */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ARCHIVES_JSON_HPP_ +#define CEREAL_ARCHIVES_JSON_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include "cylon/thridparty/cereal/details/util.hpp" + +namespace cereal +{ + //! An exception thrown when rapidjson fails an internal assertion + /*! @ingroup Utility */ + struct RapidJSONException : Exception + { RapidJSONException( const char * what_ ) : Exception( what_ ) {} }; +} + +// Inform rapidjson that assert will throw +#ifndef CEREAL_RAPIDJSON_ASSERT_THROWS +#define CEREAL_RAPIDJSON_ASSERT_THROWS +#endif // CEREAL_RAPIDJSON_ASSERT_THROWS + +// Override rapidjson assertions to throw exceptions by default +#ifndef CEREAL_RAPIDJSON_ASSERT +#define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ \ + throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); } +#endif // RAPIDJSON_ASSERT + +// Enable support for parsing of nan, inf, -inf +#ifndef CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS +#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNanAndInfFlag +#endif + +// Enable support for parsing of nan, inf, -inf +#ifndef CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS +#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag | kParseNanAndInfFlag +#endif + +#include "cereal/external/rapidjson/prettywriter.h" +#include "cereal/external/rapidjson/ostreamwrapper.h" +#include "cereal/external/rapidjson/istreamwrapper.h" +#include "cereal/external/rapidjson/document.h" +#include "cereal/external/base64.hpp" + +#include +#include +#include +#include +#include + +namespace cereal +{ + // ###################################################################### + //! An output archive designed to save data to JSON + /*! This archive uses RapidJSON to build serialize data to JSON. + + JSON archives provides a human readable output but at decreased + performance (both in time and space) compared to binary archives. + + JSON archives are only guaranteed to finish flushing their contents + upon destruction and should thus be used in an RAII fashion. + + JSON benefits greatly from name-value pairs, which if present, will + name the nodes in the output. If these are not present, each level + of the output will be given an automatically generated delimited name. + + The precision of the output archive controls the number of decimals output + for floating point numbers and should be sufficiently large (i.e. at least 20) + if there is a desire to have binary equality between the numbers output and + those read in. In general you should expect a loss of precision when going + from floating point to text and back. + + JSON archives do not output the size information for any dynamically sized structure + and instead infer it from the number of children for a node. This means that data + can be hand edited for dynamic sized structures and will still be readable. This + is accomplished through the cereal::SizeTag object, which will cause the archive + to output the data as a JSON array (e.g. marked by [] instead of {}), which indicates + that the container is variable sized and may be edited. + + \ingroup Archives */ + class JSONOutputArchive : public OutputArchive, public traits::TextArchive + { + enum class NodeType { StartObject, InObject, StartArray, InArray }; + + using WriteStream = CEREAL_RAPIDJSON_NAMESPACE::OStreamWrapper; + using JSONWriter = CEREAL_RAPIDJSON_NAMESPACE::PrettyWriter; + + public: + /*! @name Common Functionality + Common use cases for directly interacting with an JSONOutputArchive */ + //! @{ + + //! A class containing various advanced options for the JSON archive + class Options + { + public: + //! Default options + static Options Default(){ return Options(); } + + //! Default options with no indentation + static Options NoIndent(){ return Options( JSONWriter::kDefaultMaxDecimalPlaces, IndentChar::space, 0 ); } + + //! The character to use for indenting + enum class IndentChar : char + { + space = ' ', + tab = '\t', + newline = '\n', + carriage_return = '\r' + }; + + //! Specify specific options for the JSONOutputArchive + /*! @param precision The precision used for floating point numbers + @param indentChar The type of character to indent with + @param indentLength The number of indentChar to use for indentation + (0 corresponds to no indentation) */ + explicit Options( int precision = JSONWriter::kDefaultMaxDecimalPlaces, + IndentChar indentChar = IndentChar::space, + unsigned int indentLength = 4 ) : + itsPrecision( precision ), + itsIndentChar( static_cast(indentChar) ), + itsIndentLength( indentLength ) { } + + private: + friend class JSONOutputArchive; + int itsPrecision; + char itsIndentChar; + unsigned int itsIndentLength; + }; + + //! Construct, outputting to the provided stream + /*! @param stream The stream to output to. + @param options The JSON specific options to use. See the Options struct + for the values of default parameters */ + JSONOutputArchive(std::ostream & stream, Options const & options = Options::Default() ) : + OutputArchive(this), + itsWriteStream(stream), + itsWriter(itsWriteStream), + itsNextName(nullptr) + { + itsWriter.SetMaxDecimalPlaces( options.itsPrecision ); + itsWriter.SetIndent( options.itsIndentChar, options.itsIndentLength ); + itsNameCounter.push(0); + itsNodeStack.push(NodeType::StartObject); + } + + //! Destructor, flushes the JSON + ~JSONOutputArchive() CEREAL_NOEXCEPT + { + if (itsNodeStack.top() == NodeType::InObject) + itsWriter.EndObject(); + else if (itsNodeStack.top() == NodeType::InArray) + itsWriter.EndArray(); + } + + //! Saves some binary data, encoded as a base64 string, with an optional name + /*! This will create a new node, optionally named, and insert a value that consists of + the data encoded as a base64 string */ + void saveBinaryValue( const void * data, size_t size, const char * name = nullptr ) + { + setNextName( name ); + writeName(); + + auto base64string = base64::encode( reinterpret_cast( data ), size ); + saveValue( base64string ); + } + + //! @} + /*! @name Internal Functionality + Functionality designed for use by those requiring control over the inner mechanisms of + the JSONOutputArchive */ + //! @{ + + //! Starts a new node in the JSON output + /*! The node can optionally be given a name by calling setNextName prior + to creating the node + + Nodes only need to be started for types that are themselves objects or arrays */ + void startNode() + { + writeName(); + itsNodeStack.push(NodeType::StartObject); + itsNameCounter.push(0); + } + + //! Designates the most recently added node as finished + void finishNode() + { + // if we ended up serializing an empty object or array, writeName + // will never have been called - so start and then immediately end + // the object/array. + // + // We'll also end any object/arrays we happen to be in + switch(itsNodeStack.top()) + { + case NodeType::StartArray: + itsWriter.StartArray(); + // fall through + case NodeType::InArray: + itsWriter.EndArray(); + break; + case NodeType::StartObject: + itsWriter.StartObject(); + // fall through + case NodeType::InObject: + itsWriter.EndObject(); + break; + } + + itsNodeStack.pop(); + itsNameCounter.pop(); + } + + //! Sets the name for the next node created with startNode + void setNextName( const char * name ) + { + itsNextName = name; + } + + //! Saves a bool to the current node + void saveValue(bool b) { itsWriter.Bool(b); } + //! Saves an int to the current node + void saveValue(int i) { itsWriter.Int(i); } + //! Saves a uint to the current node + void saveValue(unsigned u) { itsWriter.Uint(u); } + //! Saves an int64 to the current node + void saveValue(int64_t i64) { itsWriter.Int64(i64); } + //! Saves a uint64 to the current node + void saveValue(uint64_t u64) { itsWriter.Uint64(u64); } + //! Saves a double to the current node + void saveValue(double d) { itsWriter.Double(d); } + //! Saves a string to the current node + void saveValue(std::string const & s) { itsWriter.String(s.c_str(), static_cast( s.size() )); } + //! Saves a const char * to the current node + void saveValue(char const * s) { itsWriter.String(s); } + //! Saves a nullptr to the current node + void saveValue(std::nullptr_t) { itsWriter.Null(); } + + template inline + typename std::enable_if::value && std::is_same::value, void>::type + saveValue(T val) { itsWriter.Int64(val); } + template inline + typename std::enable_if::value && std::is_same::value, void>::type + saveValue(T val) { itsWriter.Uint64(val); } + + private: + // Some compilers/OS have difficulty disambiguating the above for various flavors of longs, so we provide + // special overloads to handle these cases. + + //! 32 bit signed long saving to current node + template ::value> = traits::sfinae> inline + void saveLong(T l){ saveValue( static_cast( l ) ); } + + //! non 32 bit signed long saving to current node + template ::value> = traits::sfinae> inline + void saveLong(T l){ saveValue( static_cast( l ) ); } + + //! 32 bit unsigned long saving to current node + template ::value> = traits::sfinae> inline + void saveLong(T lu){ saveValue( static_cast( lu ) ); } + + //! non 32 bit unsigned long saving to current node + template ::value> = traits::sfinae> inline + void saveLong(T lu){ saveValue( static_cast( lu ) ); } + + public: +#if defined(_MSC_VER) && _MSC_VER < 1916 + //! MSVC only long overload to current node + void saveValue( unsigned long lu ){ saveLong( lu ); }; +#else // _MSC_VER + //! Serialize a long if it would not be caught otherwise + template ::value, + !std::is_same::value, + !std::is_same::value> = traits::sfinae> inline + void saveValue( T t ){ saveLong( t ); } + + //! Serialize an unsigned long if it would not be caught otherwise + template ::value, + !std::is_same::value, + !std::is_same::value> = traits::sfinae> inline + void saveValue( T t ){ saveLong( t ); } +#endif // _MSC_VER + + //! Save exotic arithmetic as strings to current node + /*! Handles long long (if distinct from other types), unsigned long (if distinct), and long double */ + template ::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long))> = traits::sfinae> inline + void saveValue(T const & t) + { + std::stringstream ss; ss.precision( std::numeric_limits::max_digits10 ); + ss << t; + saveValue( ss.str() ); + } + + //! Write the name of the upcoming node and prepare object/array state + /*! Since writeName is called for every value that is output, regardless of + whether it has a name or not, it is the place where we will do a deferred + check of our node state and decide whether we are in an array or an object. + + The general workflow of saving to the JSON archive is: + + 1. (optional) Set the name for the next node to be created, usually done by an NVP + 2. Start the node + 3. (if there is data to save) Write the name of the node (this function) + 4. (if there is data to save) Save the data (with saveValue) + 5. Finish the node + */ + void writeName() + { + NodeType const & nodeType = itsNodeStack.top(); + + // Start up either an object or an array, depending on state + if(nodeType == NodeType::StartArray) + { + itsWriter.StartArray(); + itsNodeStack.top() = NodeType::InArray; + } + else if(nodeType == NodeType::StartObject) + { + itsNodeStack.top() = NodeType::InObject; + itsWriter.StartObject(); + } + + // Array types do not output names + if(nodeType == NodeType::InArray) return; + + if(itsNextName == nullptr) + { + std::string name = "value" + std::to_string( itsNameCounter.top()++ ) + "\0"; + saveValue(name); + } + else + { + saveValue(itsNextName); + itsNextName = nullptr; + } + } + + //! Designates that the current node should be output as an array, not an object + void makeArray() + { + itsNodeStack.top() = NodeType::StartArray; + } + + //! @} + + private: + WriteStream itsWriteStream; //!< Rapidjson write stream + JSONWriter itsWriter; //!< Rapidjson writer + char const * itsNextName; //!< The next name + std::stack itsNameCounter; //!< Counter for creating unique names for unnamed nodes + std::stack itsNodeStack; + }; // JSONOutputArchive + + // ###################################################################### + //! An input archive designed to load data from JSON + /*! This archive uses RapidJSON to read in a JSON archive. + + As with the output JSON archive, the preferred way to use this archive is in + an RAII fashion, ensuring its destruction after all data has been read. + + Input JSON should have been produced by the JSONOutputArchive. Data can + only be added to dynamically sized containers (marked by JSON arrays) - + the input archive will determine their size by looking at the number of child nodes. + Only JSON originating from a JSONOutputArchive is officially supported, but data + from other sources may work if properly formatted. + + The JSONInputArchive does not require that nodes are loaded in the same + order they were saved by JSONOutputArchive. Using name value pairs (NVPs), + it is possible to load in an out of order fashion or otherwise skip/select + specific nodes to load. + + The default behavior of the input archive is to read sequentially starting + with the first node and exploring its children. When a given NVP does + not match the read in name for a node, the archive will search for that + node at the current level and load it if it exists. After loading an out of + order node, the archive will then proceed back to loading sequentially from + its new position. + + Consider this simple example where loading of some data is skipped: + + @code{cpp} + // imagine the input file has someData(1-9) saved in order at the top level node + ar( someData1, someData2, someData3 ); // XML loads in the order it sees in the file + ar( cereal::make_nvp( "hello", someData6 ) ); // NVP given does not + // match expected NVP name, so we search + // for the given NVP and load that value + ar( someData7, someData8, someData9 ); // with no NVP given, loading resumes at its + // current location, proceeding sequentially + @endcode + + \ingroup Archives */ + class JSONInputArchive : public InputArchive, public traits::TextArchive + { + private: + using ReadStream = CEREAL_RAPIDJSON_NAMESPACE::IStreamWrapper; + typedef CEREAL_RAPIDJSON_NAMESPACE::GenericValue> JSONValue; + typedef JSONValue::ConstMemberIterator MemberIterator; + typedef JSONValue::ConstValueIterator ValueIterator; + typedef CEREAL_RAPIDJSON_NAMESPACE::Document::GenericValue GenericValue; + + public: + /*! @name Common Functionality + Common use cases for directly interacting with an JSONInputArchive */ + //! @{ + + //! Construct, reading from the provided stream + /*! @param stream The stream to read from */ + JSONInputArchive(std::istream & stream) : + InputArchive(this), + itsNextName( nullptr ), + itsReadStream(stream) + { + itsDocument.ParseStream<>(itsReadStream); + if (itsDocument.IsArray()) + itsIteratorStack.emplace_back(itsDocument.Begin(), itsDocument.End()); + else + itsIteratorStack.emplace_back(itsDocument.MemberBegin(), itsDocument.MemberEnd()); + } + + ~JSONInputArchive() CEREAL_NOEXCEPT = default; + + //! Loads some binary data, encoded as a base64 string + /*! This will automatically start and finish a node to load the data, and can be called directly by + users. + + Note that this follows the same ordering rules specified in the class description in regards + to loading in/out of order */ + void loadBinaryValue( void * data, size_t size, const char * name = nullptr ) + { + itsNextName = name; + + std::string encoded; + loadValue( encoded ); + auto decoded = base64::decode( encoded ); + + if( size != decoded.size() ) + throw Exception("Decoded binary data size does not match specified size"); + + std::memcpy( data, decoded.data(), decoded.size() ); + itsNextName = nullptr; + } + + private: + //! @} + /*! @name Internal Functionality + Functionality designed for use by those requiring control over the inner mechanisms of + the JSONInputArchive */ + //! @{ + + //! An internal iterator that handles both array and object types + /*! This class is a variant and holds both types of iterators that + rapidJSON supports - one for arrays and one for objects. */ + class Iterator + { + public: + Iterator() : itsIndex( 0 ), itsType(Null_) {} + + Iterator(MemberIterator begin, MemberIterator end) : + itsMemberItBegin(begin), itsMemberItEnd(end), itsIndex(0), itsSize(std::distance(begin, end)), itsType(Member) + { + if( itsSize == 0 ) + itsType = Null_; + } + + Iterator(ValueIterator begin, ValueIterator end) : + itsValueItBegin(begin), itsIndex(0), itsSize(std::distance(begin, end)), itsType(Value) + { + if( itsSize == 0 ) + itsType = Null_; + } + + //! Advance to the next node + Iterator & operator++() + { + ++itsIndex; + return *this; + } + + //! Get the value of the current node + GenericValue const & value() + { + if( itsIndex >= itsSize ) + throw cereal::Exception("No more objects in input"); + + switch(itsType) + { + case Value : return itsValueItBegin[itsIndex]; + case Member: return itsMemberItBegin[itsIndex].value; + default: throw cereal::Exception("JSONInputArchive internal error: null or empty iterator to object or array!"); + } + } + + //! Get the name of the current node, or nullptr if it has no name + const char * name() const + { + if( itsType == Member && (itsMemberItBegin + itsIndex) != itsMemberItEnd ) + return itsMemberItBegin[itsIndex].name.GetString(); + else + return nullptr; + } + + //! Adjust our position such that we are at the node with the given name + /*! @throws Exception if no such named node exists */ + inline void search( const char * searchName ) + { + const auto len = std::strlen( searchName ); + size_t index = 0; + for( auto it = itsMemberItBegin; it != itsMemberItEnd; ++it, ++index ) + { + const auto currentName = it->name.GetString(); + if( ( std::strncmp( searchName, currentName, len ) == 0 ) && + ( std::strlen( currentName ) == len ) ) + { + itsIndex = index; + return; + } + } + + throw Exception("JSON Parsing failed - provided NVP (" + std::string(searchName) + ") not found"); + } + + private: + MemberIterator itsMemberItBegin, itsMemberItEnd; //!< The member iterator (object) + ValueIterator itsValueItBegin; //!< The value iterator (array) + size_t itsIndex, itsSize; //!< The current index of this iterator + enum Type {Value, Member, Null_} itsType; //!< Whether this holds values (array) or members (objects) or nothing + }; + + //! Searches for the expectedName node if it doesn't match the actualName + /*! This needs to be called before every load or node start occurs. This function will + check to see if an NVP has been provided (with setNextName) and if so, see if that name matches the actual + next name given. If the names do not match, it will search in the current level of the JSON for that name. + If the name is not found, an exception will be thrown. + + Resets the NVP name after called. + + @throws Exception if an expectedName is given and not found */ + inline void search() + { + // store pointer to itsNextName locally and reset to nullptr in case search() throws + auto localNextName = itsNextName; + itsNextName = nullptr; + + // The name an NVP provided with setNextName() + if( localNextName ) + { + // The actual name of the current node + auto const actualName = itsIteratorStack.back().name(); + + // Do a search if we don't see a name coming up, or if the names don't match + if( !actualName || std::strcmp( localNextName, actualName ) != 0 ) + itsIteratorStack.back().search( localNextName ); + } + } + + public: + //! Starts a new node, going into its proper iterator + /*! This places an iterator for the next node to be parsed onto the iterator stack. If the next + node is an array, this will be a value iterator, otherwise it will be a member iterator. + + By default our strategy is to start with the document root node and then recursively iterate through + all children in the order they show up in the document. + We don't need to know NVPs to do this; we'll just blindly load in the order things appear in. + + If we were given an NVP, we will search for it if it does not match our the name of the next node + that would normally be loaded. This functionality is provided by search(). */ + void startNode() + { + search(); + + if(itsIteratorStack.back().value().IsArray()) + itsIteratorStack.emplace_back(itsIteratorStack.back().value().Begin(), itsIteratorStack.back().value().End()); + else + itsIteratorStack.emplace_back(itsIteratorStack.back().value().MemberBegin(), itsIteratorStack.back().value().MemberEnd()); + } + + //! Finishes the most recently started node + void finishNode() + { + itsIteratorStack.pop_back(); + ++itsIteratorStack.back(); + } + + //! Retrieves the current node name + /*! @return nullptr if no name exists */ + const char * getNodeName() const + { + return itsIteratorStack.back().name(); + } + + //! Sets the name for the next node created with startNode + void setNextName( const char * name ) + { + itsNextName = name; + } + + //! Loads a value from the current node - small signed overload + template ::value, + sizeof(T) < sizeof(int64_t)> = traits::sfinae> inline + void loadValue(T & val) + { + search(); + + val = static_cast( itsIteratorStack.back().value().GetInt() ); + ++itsIteratorStack.back(); + } + + //! Loads a value from the current node - small unsigned overload + template ::value, + sizeof(T) < sizeof(uint64_t), + !std::is_same::value> = traits::sfinae> inline + void loadValue(T & val) + { + search(); + + val = static_cast( itsIteratorStack.back().value().GetUint() ); + ++itsIteratorStack.back(); + } + + //! Loads a value from the current node - bool overload + void loadValue(bool & val) { search(); val = itsIteratorStack.back().value().GetBool(); ++itsIteratorStack.back(); } + //! Loads a value from the current node - int64 overload + void loadValue(int64_t & val) { search(); val = itsIteratorStack.back().value().GetInt64(); ++itsIteratorStack.back(); } + //! Loads a value from the current node - uint64 overload + void loadValue(uint64_t & val) { search(); val = itsIteratorStack.back().value().GetUint64(); ++itsIteratorStack.back(); } + //! Loads a value from the current node - float overload + void loadValue(float & val) { search(); val = static_cast(itsIteratorStack.back().value().GetDouble()); ++itsIteratorStack.back(); } + //! Loads a value from the current node - double overload + void loadValue(double & val) { search(); val = itsIteratorStack.back().value().GetDouble(); ++itsIteratorStack.back(); } + //! Loads a value from the current node - string overload + void loadValue(std::string & val) { search(); val = itsIteratorStack.back().value().GetString(); ++itsIteratorStack.back(); } + //! Loads a nullptr from the current node + void loadValue(std::nullptr_t&) { search(); CEREAL_RAPIDJSON_ASSERT(itsIteratorStack.back().value().IsNull()); ++itsIteratorStack.back(); } + + template inline + typename std::enable_if::value && std::is_same::value, void>::type + loadValue(T & val) { search(); val = itsIteratorStack.back().value().GetInt64(); ++itsIteratorStack.back(); } + template inline + typename std::enable_if::value && std::is_same::value, void>::type + loadValue(T & val) { search(); val = itsIteratorStack.back().value().GetUint64(); ++itsIteratorStack.back(); } + // Special cases to handle various flavors of long, which tend to conflict with + // the int32_t or int64_t on various compiler/OS combinations. MSVC doesn't need any of this. + #ifndef _MSC_VER + private: + //! 32 bit signed long loading from current node + template inline + typename std::enable_if::value, void>::type + loadLong(T & l){ loadValue( reinterpret_cast( l ) ); } + + //! non 32 bit signed long loading from current node + template inline + typename std::enable_if::value, void>::type + loadLong(T & l){ loadValue( reinterpret_cast( l ) ); } + + //! 32 bit unsigned long loading from current node + template inline + typename std::enable_if::value, void>::type + loadLong(T & lu){ loadValue( reinterpret_cast( lu ) ); } + + //! non 32 bit unsigned long loading from current node + template inline + typename std::enable_if::value, void>::type + loadLong(T & lu){ loadValue( reinterpret_cast( lu ) ); } + + public: + //! Serialize a long if it would not be caught otherwise + template inline + typename std::enable_if::value && + sizeof(T) >= sizeof(std::int64_t) && + !std::is_same::value, void>::type + loadValue( T & t ){ loadLong(t); } + + //! Serialize an unsigned long if it would not be caught otherwise + template inline + typename std::enable_if::value && + sizeof(T) >= sizeof(std::uint64_t) && + !std::is_same::value, void>::type + loadValue( T & t ){ loadLong(t); } + #endif // _MSC_VER + + private: + //! Convert a string to a long long + void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); } + //! Convert a string to an unsigned long long + void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); } + //! Convert a string to a long double + void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); } + + public: + //! Loads a value from the current node - long double and long long overloads + template ::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long))> = traits::sfinae> + inline void loadValue(T & val) + { + std::string encoded; + loadValue( encoded ); + stringToNumber( encoded, val ); + } + + //! Loads the size for a SizeTag + void loadSize(size_type & size) + { + if (itsIteratorStack.size() == 1) + size = itsDocument.Size(); + else + size = (itsIteratorStack.rbegin() + 1)->value().Size(); + } + + //! @} + + private: + const char * itsNextName; //!< Next name set by NVP + ReadStream itsReadStream; //!< Rapidjson write stream + std::vector itsIteratorStack; //!< 'Stack' of rapidJSON iterators + CEREAL_RAPIDJSON_NAMESPACE::Document itsDocument; //!< Rapidjson document + }; + + // ###################################################################### + // JSONArchive prologue and epilogue functions + // ###################################################################### + + // ###################################################################### + //! Prologue for NVPs for JSON archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void prologue( JSONOutputArchive &, NameValuePair const & ) + { } + + //! Prologue for NVPs for JSON archives + template inline + void prologue( JSONInputArchive &, NameValuePair const & ) + { } + + // ###################################################################### + //! Epilogue for NVPs for JSON archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void epilogue( JSONOutputArchive &, NameValuePair const & ) + { } + + //! Epilogue for NVPs for JSON archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void epilogue( JSONInputArchive &, NameValuePair const & ) + { } + + // ###################################################################### + //! Prologue for deferred data for JSON archives + /*! Do nothing for the defer wrapper */ + template inline + void prologue( JSONOutputArchive &, DeferredData const & ) + { } + + //! Prologue for deferred data for JSON archives + template inline + void prologue( JSONInputArchive &, DeferredData const & ) + { } + + // ###################################################################### + //! Epilogue for deferred for JSON archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void epilogue( JSONOutputArchive &, DeferredData const & ) + { } + + //! Epilogue for deferred for JSON archives + /*! Do nothing for the defer wrapper */ + template inline + void epilogue( JSONInputArchive &, DeferredData const & ) + { } + + // ###################################################################### + //! Prologue for SizeTags for JSON archives + /*! SizeTags are strictly ignored for JSON, they just indicate + that the current node should be made into an array */ + template inline + void prologue( JSONOutputArchive & ar, SizeTag const & ) + { + ar.makeArray(); + } + + //! Prologue for SizeTags for JSON archives + template inline + void prologue( JSONInputArchive &, SizeTag const & ) + { } + + // ###################################################################### + //! Epilogue for SizeTags for JSON archives + /*! SizeTags are strictly ignored for JSON */ + template inline + void epilogue( JSONOutputArchive &, SizeTag const & ) + { } + + //! Epilogue for SizeTags for JSON archives + template inline + void epilogue( JSONInputArchive &, SizeTag const & ) + { } + + // ###################################################################### + //! Prologue for all other types for JSON archives (except minimal types) + /*! Starts a new node, named either automatically or by some NVP, + that may be given data by the type about to be archived + + Minimal types do not start or finish nodes */ + template ::value, + !traits::has_minimal_base_class_serialization::value, + !traits::has_minimal_output_serialization::value> = traits::sfinae> + inline void prologue( JSONOutputArchive & ar, T const & ) + { + ar.startNode(); + } + + //! Prologue for all other types for JSON archives + template ::value, + !traits::has_minimal_base_class_serialization::value, + !traits::has_minimal_input_serialization::value> = traits::sfinae> + inline void prologue( JSONInputArchive & ar, T const & ) + { + ar.startNode(); + } + + // ###################################################################### + //! Epilogue for all other types other for JSON archives (except minimal types) + /*! Finishes the node created in the prologue + + Minimal types do not start or finish nodes */ + template ::value, + !traits::has_minimal_base_class_serialization::value, + !traits::has_minimal_output_serialization::value> = traits::sfinae> + inline void epilogue( JSONOutputArchive & ar, T const & ) + { + ar.finishNode(); + } + + //! Epilogue for all other types other for JSON archives + template ::value, + !traits::has_minimal_base_class_serialization::value, + !traits::has_minimal_input_serialization::value> = traits::sfinae> + inline void epilogue( JSONInputArchive & ar, T const & ) + { + ar.finishNode(); + } + + // ###################################################################### + //! Prologue for arithmetic types for JSON archives + inline + void prologue( JSONOutputArchive & ar, std::nullptr_t const & ) + { + ar.writeName(); + } + + //! Prologue for arithmetic types for JSON archives + inline + void prologue( JSONInputArchive &, std::nullptr_t const & ) + { } + + // ###################################################################### + //! Epilogue for arithmetic types for JSON archives + inline + void epilogue( JSONOutputArchive &, std::nullptr_t const & ) + { } + + //! Epilogue for arithmetic types for JSON archives + inline + void epilogue( JSONInputArchive &, std::nullptr_t const & ) + { } + + // ###################################################################### + //! Prologue for arithmetic types for JSON archives + template ::value> = traits::sfinae> inline + void prologue( JSONOutputArchive & ar, T const & ) + { + ar.writeName(); + } + + //! Prologue for arithmetic types for JSON archives + template ::value> = traits::sfinae> inline + void prologue( JSONInputArchive &, T const & ) + { } + + // ###################################################################### + //! Epilogue for arithmetic types for JSON archives + template ::value> = traits::sfinae> inline + void epilogue( JSONOutputArchive &, T const & ) + { } + + //! Epilogue for arithmetic types for JSON archives + template ::value> = traits::sfinae> inline + void epilogue( JSONInputArchive &, T const & ) + { } + + // ###################################################################### + //! Prologue for strings for JSON archives + template inline + void prologue(JSONOutputArchive & ar, std::basic_string const &) + { + ar.writeName(); + } + + //! Prologue for strings for JSON archives + template inline + void prologue(JSONInputArchive &, std::basic_string const &) + { } + + // ###################################################################### + //! Epilogue for strings for JSON archives + template inline + void epilogue(JSONOutputArchive &, std::basic_string const &) + { } + + //! Epilogue for strings for JSON archives + template inline + void epilogue(JSONInputArchive &, std::basic_string const &) + { } + + // ###################################################################### + // Common JSONArchive serialization functions + // ###################################################################### + //! Serializing NVP types to JSON + template inline + void CEREAL_SAVE_FUNCTION_NAME( JSONOutputArchive & ar, NameValuePair const & t ) + { + ar.setNextName( t.name ); + ar( t.value ); + } + + template inline + void CEREAL_LOAD_FUNCTION_NAME( JSONInputArchive & ar, NameValuePair & t ) + { + ar.setNextName( t.name ); + ar( t.value ); + } + + //! Saving for nullptr to JSON + inline + void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, std::nullptr_t const & t) + { + ar.saveValue( t ); + } + + //! Loading arithmetic from JSON + inline + void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, std::nullptr_t & t) + { + ar.loadValue( t ); + } + + //! Saving for arithmetic to JSON + template ::value> = traits::sfinae> inline + void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, T const & t) + { + ar.saveValue( t ); + } + + //! Loading arithmetic from JSON + template ::value> = traits::sfinae> inline + void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, T & t) + { + ar.loadValue( t ); + } + + //! saving string to JSON + template inline + void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, std::basic_string const & str) + { + ar.saveValue( str ); + } + + //! loading string from JSON + template inline + void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, std::basic_string & str) + { + ar.loadValue( str ); + } + + // ###################################################################### + //! Saving SizeTags to JSON + template inline + void CEREAL_SAVE_FUNCTION_NAME( JSONOutputArchive &, SizeTag const & ) + { + // nothing to do here, we don't explicitly save the size + } + + //! Loading SizeTags from JSON + template inline + void CEREAL_LOAD_FUNCTION_NAME( JSONInputArchive & ar, SizeTag & st ) + { + ar.loadSize( st.size ); + } +} // namespace cereal + +// register archives for polymorphic support +CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::JSONOutputArchive) + +// tie input and output archives together +CEREAL_SETUP_ARCHIVE_TRAITS(cereal::JSONInputArchive, cereal::JSONOutputArchive) + +#endif // CEREAL_ARCHIVES_JSON_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp b/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp new file mode 100644 index 000000000..f794a57f9 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp @@ -0,0 +1,334 @@ +/*! \file binary.hpp + \brief Binary input and output archives */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ +#define CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include +#include + +namespace cereal +{ + namespace portable_binary_detail + { + //! Returns true if the current machine is little endian + /*! @ingroup Internal */ + inline std::uint8_t is_little_endian() + { + static std::int32_t test = 1; + return *reinterpret_cast( &test ) == 1; + } + + //! Swaps the order of bytes for some chunk of memory + /*! @param data The data as a uint8_t pointer + @tparam DataSize The true size of the data + @ingroup Internal */ + template + inline void swap_bytes( std::uint8_t * data ) + { + for( std::size_t i = 0, end = DataSize / 2; i < end; ++i ) + std::swap( data[i], data[DataSize - i - 1] ); + } + } // end namespace portable_binary_detail + + // ###################################################################### + //! An output archive designed to save data in a compact binary representation portable over different architectures + /*! This archive outputs data to a stream in an extremely compact binary + representation with as little extra metadata as possible. + + This archive will record the endianness of the data as well as the desired in/out endianness + and assuming that the user takes care of ensuring serialized types are the same size + across machines, is portable over different architectures. + + When using a binary archive and a file stream, you must use the + std::ios::binary format flag to avoid having your data altered + inadvertently. + + \warning This archive has not been thoroughly tested across different architectures. + Please report any issues, optimizations, or feature requests at + the project github. + + \ingroup Archives */ + class PortableBinaryOutputArchive : public OutputArchive + { + public: + //! A class containing various advanced options for the PortableBinaryOutput archive + class Options + { + public: + //! Represents desired endianness + enum class Endianness : std::uint8_t + { big, little }; + + //! Default options, preserve system endianness + static Options Default(){ return Options(); } + + //! Save as little endian + static Options LittleEndian(){ return Options( Endianness::little ); } + + //! Save as big endian + static Options BigEndian(){ return Options( Endianness::big ); } + + //! Specify specific options for the PortableBinaryOutputArchive + /*! @param outputEndian The desired endianness of saved (output) data */ + explicit Options( Endianness outputEndian = getEndianness() ) : + itsOutputEndianness( outputEndian ) { } + + private: + //! Gets the endianness of the system + inline static Endianness getEndianness() + { return portable_binary_detail::is_little_endian() ? Endianness::little : Endianness::big; } + + //! Checks if Options is set for little endian + inline std::uint8_t is_little_endian() const + { return itsOutputEndianness == Endianness::little; } + + friend class PortableBinaryOutputArchive; + Endianness itsOutputEndianness; + }; + + //! Construct, outputting to the provided stream + /*! @param stream The stream to output to. Should be opened with std::ios::binary flag. + @param options The PortableBinary specific options to use. See the Options struct + for the values of default parameters */ + PortableBinaryOutputArchive(std::ostream & stream, Options const & options = Options::Default()) : + OutputArchive(this), + itsStream(stream), + itsConvertEndianness( portable_binary_detail::is_little_endian() ^ options.is_little_endian() ) + { + this->operator()( options.is_little_endian() ); + } + + ~PortableBinaryOutputArchive() CEREAL_NOEXCEPT = default; + + //! Writes size bytes of data to the output stream + template inline + void saveBinary( const void * data, std::streamsize size ) + { + std::streamsize writtenSize = 0; + + if( itsConvertEndianness ) + { + for( std::streamsize i = 0; i < size; i += DataSize ) + for( std::streamsize j = 0; j < DataSize; ++j ) + writtenSize += itsStream.rdbuf()->sputn( reinterpret_cast( data ) + DataSize - j - 1 + i, 1 ); + } + else + writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); + + if(writtenSize != size) + throw Exception("Failed to write " + std::to_string(size) + " bytes to output stream! Wrote " + std::to_string(writtenSize)); + } + + private: + std::ostream & itsStream; + const uint8_t itsConvertEndianness; //!< If set to true, we will need to swap bytes upon saving + }; + + // ###################################################################### + //! An input archive designed to load data saved using PortableBinaryOutputArchive + /*! This archive outputs data to a stream in an extremely compact binary + representation with as little extra metadata as possible. + + This archive will load the endianness of the serialized data and + if necessary transform it to match that of the local machine. This comes + at a significant performance cost compared to non portable archives if + the transformation is necessary, and also causes a small performance hit + even if it is not necessary. + + It is recommended to use portable archives only if you know that you will + be sending binary data to machines with different endianness. + + The archive will do nothing to ensure types are the same size - that is + the responsibility of the user. + + When using a binary archive and a file stream, you must use the + std::ios::binary format flag to avoid having your data altered + inadvertently. + + \warning This archive has not been thoroughly tested across different architectures. + Please report any issues, optimizations, or feature requests at + the project github. + + \ingroup Archives */ + class PortableBinaryInputArchive : public InputArchive + { + public: + //! A class containing various advanced options for the PortableBinaryInput archive + class Options + { + public: + //! Represents desired endianness + enum class Endianness : std::uint8_t + { big, little }; + + //! Default options, preserve system endianness + static Options Default(){ return Options(); } + + //! Load into little endian + static Options LittleEndian(){ return Options( Endianness::little ); } + + //! Load into big endian + static Options BigEndian(){ return Options( Endianness::big ); } + + //! Specify specific options for the PortableBinaryInputArchive + /*! @param inputEndian The desired endianness of loaded (input) data */ + explicit Options( Endianness inputEndian = getEndianness() ) : + itsInputEndianness( inputEndian ) { } + + private: + //! Gets the endianness of the system + inline static Endianness getEndianness() + { return portable_binary_detail::is_little_endian() ? Endianness::little : Endianness::big; } + + //! Checks if Options is set for little endian + inline std::uint8_t is_little_endian() const + { return itsInputEndianness == Endianness::little; } + + friend class PortableBinaryInputArchive; + Endianness itsInputEndianness; + }; + + //! Construct, loading from the provided stream + /*! @param stream The stream to read from. Should be opened with std::ios::binary flag. + @param options The PortableBinary specific options to use. See the Options struct + for the values of default parameters */ + PortableBinaryInputArchive(std::istream & stream, Options const & options = Options::Default()) : + InputArchive(this), + itsStream(stream), + itsConvertEndianness( false ) + { + uint8_t streamLittleEndian; + this->operator()( streamLittleEndian ); + itsConvertEndianness = options.is_little_endian() ^ streamLittleEndian; + } + + ~PortableBinaryInputArchive() CEREAL_NOEXCEPT = default; + + //! Reads size bytes of data from the input stream + /*! @param data The data to save + @param size The number of bytes in the data + @tparam DataSize T The size of the actual type of the data elements being loaded */ + template inline + void loadBinary( void * const data, std::streamsize size ) + { + // load data + auto const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); + + if(readSize != size) + throw Exception("Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize)); + + // flip bits if needed + if( itsConvertEndianness ) + { + std::uint8_t * ptr = reinterpret_cast( data ); + for( std::streamsize i = 0; i < size; i += DataSize ) + portable_binary_detail::swap_bytes( ptr + i ); + } + } + + private: + std::istream & itsStream; + uint8_t itsConvertEndianness; //!< If set to true, we will need to swap bytes upon loading + }; + + // ###################################################################### + // Common BinaryArchive serialization functions + + //! Saving for POD types to portable binary + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME(PortableBinaryOutputArchive & ar, T const & t) + { + static_assert( !std::is_floating_point::value || + (std::is_floating_point::value && std::numeric_limits::is_iec559), + "Portable binary only supports IEEE 754 standardized floating point" ); + ar.template saveBinary(std::addressof(t), sizeof(t)); + } + + //! Loading for POD types from portable binary + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME(PortableBinaryInputArchive & ar, T & t) + { + static_assert( !std::is_floating_point::value || + (std::is_floating_point::value && std::numeric_limits::is_iec559), + "Portable binary only supports IEEE 754 standardized floating point" ); + ar.template loadBinary(std::addressof(t), sizeof(t)); + } + + //! Serializing NVP types to portable binary + template inline + CEREAL_ARCHIVE_RESTRICT(PortableBinaryInputArchive, PortableBinaryOutputArchive) + CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, NameValuePair & t ) + { + ar( t.value ); + } + + //! Serializing SizeTags to portable binary + template inline + CEREAL_ARCHIVE_RESTRICT(PortableBinaryInputArchive, PortableBinaryOutputArchive) + CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, SizeTag & t ) + { + ar( t.size ); + } + + //! Saving binary data to portable binary + template inline + void CEREAL_SAVE_FUNCTION_NAME(PortableBinaryOutputArchive & ar, BinaryData const & bd) + { + typedef typename std::remove_pointer::type TT; + static_assert( !std::is_floating_point::value || + (std::is_floating_point::value && std::numeric_limits::is_iec559), + "Portable binary only supports IEEE 754 standardized floating point" ); + + ar.template saveBinary( bd.data, static_cast( bd.size ) ); + } + + //! Loading binary data from portable binary + template inline + void CEREAL_LOAD_FUNCTION_NAME(PortableBinaryInputArchive & ar, BinaryData & bd) + { + typedef typename std::remove_pointer::type TT; + static_assert( !std::is_floating_point::value || + (std::is_floating_point::value && std::numeric_limits::is_iec559), + "Portable binary only supports IEEE 754 standardized floating point" ); + + ar.template loadBinary( bd.data, static_cast( bd.size ) ); + } +} // namespace cereal + +// register archives for polymorphic support +CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryInputArchive) + +// tie input and output archives together +CEREAL_SETUP_ARCHIVE_TRAITS(cereal::PortableBinaryInputArchive, cereal::PortableBinaryOutputArchive) + +#endif // CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/xml.hpp b/cpp/src/cylon/thridparty/cereal/archives/xml.hpp new file mode 100644 index 000000000..cfdada27d --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/archives/xml.hpp @@ -0,0 +1,956 @@ +/*! \file xml.hpp + \brief XML input and output archives */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_ARCHIVES_XML_HPP_ +#define CEREAL_ARCHIVES_XML_HPP_ +#include "cylon/thridparty/cereal/cereal.hpp" +#include "cylon/thridparty/cereal/details/util.hpp" + +#include "cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp" +#include "cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp" +#include "cylon/thridparty/cereal/external/base64.hpp" + +#include +#include +#include +#include +#include +#include +#include + +namespace cereal +{ + namespace xml_detail + { + #ifndef CEREAL_XML_STRING_VALUE + //! The default name for the root node in a cereal xml archive. + /*! You can define CEREAL_XML_STRING_VALUE to be different assuming you do so + before this file is included. */ + #define CEREAL_XML_STRING_VALUE "cereal" + #endif // CEREAL_XML_STRING_VALUE + + //! The name given to the root node in a cereal xml archive + static const char * CEREAL_XML_STRING = CEREAL_XML_STRING_VALUE; + + //! Returns true if the character is whitespace + inline bool isWhitespace( char c ) + { + return c == ' ' || c == '\t' || c == '\n' || c == '\r'; + } + } + + // ###################################################################### + //! An output archive designed to save data to XML + /*! This archive uses RapidXML to build an in memory XML tree of the + data it serializes before outputting it to its stream upon destruction. + This archive should be used in an RAII fashion, letting + the automatic destruction of the object cause the flush to its stream. + + XML archives provides a human readable output but at decreased + performance (both in time and space) compared to binary archives. + + XML benefits greatly from name-value pairs, which if present, will + name the nodes in the output. If these are not present, each level + of the output tree will be given an automatically generated delimited name. + + The precision of the output archive controls the number of decimals output + for floating point numbers and should be sufficiently large (i.e. at least 20) + if there is a desire to have binary equality between the numbers output and + those read in. In general you should expect a loss of precision when going + from floating point to text and back. + + XML archives can optionally print the type of everything they serialize, which + adds an attribute to each node. + + XML archives do not output the size information for any dynamically sized structure + and instead infer it from the number of children for a node. This means that data + can be hand edited for dynamic sized structures and will still be readable. This + is accomplished through the cereal::SizeTag object, which will also add an attribute + to its parent field. + \ingroup Archives */ + class XMLOutputArchive : public OutputArchive, public traits::TextArchive + { + public: + /*! @name Common Functionality + Common use cases for directly interacting with an XMLOutputArchive */ + //! @{ + + //! A class containing various advanced options for the XML archive + /*! Options can either be directly passed to the constructor, or chained using the + modifier functions for an interface analogous to named parameters */ + class Options + { + public: + //! Default options + static Options Default(){ return Options(); } + + //! Specify specific options for the XMLOutputArchive + /*! @param precision_ The precision used for floating point numbers + @param indent_ Whether to indent each line of XML + @param outputType_ Whether to output the type of each serialized object as an attribute + @param sizeAttributes_ Whether dynamically sized containers output the size=dynamic attribute */ + explicit Options( int precision_ = std::numeric_limits::max_digits10, + bool indent_ = true, + bool outputType_ = false, + bool sizeAttributes_ = true ) : + itsPrecision( precision_ ), + itsIndent( indent_ ), + itsOutputType( outputType_ ), + itsSizeAttributes( sizeAttributes_ ) + { } + + /*! @name Option Modifiers + An interface for setting option settings analogous to named parameters. + + @code{cpp} + cereal::XMLOutputArchive ar( myStream, + cereal::XMLOutputArchive::Options() + .indent(true) + .sizeAttributes(false) ); + @endcode + */ + //! @{ + + //! Sets the precision used for floating point numbers + Options & precision( int value ){ itsPrecision = value; return * this; } + //! Whether to indent each line of XML + Options & indent( bool enable ){ itsIndent = enable; return *this; } + //! Whether to output the type of each serialized object as an attribute + Options & outputType( bool enable ){ itsOutputType = enable; return *this; } + //! Whether dynamically sized containers (e.g. vector) output the size=dynamic attribute + Options & sizeAttributes( bool enable ){ itsSizeAttributes = enable; return *this; } + + //! @} + + private: + friend class XMLOutputArchive; + int itsPrecision; + bool itsIndent; + bool itsOutputType; + bool itsSizeAttributes; + }; + + //! Construct, outputting to the provided stream upon destruction + /*! @param stream The stream to output to. Note that XML is only guaranteed to flush + its output to the stream upon destruction. + @param options The XML specific options to use. See the Options struct + for the values of default parameters */ + XMLOutputArchive( std::ostream & stream, Options const & options = Options::Default() ) : + OutputArchive(this), + itsStream(stream), + itsOutputType( options.itsOutputType ), + itsIndent( options.itsIndent ), + itsSizeAttributes(options.itsSizeAttributes) + { + // rapidxml will delete all allocations when xml_document is cleared + auto node = itsXML.allocate_node( rapidxml::node_declaration ); + node->append_attribute( itsXML.allocate_attribute( "version", "1.0" ) ); + node->append_attribute( itsXML.allocate_attribute( "encoding", "utf-8" ) ); + itsXML.append_node( node ); + + // allocate root node + auto root = itsXML.allocate_node( rapidxml::node_element, xml_detail::CEREAL_XML_STRING ); + itsXML.append_node( root ); + itsNodes.emplace( root ); + + // set attributes on the streams + itsStream << std::boolalpha; + itsStream.precision( options.itsPrecision ); + itsOS << std::boolalpha; + itsOS.precision( options.itsPrecision ); + } + + //! Destructor, flushes the XML + ~XMLOutputArchive() CEREAL_NOEXCEPT + { + const int flags = itsIndent ? 0x0 : rapidxml::print_no_indenting; + rapidxml::print( itsStream, itsXML, flags ); + itsXML.clear(); + } + + //! Saves some binary data, encoded as a base64 string, with an optional name + /*! This can be called directly by users and it will automatically create a child node for + the current XML node, populate it with a base64 encoded string, and optionally name + it. The node will be finished after it has been populated. */ + void saveBinaryValue( const void * data, size_t size, const char * name = nullptr ) + { + itsNodes.top().name = name; + + startNode(); + + auto base64string = base64::encode( reinterpret_cast( data ), size ); + saveValue( base64string ); + + if( itsOutputType ) + itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "type", "cereal binary data" ) ); + + finishNode(); + } + + //! @} + /*! @name Internal Functionality + Functionality designed for use by those requiring control over the inner mechanisms of + the XMLOutputArchive */ + //! @{ + + //! Creates a new node that is a child of the node at the top of the stack + /*! Nodes will be given a name that has either been pre-set by a name value pair, + or generated based upon a counter unique to the parent node. If you want to + give a node a specific name, use setNextName prior to calling startNode. + + The node will then be pushed onto the node stack. */ + void startNode() + { + // generate a name for this new node + const auto nameString = itsNodes.top().getValueName(); + + // allocate strings for all of the data in the XML object + auto namePtr = itsXML.allocate_string( nameString.data(), nameString.length() + 1 ); + + // insert into the XML + auto node = itsXML.allocate_node( rapidxml::node_element, namePtr, nullptr, nameString.size() ); + itsNodes.top().node->append_node( node ); + itsNodes.emplace( node ); + } + + //! Designates the most recently added node as finished + void finishNode() + { + itsNodes.pop(); + } + + //! Sets the name for the next node created with startNode + void setNextName( const char * name ) + { + itsNodes.top().name = name; + } + + //! Saves some data, encoded as a string, into the current top level node + /*! The data will be be named with the most recent name if one exists, + otherwise it will be given some default delimited value that depends upon + the parent node */ + template inline + void saveValue( T const & value ) + { + itsOS.clear(); itsOS.seekp( 0, std::ios::beg ); + itsOS << value << std::ends; + + auto strValue = itsOS.str(); + + // itsOS.str() may contain data from previous calls after the first '\0' that was just inserted + // and this data is counted in the length call. We make sure to remove that section so that the + // whitespace validation is done properly + strValue.resize(std::strlen(strValue.c_str())); + + // If the first or last character is a whitespace, add xml:space attribute + const auto len = strValue.length(); + if ( len > 0 && ( xml_detail::isWhitespace( strValue[0] ) || xml_detail::isWhitespace( strValue[len - 1] ) ) ) + { + itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "xml:space", "preserve" ) ); + } + + // allocate strings for all of the data in the XML object + auto dataPtr = itsXML.allocate_string(strValue.c_str(), strValue.length() + 1 ); + + // insert into the XML + itsNodes.top().node->append_node( itsXML.allocate_node( rapidxml::node_data, nullptr, dataPtr ) ); + } + + //! Overload for uint8_t prevents them from being serialized as characters + void saveValue( uint8_t const & value ) + { + saveValue( static_cast( value ) ); + } + + //! Overload for int8_t prevents them from being serialized as characters + void saveValue( int8_t const & value ) + { + saveValue( static_cast( value ) ); + } + + //! Causes the type to be appended as an attribute to the most recently made node if output type is set to true + template inline + void insertType() + { + if( !itsOutputType ) + return; + + // generate a name for this new node + const auto nameString = util::demangledName(); + + // allocate strings for all of the data in the XML object + auto namePtr = itsXML.allocate_string( nameString.data(), nameString.length() + 1 ); + + itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "type", namePtr ) ); + } + + //! Appends an attribute to the current top level node + void appendAttribute( const char * name, const char * value ) + { + auto namePtr = itsXML.allocate_string( name ); + auto valuePtr = itsXML.allocate_string( value ); + itsNodes.top().node->append_attribute( itsXML.allocate_attribute( namePtr, valuePtr ) ); + } + + bool hasSizeAttributes() const { return itsSizeAttributes; } + + protected: + //! A struct that contains metadata about a node + struct NodeInfo + { + NodeInfo( rapidxml::xml_node<> * n = nullptr, + const char * nm = nullptr ) : + node( n ), + counter( 0 ), + name( nm ) + { } + + rapidxml::xml_node<> * node; //!< A pointer to this node + size_t counter; //!< The counter for naming child nodes + const char * name; //!< The name for the next child node + + //! Gets the name for the next child node created from this node + /*! The name will be automatically generated using the counter if + a name has not been previously set. If a name has been previously + set, that name will be returned only once */ + std::string getValueName() + { + if( name ) + { + auto n = name; + name = nullptr; + return {n}; + } + else + return "value" + std::to_string( counter++ ) + "\0"; + } + }; // NodeInfo + + //! @} + + private: + std::ostream & itsStream; //!< The output stream + rapidxml::xml_document<> itsXML; //!< The XML document + std::stack itsNodes; //!< A stack of nodes added to the document + std::ostringstream itsOS; //!< Used to format strings internally + bool itsOutputType; //!< Controls whether type information is printed + bool itsIndent; //!< Controls whether indenting is used + bool itsSizeAttributes; //!< Controls whether lists have a size attribute + }; // XMLOutputArchive + + // ###################################################################### + //! An output archive designed to load data from XML + /*! This archive uses RapidXML to build an in memory XML tree of the + data in the stream it is given before loading any types serialized. + + As with the output XML archive, the preferred way to use this archive is in + an RAII fashion, ensuring its destruction after all data has been read. + + Input XML should have been produced by the XMLOutputArchive. Data can + only be added to dynamically sized containers - the input archive will + determine their size by looking at the number of child nodes. Data that + did not originate from an XMLOutputArchive is not officially supported, + but may be possible to use if properly formatted. + + The XMLInputArchive does not require that nodes are loaded in the same + order they were saved by XMLOutputArchive. Using name value pairs (NVPs), + it is possible to load in an out of order fashion or otherwise skip/select + specific nodes to load. + + The default behavior of the input archive is to read sequentially starting + with the first node and exploring its children. When a given NVP does + not match the read in name for a node, the archive will search for that + node at the current level and load it if it exists. After loading an out of + order node, the archive will then proceed back to loading sequentially from + its new position. + + Consider this simple example where loading of some data is skipped: + + @code{cpp} + // imagine the input file has someData(1-9) saved in order at the top level node + ar( someData1, someData2, someData3 ); // XML loads in the order it sees in the file + ar( cereal::make_nvp( "hello", someData6 ) ); // NVP given does not + // match expected NVP name, so we search + // for the given NVP and load that value + ar( someData7, someData8, someData9 ); // with no NVP given, loading resumes at its + // current location, proceeding sequentially + @endcode + + \ingroup Archives */ + class XMLInputArchive : public InputArchive, public traits::TextArchive + { + public: + /*! @name Common Functionality + Common use cases for directly interacting with an XMLInputArchive */ + //! @{ + + //! Construct, reading in from the provided stream + /*! Reads in an entire XML document from some stream and parses it as soon + as serialization starts + + @param stream The stream to read from. Can be a stringstream or a file. */ + XMLInputArchive( std::istream & stream ) : + InputArchive( this ), + itsData( std::istreambuf_iterator( stream ), std::istreambuf_iterator() ) + { + try + { + itsData.push_back('\0'); // rapidxml will do terrible things without the data being null terminated + itsXML.parse( reinterpret_cast( itsData.data() ) ); + } + catch( rapidxml::parse_error const & ) + { + //std::cerr << "-----Original-----" << std::endl; + //stream.seekg(0); + //std::cout << std::string( std::istreambuf_iterator( stream ), std::istreambuf_iterator() ) << std::endl; + + //std::cerr << "-----Error-----" << std::endl; + //std::cerr << e.what() << std::endl; + //std::cerr << e.where() << std::endl; + throw Exception("XML Parsing failed - likely due to invalid characters or invalid naming"); + } + + // Parse the root + auto root = itsXML.first_node( xml_detail::CEREAL_XML_STRING ); + if( root == nullptr ) + throw Exception("Could not detect cereal root node - likely due to empty or invalid input"); + else + itsNodes.emplace( root ); + } + + ~XMLInputArchive() CEREAL_NOEXCEPT = default; + + //! Loads some binary data, encoded as a base64 string, optionally specified by some name + /*! This will automatically start and finish a node to load the data, and can be called directly by + users. + + Note that this follows the same ordering rules specified in the class description in regards + to loading in/out of order */ + void loadBinaryValue( void * data, size_t size, const char * name = nullptr ) + { + setNextName( name ); + startNode(); + + std::string encoded; + loadValue( encoded ); + + auto decoded = base64::decode( encoded ); + + if( size != decoded.size() ) + throw Exception("Decoded binary data size does not match specified size"); + + std::memcpy( data, decoded.data(), decoded.size() ); + + finishNode(); + } + + //! @} + /*! @name Internal Functionality + Functionality designed for use by those requiring control over the inner mechanisms of + the XMLInputArchive */ + //! @{ + + //! Prepares to start reading the next node + /*! This places the next node to be parsed onto the nodes stack. + + By default our strategy is to start with the document root node and then + recursively iterate through all children in the order they show up in the document. + We don't need to know NVPs do to this; we'll just blindly load in the order things appear in. + + We check to see if the specified NVP matches what the next automatically loaded node is. If they + match, we just continue as normal, going in order. If they don't match, we attempt to find a node + named after the NVP that is being loaded. If that NVP does not exist, we throw an exception. */ + void startNode() + { + auto next = itsNodes.top().child; // By default we would move to the next child node + auto const expectedName = itsNodes.top().name; // this is the expected name from the NVP, if provided + + // If we were given an NVP name, look for it in the current level of the document. + // We only need to do this if either we have exhausted the siblings of the current level or + // the NVP name does not match the name of the node we would normally read next + if( expectedName && ( next == nullptr || std::strcmp( next->name(), expectedName ) != 0 ) ) + { + next = itsNodes.top().search( expectedName ); + + if( next == nullptr ) + throw Exception("XML Parsing failed - provided NVP (" + std::string(expectedName) + ") not found"); + } + + itsNodes.emplace( next ); + } + + //! Finishes reading the current node + void finishNode() + { + // remove current + itsNodes.pop(); + + // advance parent + itsNodes.top().advance(); + + // Reset name + itsNodes.top().name = nullptr; + } + + //! Retrieves the current node name + //! will return @c nullptr if the node does not have a name + const char * getNodeName() const + { + return itsNodes.top().getChildName(); + } + + //! Sets the name for the next node created with startNode + void setNextName( const char * name ) + { + itsNodes.top().name = name; + } + + //! Loads a bool from the current top node + template ::value, + std::is_same::value> = traits::sfinae> inline + void loadValue( T & value ) + { + std::istringstream is( itsNodes.top().node->value() ); + is.setf( std::ios::boolalpha ); + is >> value; + } + + //! Loads a char (signed or unsigned) from the current top node + template ::value, + !std::is_same::value, + sizeof(T) == sizeof(char)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = *reinterpret_cast( itsNodes.top().node->value() ); + } + + //! Load an int8_t from the current top node (ensures we parse entire number) + void loadValue( int8_t & value ) + { + int32_t val; loadValue( val ); value = static_cast( val ); + } + + //! Load a uint8_t from the current top node (ensures we parse entire number) + void loadValue( uint8_t & value ) + { + uint32_t val; loadValue( val ); value = static_cast( val ); + } + + //! Loads a type best represented as an unsigned long from the current top node + template ::value, + !std::is_same::value, + !std::is_same::value, + !std::is_same::value, + sizeof(T) < sizeof(long long)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = static_cast( std::stoul( itsNodes.top().node->value() ) ); + } + + //! Loads a type best represented as an unsigned long long from the current top node + template ::value, + !std::is_same::value, + sizeof(T) >= sizeof(long long)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = static_cast( std::stoull( itsNodes.top().node->value() ) ); + } + + //! Loads a type best represented as an int from the current top node + template ::value, + !std::is_same::value, + sizeof(T) <= sizeof(int)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = static_cast( std::stoi( itsNodes.top().node->value() ) ); + } + + //! Loads a type best represented as a long from the current top node + template ::value, + (sizeof(T) > sizeof(int)), + sizeof(T) <= sizeof(long)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = static_cast( std::stol( itsNodes.top().node->value() ) ); + } + + //! Loads a type best represented as a long long from the current top node + template ::value, + (sizeof(T) > sizeof(long)), + sizeof(T) <= sizeof(long long)> = traits::sfinae> inline + void loadValue( T & value ) + { + value = static_cast( std::stoll( itsNodes.top().node->value() ) ); + } + + //! Loads a type best represented as a float from the current top node + void loadValue( float & value ) + { + try + { + value = std::stof( itsNodes.top().node->value() ); + } + catch( std::out_of_range const & ) + { + // special case for denormalized values + std::istringstream is( itsNodes.top().node->value() ); + is >> value; + if( std::fpclassify( value ) != FP_SUBNORMAL ) + throw; + } + } + + //! Loads a type best represented as a double from the current top node + void loadValue( double & value ) + { + try + { + value = std::stod( itsNodes.top().node->value() ); + } + catch( std::out_of_range const & ) + { + // special case for denormalized values + std::istringstream is( itsNodes.top().node->value() ); + is >> value; + if( std::fpclassify( value ) != FP_SUBNORMAL ) + throw; + } + } + + //! Loads a type best represented as a long double from the current top node + void loadValue( long double & value ) + { + try + { + value = std::stold( itsNodes.top().node->value() ); + } + catch( std::out_of_range const & ) + { + // special case for denormalized values + std::istringstream is( itsNodes.top().node->value() ); + is >> value; + if( std::fpclassify( value ) != FP_SUBNORMAL ) + throw; + } + } + + //! Loads a string from the current node from the current top node + template inline + void loadValue( std::basic_string & str ) + { + std::basic_istringstream is( itsNodes.top().node->value() ); + + str.assign( std::istreambuf_iterator( is ), + std::istreambuf_iterator() ); + } + + //! Loads the size of the current top node + template inline + void loadSize( T & value ) + { + value = getNumChildren( itsNodes.top().node ); + } + + protected: + //! Gets the number of children (usually interpreted as size) for the specified node + static size_t getNumChildren( rapidxml::xml_node<> * node ) + { + size_t size = 0; + node = node->first_node(); // get first child + + while( node != nullptr ) + { + ++size; + node = node->next_sibling(); + } + + return size; + } + + //! A struct that contains metadata about a node + /*! Keeps track of some top level node, its number of + remaining children, and the current active child node */ + struct NodeInfo + { + NodeInfo( rapidxml::xml_node<> * n = nullptr ) : + node( n ), + child( n->first_node() ), + size( XMLInputArchive::getNumChildren( n ) ), + name( nullptr ) + { } + + //! Advances to the next sibling node of the child + /*! If this is the last sibling child will be null after calling */ + void advance() + { + if( size > 0 ) + { + --size; + child = child->next_sibling(); + } + } + + //! Searches for a child with the given name in this node + /*! @param searchName The name to search for (must be null terminated) + @return The node if found, nullptr otherwise */ + rapidxml::xml_node<> * search( const char * searchName ) + { + if( searchName ) + { + size_t new_size = XMLInputArchive::getNumChildren( node ); + const size_t name_size = rapidxml::internal::measure( searchName ); + + for( auto new_child = node->first_node(); new_child != nullptr; new_child = new_child->next_sibling() ) + { + if( rapidxml::internal::compare( new_child->name(), new_child->name_size(), searchName, name_size, true ) ) + { + size = new_size; + child = new_child; + + return new_child; + } + --new_size; + } + } + + return nullptr; + } + + //! Returns the actual name of the next child node, if it exists + const char * getChildName() const + { + return child ? child->name() : nullptr; + } + + rapidxml::xml_node<> * node; //!< A pointer to this node + rapidxml::xml_node<> * child; //!< A pointer to its current child + size_t size; //!< The remaining number of children for this node + const char * name; //!< The NVP name for next child node + }; // NodeInfo + + //! @} + + private: + std::vector itsData; //!< The raw data loaded + rapidxml::xml_document<> itsXML; //!< The XML document + std::stack itsNodes; //!< A stack of nodes read from the document + }; + + // ###################################################################### + // XMLArchive prologue and epilogue functions + // ###################################################################### + + // ###################################################################### + //! Prologue for NVPs for XML output archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void prologue( XMLOutputArchive &, NameValuePair const & ) + { } + + //! Prologue for NVPs for XML input archives + template inline + void prologue( XMLInputArchive &, NameValuePair const & ) + { } + + // ###################################################################### + //! Epilogue for NVPs for XML output archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void epilogue( XMLOutputArchive &, NameValuePair const & ) + { } + + //! Epilogue for NVPs for XML input archives + template inline + void epilogue( XMLInputArchive &, NameValuePair const & ) + { } + + // ###################################################################### + //! Prologue for deferred data for XML archives + /*! Do nothing for the defer wrapper */ + template inline + void prologue( XMLOutputArchive &, DeferredData const & ) + { } + + //! Prologue for deferred data for XML archives + template inline + void prologue( XMLInputArchive &, DeferredData const & ) + { } + + // ###################################################################### + //! Epilogue for deferred for XML archives + /*! NVPs do not start or finish nodes - they just set up the names */ + template inline + void epilogue( XMLOutputArchive &, DeferredData const & ) + { } + + //! Epilogue for deferred for XML archives + /*! Do nothing for the defer wrapper */ + template inline + void epilogue( XMLInputArchive &, DeferredData const & ) + { } + + // ###################################################################### + //! Prologue for SizeTags for XML output archives + /*! SizeTags do not start or finish nodes */ + template inline + void prologue( XMLOutputArchive & ar, SizeTag const & ) + { + if (ar.hasSizeAttributes()) + { + ar.appendAttribute("size", "dynamic"); + } + } + + template inline + void prologue( XMLInputArchive &, SizeTag const & ) + { } + + //! Epilogue for SizeTags for XML output archives + /*! SizeTags do not start or finish nodes */ + template inline + void epilogue( XMLOutputArchive &, SizeTag const & ) + { } + + template inline + void epilogue( XMLInputArchive &, SizeTag const & ) + { } + + // ###################################################################### + //! Prologue for all other types for XML output archives (except minimal types) + /*! Starts a new node, named either automatically or by some NVP, + that may be given data by the type about to be archived + + Minimal types do not start or end nodes */ + template ::value || + traits::has_minimal_output_serialization::value> = traits::sfinae> inline + void prologue( XMLOutputArchive & ar, T const & ) + { + ar.startNode(); + ar.insertType(); + } + + //! Prologue for all other types for XML input archives (except minimal types) + template ::value || + traits::has_minimal_input_serialization::value> = traits::sfinae> inline + void prologue( XMLInputArchive & ar, T const & ) + { + ar.startNode(); + } + + // ###################################################################### + //! Epilogue for all other types other for XML output archives (except minimal types) + /*! Finishes the node created in the prologue + + Minimal types do not start or end nodes */ + template ::value || + traits::has_minimal_output_serialization::value> = traits::sfinae> inline + void epilogue( XMLOutputArchive & ar, T const & ) + { + ar.finishNode(); + } + + //! Epilogue for all other types other for XML output archives (except minimal types) + template ::value || + traits::has_minimal_input_serialization::value> = traits::sfinae> inline + void epilogue( XMLInputArchive & ar, T const & ) + { + ar.finishNode(); + } + + // ###################################################################### + // Common XMLArchive serialization functions + // ###################################################################### + + //! Saving NVP types to XML + template inline + void CEREAL_SAVE_FUNCTION_NAME( XMLOutputArchive & ar, NameValuePair const & t ) + { + ar.setNextName( t.name ); + ar( t.value ); + } + + //! Loading NVP types from XML + template inline + void CEREAL_LOAD_FUNCTION_NAME( XMLInputArchive & ar, NameValuePair & t ) + { + ar.setNextName( t.name ); + ar( t.value ); + } + + // ###################################################################### + //! Saving SizeTags to XML + template inline + void CEREAL_SAVE_FUNCTION_NAME( XMLOutputArchive &, SizeTag const & ) + { } + + //! Loading SizeTags from XML + template inline + void CEREAL_LOAD_FUNCTION_NAME( XMLInputArchive & ar, SizeTag & st ) + { + ar.loadSize( st.size ); + } + + // ###################################################################### + //! Saving for POD types to xml + template ::value> = traits::sfinae> inline + void CEREAL_SAVE_FUNCTION_NAME(XMLOutputArchive & ar, T const & t) + { + ar.saveValue( t ); + } + + //! Loading for POD types from xml + template ::value> = traits::sfinae> inline + void CEREAL_LOAD_FUNCTION_NAME(XMLInputArchive & ar, T & t) + { + ar.loadValue( t ); + } + + // ###################################################################### + //! saving string to xml + template inline + void CEREAL_SAVE_FUNCTION_NAME(XMLOutputArchive & ar, std::basic_string const & str) + { + ar.saveValue( str ); + } + + //! loading string from xml + template inline + void CEREAL_LOAD_FUNCTION_NAME(XMLInputArchive & ar, std::basic_string & str) + { + ar.loadValue( str ); + } +} // namespace cereal + +// register archives for polymorphic support +CEREAL_REGISTER_ARCHIVE(cereal::XMLOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::XMLInputArchive) + +// tie input and output archives together +CEREAL_SETUP_ARCHIVE_TRAITS(cereal::XMLInputArchive, cereal::XMLOutputArchive) + +#endif // CEREAL_ARCHIVES_XML_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/cereal.hpp b/cpp/src/cylon/thridparty/cereal/cereal.hpp new file mode 100644 index 000000000..6a36e357f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/cereal.hpp @@ -0,0 +1,1120 @@ +/*! \file cereal.hpp + \brief Main cereal functionality */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_CEREAL_HPP_ +#define CEREAL_CEREAL_HPP_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cylon/thridparty/cereal/macros.hpp" +#include "cylon/thridparty/cereal/details/traits.hpp" +#include "cylon/thridparty/cereal/details/helpers.hpp" +#include "cylon/thridparty/cereal/types/base_class.hpp" + +namespace cereal +{ + // ###################################################################### + //! Creates a name value pair + /*! @relates NameValuePair + @ingroup Utility */ + template inline + NameValuePair make_nvp( std::string const & name, T && value ) + { + return {name.c_str(), std::forward(value)}; + } + + //! Creates a name value pair + /*! @relates NameValuePair + @ingroup Utility */ + template inline + NameValuePair make_nvp( const char * name, T && value ) + { + return {name, std::forward(value)}; + } + + //! Creates a name value pair for the variable T with the same name as the variable + /*! @relates NameValuePair + @ingroup Utility */ + #define CEREAL_NVP(T) ::cereal::make_nvp(#T, T) + + // ###################################################################### + //! Convenience function to create binary data for both const and non const pointers + /*! @param data Pointer to beginning of the data + @param size The size in bytes of the data + @relates BinaryData + @ingroup Utility */ + template inline + BinaryData binary_data( T && data, size_t size ) + { + return {std::forward(data), size}; + } + + // ###################################################################### + //! Creates a size tag from some variable. + /*! Will normally be used to serialize size (e.g. size()) information for + variable size containers. If you have a variable sized container, + the very first thing it serializes should be its size, wrapped in + a SizeTag. + + @relates SizeTag + @ingroup Utility */ + template inline + SizeTag make_size_tag( T && sz ) + { + return {std::forward(sz)}; + } + + // ###################################################################### + //! Marks data for deferred serialization + /*! cereal performs a recursive depth-first traversal of data it serializes. When + serializing smart pointers to large, nested, or cyclical data structures, it + is possible to encounter a stack overflow from excessive recursion when following + a chain of pointers. + + Deferment can help in these situations if the data can be serialized separately from + the pointers used to traverse the structure. For example, a graph structure can have its + nodes serialized before its edges: + + @code{.cpp} + struct MyEdge + { + std::shared_ptr connection; + int some_value; + + template + void serialize(Archive & archive) + { + // when we serialize an edge, we'll defer serializing the associated node + archive( cereal::defer( connection ), + some_value ); + } + }; + + struct MyGraphStructure + { + std::vector edges; + std::vector nodes; + + template + void serialize(Archive & archive) + { + // because of the deferment, we ensure all nodes are fully serialized + // before any connection pointers to those nodes are serialized + archive( edges, nodes ); + + // we have to explicitly inform the archive when it is safe to serialize + // the deferred data + archive.serializeDeferments(); + } + }; + @endcode + + @relates DeferredData + @ingroup Utility */ + template inline + DeferredData defer( T && value ) + { + return {std::forward(value)}; + } + + // ###################################################################### + //! Called before a type is serialized to set up any special archive state + //! for processing some type + /*! If designing a serializer that needs to set up any kind of special + state or output extra information for a type, specialize this function + for the archive type and the types that require the extra information. + @ingroup Internal */ + template inline + void prologue( Archive & /* archive */, T const & /* data */) + { } + + //! Called after a type is serialized to tear down any special archive state + //! for processing some type + /*! @ingroup Internal */ + template inline + void epilogue( Archive & /* archive */, T const & /* data */) + { } + + // ###################################################################### + //! Special flags for archives + /*! AllowEmptyClassElision + This allows for empty classes to be serialized even if they do not provide + a serialization function. Classes with no data members are considered to be + empty. Be warned that if this is enabled and you attempt to serialize an + empty class with improperly formed serialize or load/save functions, no + static error will occur - the error will propagate silently and your + intended serialization functions may not be called. You can manually + ensure that your classes that have custom serialization are correct + by using the traits is_output_serializable and is_input_serializable + in cereal/details/traits.hpp. + @ingroup Internal */ + enum Flags { AllowEmptyClassElision = 1 }; + + // ###################################################################### + //! Registers a specific Archive type with cereal + /*! This registration should be done once per archive. A good place to + put this is immediately following the definition of your archive. + Archive registration is only strictly necessary if you wish to + support pointers to polymorphic data types. All archives that + come with cereal are already registered. + @ingroup Internal */ + #define CEREAL_REGISTER_ARCHIVE(Archive) \ + namespace cereal { namespace detail { \ + template \ + typename polymorphic_serialization_support::type \ + instantiate_polymorphic_binding( T*, Archive*, BindingTag, adl_tag ); \ + } } /* end namespaces */ + + //! Helper macro to omit unused warning + #if defined(__GNUC__) + // GCC / clang don't want the function + #define CEREAL_UNUSED_FUNCTION + #else + #define CEREAL_UNUSED_FUNCTION static void unused() { (void)version; } + #endif + + // ###################################################################### + //! Defines a class version for some type + /*! Versioning information is optional and adds some small amount of + overhead to serialization. This overhead will occur both in terms of + space in the archive (the version information for each class will be + stored exactly once) as well as runtime (versioned serialization functions + must check to see if they need to load or store version information). + + Versioning is useful if you plan on fundamentally changing the way some + type is serialized in the future. Versioned serialization functions + cannot be used to load non-versioned data. + + By default, all types have an assumed version value of zero. By + using this macro, you may change the version number associated with + some type. cereal will then use this value as a second parameter + to your serialization functions. + + The interface for the serialization functions is nearly identical + to non-versioned serialization with the addition of a second parameter, + const std::uint32_t version, which will be supplied with the correct + version number. Serializing the version number on a save happens + automatically. + + Versioning cannot be mixed with non-versioned serialization functions. + Having both types will result result in a compile time error. Data + serialized without versioning cannot be loaded by a serialization + function with added versioning support. + + Example interface for versioning on a non-member serialize function: + + @code{cpp} + CEREAL_CLASS_VERSION( Mytype, 77 ); // register class version + + template + void serialize( Archive & ar, Mytype & t, const std::uint32_t version ) + { + // When performing a load, the version associated with the class + // is whatever it was when that data was originally serialized + // + // When we save, we'll use the version that is defined in the macro + + if( version >= some_number ) + // do this + else + // do that + } + @endcode + + Interfaces for other forms of serialization functions is similar. This + macro should be placed at global scope. + @ingroup Utility */ + + //! On C++17, define the StaticObject as inline to merge the definitions across TUs + //! This prevents multiple definition errors when this macro appears in a header file + //! included in multiple TUs. + #ifdef CEREAL_HAS_CPP17 + #define CEREAL_CLASS_VERSION(TYPE, VERSION_NUMBER) \ + namespace cereal { namespace detail { \ + template <> struct Version \ + { \ + static std::uint32_t registerVersion() \ + { \ + ::cereal::detail::StaticObject::getInstance().mapping.emplace( \ + std::type_index(typeid(TYPE)).hash_code(), VERSION_NUMBER ); \ + return VERSION_NUMBER; \ + } \ + static inline const std::uint32_t version = registerVersion(); \ + CEREAL_UNUSED_FUNCTION \ + }; /* end Version */ \ + } } // end namespaces + #else + #define CEREAL_CLASS_VERSION(TYPE, VERSION_NUMBER) \ + namespace cereal { namespace detail { \ + template <> struct Version \ + { \ + static const std::uint32_t version; \ + static std::uint32_t registerVersion() \ + { \ + ::cereal::detail::StaticObject::getInstance().mapping.emplace( \ + std::type_index(typeid(TYPE)).hash_code(), VERSION_NUMBER ); \ + return VERSION_NUMBER; \ + } \ + CEREAL_UNUSED_FUNCTION \ + }; /* end Version */ \ + const std::uint32_t Version::version = \ + Version::registerVersion(); \ + } } // end namespaces + + #endif + + // ###################################################################### + //! The base output archive class + /*! This is the base output archive for all output archives. If you create + a custom archive class, it should derive from this, passing itself as + a template parameter for the ArchiveType. + + The base class provides all of the functionality necessary to + properly forward data to the correct serialization functions. + + Individual archives should use a combination of prologue and + epilogue functions together with specializations of serialize, save, + and load to alter the functionality of their serialization. + + @tparam ArchiveType The archive type that derives from OutputArchive + @tparam Flags Flags to control advanced functionality. See the Flags + enum for more information. + @ingroup Internal */ + template + class OutputArchive : public detail::OutputArchiveBase + { + public: + //! Construct the output archive + /*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */ + OutputArchive(ArchiveType * const derived) : self(derived), itsCurrentPointerId(1), itsCurrentPolymorphicTypeId(1) + { } + + OutputArchive & operator=( OutputArchive const & ) = delete; + + //! Serializes all passed in data + /*! This is the primary interface for serializing data with an archive */ + template inline + ArchiveType & operator()( Types && ... args ) + { + self->process( std::forward( args )... ); + return *self; + } + + //! Serializes any data marked for deferment using defer + /*! This will cause any data wrapped in DeferredData to be immediately serialized */ + void serializeDeferments() + { + for( auto & deferment : itsDeferments ) + deferment(); + } + + /*! @name Boost Transition Layer + Functionality that mirrors the syntax for Boost. This is useful if you are transitioning + a large project from Boost to cereal. The preferred interface for cereal is using operator(). */ + //! @{ + + //! Indicates this archive is not intended for loading + /*! This ensures compatibility with boost archive types. If you are transitioning + from boost, you can check this value within a member or external serialize function + (i.e., Archive::is_loading::value) to disable behavior specific to loading, until + you can transition to split save/load or save_minimal/load_minimal functions */ + using is_loading = std::false_type; + + //! Indicates this archive is intended for saving + /*! This ensures compatibility with boost archive types. If you are transitioning + from boost, you can check this value within a member or external serialize function + (i.e., Archive::is_saving::value) to enable behavior specific to loading, until + you can transition to split save/load or save_minimal/load_minimal functions */ + using is_saving = std::true_type; + + //! Serializes passed in data + /*! This is a boost compatability layer and is not the preferred way of using + cereal. If you are transitioning from boost, use this until you can + transition to the operator() overload */ + template inline + ArchiveType & operator&( T && arg ) + { + self->process( std::forward( arg ) ); + return *self; + } + + //! Serializes passed in data + /*! This is a boost compatability layer and is not the preferred way of using + cereal. If you are transitioning from boost, use this until you can + transition to the operator() overload */ + template inline + ArchiveType & operator<<( T && arg ) + { + self->process( std::forward( arg ) ); + return *self; + } + + //! @} + + //! Registers a shared pointer with the archive + /*! This function is used to track shared pointer targets to prevent + unnecessary saves from taking place if multiple shared pointers + point to the same data. + + @internal + @param sharedPointer The shared pointer itself (the address is taken via get()). + The archive takes a copy to prevent the memory location to be freed + as long as the address is used as id. This is needed to prevent CVE-2020-11105. + @return A key that uniquely identifies the pointer */ + inline std::uint32_t registerSharedPointer(const std::shared_ptr& sharedPointer) + { + void const * addr = sharedPointer.get(); + + // Handle null pointers by just returning 0 + if(addr == 0) return 0; + itsSharedPointerStorage.push_back(sharedPointer); + + auto id = itsSharedPointerMap.find( addr ); + if( id == itsSharedPointerMap.end() ) + { + auto ptrId = itsCurrentPointerId++; + itsSharedPointerMap.insert( {addr, ptrId} ); + return ptrId | detail::msb_32bit; // mask MSB to be 1 + } + else + return id->second; + } + + //! Registers a polymorphic type name with the archive + /*! This function is used to track polymorphic types to prevent + unnecessary saves of identifying strings used by the polymorphic + support functionality. + + @internal + @param name The name to associate with a polymorphic type + @return A key that uniquely identifies the polymorphic type name */ + inline std::uint32_t registerPolymorphicType( char const * name ) + { + auto id = itsPolymorphicTypeMap.find( name ); + if( id == itsPolymorphicTypeMap.end() ) + { + auto polyId = itsCurrentPolymorphicTypeId++; + itsPolymorphicTypeMap.insert( {name, polyId} ); + return polyId | detail::msb_32bit; // mask MSB to be 1 + } + else + return id->second; + } + + private: + //! Serializes data after calling prologue, then calls epilogue + template inline + void process( T && head ) + { + prologue( *self, head ); + self->processImpl( head ); + epilogue( *self, head ); + } + + //! Unwinds to process all data + template inline + void process( T && head, Other && ... tail ) + { + self->process( std::forward( head ) ); + self->process( std::forward( tail )... ); + } + + //! Serialization of a virtual_base_class wrapper + /*! \sa virtual_base_class */ + template inline + ArchiveType & processImpl(virtual_base_class const & b) + { + traits::detail::base_class_id id(b.base_ptr); + if(itsBaseClassSet.count(id) == 0) + { + itsBaseClassSet.insert(id); + self->processImpl( *b.base_ptr ); + } + return *self; + } + + //! Serialization of a base_class wrapper + /*! \sa base_class */ + template inline + ArchiveType & processImpl(base_class const & b) + { + self->processImpl( *b.base_ptr ); + return *self; + } + + std::vector> itsDeferments; + + template inline + ArchiveType & processImpl(DeferredData const & d) + { + std::function deferment( [this, d](){ self->process( d.value ); } ); + itsDeferments.emplace_back( std::move(deferment) ); + + return *self; + } + + //! Helper macro that expands the requirements for activating an overload + /*! Requirements: + Has the requested serialization function + Does not have version and unversioned at the same time + Is output serializable AND + is specialized for this type of function OR + has no specialization at all */ + #define PROCESS_IF(name) \ + traits::EnableIf::value, \ + !traits::has_invalid_output_versioning::value, \ + (traits::is_output_serializable::value && \ + (traits::is_specialized_##name::value || \ + !traits::is_specialized::value))> = traits::sfinae + + //! Member serialization + template inline + ArchiveType & processImpl(T const & t) + { + access::member_serialize(*self, const_cast(t)); + return *self; + } + + //! Non member serialization + template inline + ArchiveType & processImpl(T const & t) + { + CEREAL_SERIALIZE_FUNCTION_NAME(*self, const_cast(t)); + return *self; + } + + //! Member split (save) + template inline + ArchiveType & processImpl(T const & t) + { + access::member_save(*self, t); + return *self; + } + + //! Non member split (save) + template inline + ArchiveType & processImpl(T const & t) + { + CEREAL_SAVE_FUNCTION_NAME(*self, t); + return *self; + } + + //! Member split (save_minimal) + template inline + ArchiveType & processImpl(T const & t) + { + self->process( access::member_save_minimal(*self, t) ); + return *self; + } + + //! Non member split (save_minimal) + template inline + ArchiveType & processImpl(T const & t) + { + self->process( CEREAL_SAVE_MINIMAL_FUNCTION_NAME(*self, t) ); + return *self; + } + + //! Empty class specialization + template ::value, + std::is_empty::value> = traits::sfinae> inline + ArchiveType & processImpl(T const &) + { + return *self; + } + + //! No matching serialization + /*! Invalid if we have invalid output versioning or + we are not output serializable, and either + don't allow empty class ellision or allow it but are not serializing an empty class */ + template ::value || + (!traits::is_output_serializable::value && + (!(Flags & AllowEmptyClassElision) || ((Flags & AllowEmptyClassElision) && !std::is_empty::value)))> = traits::sfinae> inline + ArchiveType & processImpl(T const &) + { + static_assert(traits::detail::count_output_serializers::value != 0, + "cereal could not find any output serialization functions for the provided type and archive combination. \n\n " + "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " + "Serialize functions generally have the following signature: \n\n " + "template \n " + " void serialize(Archive & ar) \n " + " { \n " + " ar( member1, member2, member3 ); \n " + " } \n\n " ); + + static_assert(traits::detail::count_output_serializers::value < 2, + "cereal found more than one compatible output serialization function for the provided type and archive combination. \n\n " + "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " + "Use specialization (see access.hpp) if you need to disambiguate between serialize vs load/save functions. \n " + "Note that serialization functions can be inherited which may lead to the aforementioned ambiguities. \n " + "In addition, you may not mix versioned with non-versioned serialization functions. \n\n "); + + return *self; + } + + //! Registers a class version with the archive and serializes it if necessary + /*! If this is the first time this class has been serialized, we will record its + version number and serialize that. + + @tparam T The type of the class being serialized */ + template inline + std::uint32_t registerClassVersion() + { + static const auto hash = std::type_index(typeid(T)).hash_code(); + const auto insertResult = itsVersionedTypes.insert( hash ); + const auto lock = detail::StaticObject::lock(); + const auto version = + detail::StaticObject::getInstance().find( hash, detail::Version::version ); + + if( insertResult.second ) // insertion took place, serialize the version number + process( make_nvp("cereal_class_version", version) ); + + return version; + } + + //! Member serialization + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + access::member_serialize(*self, const_cast(t), registerClassVersion()); + return *self; + } + + //! Non member serialization + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + CEREAL_SERIALIZE_FUNCTION_NAME(*self, const_cast(t), registerClassVersion()); + return *self; + } + + //! Member split (save) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + access::member_save(*self, t, registerClassVersion()); + return *self; + } + + //! Non member split (save) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + CEREAL_SAVE_FUNCTION_NAME(*self, t, registerClassVersion()); + return *self; + } + + //! Member split (save_minimal) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + self->process( access::member_save_minimal(*self, t, registerClassVersion()) ); + return *self; + } + + //! Non member split (save_minimal) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T const & t) + { + self->process( CEREAL_SAVE_MINIMAL_FUNCTION_NAME(*self, t, registerClassVersion()) ); + return *self; + } + + #undef PROCESS_IF + + private: + ArchiveType * const self; + + //! A set of all base classes that have been serialized + std::unordered_set itsBaseClassSet; + + //! Maps from addresses to pointer ids + std::unordered_map itsSharedPointerMap; + + //! Copy of shared pointers used in #itsSharedPointerMap to make sure they are kept alive + // during lifetime of itsSharedPointerMap to prevent CVE-2020-11105. + std::vector> itsSharedPointerStorage; + + //! The id to be given to the next pointer + std::uint32_t itsCurrentPointerId; + + //! Maps from polymorphic type name strings to ids + std::unordered_map itsPolymorphicTypeMap; + + //! The id to be given to the next polymorphic type name + std::uint32_t itsCurrentPolymorphicTypeId; + + //! Keeps track of classes that have versioning information associated with them + std::unordered_set itsVersionedTypes; + }; // class OutputArchive + + // ###################################################################### + //! The base input archive class + /*! This is the base input archive for all input archives. If you create + a custom archive class, it should derive from this, passing itself as + a template parameter for the ArchiveType. + + The base class provides all of the functionality necessary to + properly forward data to the correct serialization functions. + + Individual archives should use a combination of prologue and + epilogue functions together with specializations of serialize, save, + and load to alter the functionality of their serialization. + + @tparam ArchiveType The archive type that derives from InputArchive + @tparam Flags Flags to control advanced functionality. See the Flags + enum for more information. + @ingroup Internal */ + template + class InputArchive : public detail::InputArchiveBase + { + public: + //! Construct the output archive + /*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */ + InputArchive(ArchiveType * const derived) : + self(derived), + itsBaseClassSet(), + itsSharedPointerMap(), + itsPolymorphicTypeMap(), + itsVersionedTypes() + { } + + InputArchive & operator=( InputArchive const & ) = delete; + + //! Serializes all passed in data + /*! This is the primary interface for serializing data with an archive */ + template inline + ArchiveType & operator()( Types && ... args ) + { + process( std::forward( args )... ); + return *self; + } + + //! Serializes any data marked for deferment using defer + /*! This will cause any data wrapped in DeferredData to be immediately serialized */ + void serializeDeferments() + { + for( auto & deferment : itsDeferments ) + deferment(); + } + + /*! @name Boost Transition Layer + Functionality that mirrors the syntax for Boost. This is useful if you are transitioning + a large project from Boost to cereal. The preferred interface for cereal is using operator(). */ + //! @{ + + //! Indicates this archive is intended for loading + /*! This ensures compatibility with boost archive types. If you are transitioning + from boost, you can check this value within a member or external serialize function + (i.e., Archive::is_loading::value) to enable behavior specific to loading, until + you can transition to split save/load or save_minimal/load_minimal functions */ + using is_loading = std::true_type; + + //! Indicates this archive is not intended for saving + /*! This ensures compatibility with boost archive types. If you are transitioning + from boost, you can check this value within a member or external serialize function + (i.e., Archive::is_saving::value) to disable behavior specific to loading, until + you can transition to split save/load or save_minimal/load_minimal functions */ + using is_saving = std::false_type; + + //! Serializes passed in data + /*! This is a boost compatability layer and is not the preferred way of using + cereal. If you are transitioning from boost, use this until you can + transition to the operator() overload */ + template inline + ArchiveType & operator&( T && arg ) + { + self->process( std::forward( arg ) ); + return *self; + } + + //! Serializes passed in data + /*! This is a boost compatability layer and is not the preferred way of using + cereal. If you are transitioning from boost, use this until you can + transition to the operator() overload */ + template inline + ArchiveType & operator>>( T && arg ) + { + self->process( std::forward( arg ) ); + return *self; + } + + //! @} + + //! Retrieves a shared pointer given a unique key for it + /*! This is used to retrieve a previously registered shared_ptr + which has already been loaded. + + @internal + @param id The unique id that was serialized for the pointer + @return A shared pointer to the data + @throw Exception if the id does not exist */ + inline std::shared_ptr getSharedPointer(std::uint32_t const id) + { + if(id == 0) return std::shared_ptr(nullptr); + + auto iter = itsSharedPointerMap.find( id ); + if(iter == itsSharedPointerMap.end()) + throw Exception("Error while trying to deserialize a smart pointer. Could not find id " + std::to_string(id)); + + return iter->second; + } + + //! Registers a shared pointer to its unique identifier + /*! After a shared pointer has been allocated for the first time, it should + be registered with its loaded id for future references to it. + + @internal + @param id The unique identifier for the shared pointer + @param ptr The actual shared pointer */ + inline void registerSharedPointer(std::uint32_t const id, std::shared_ptr ptr) + { + std::uint32_t const stripped_id = id & ~detail::msb_32bit; + itsSharedPointerMap[stripped_id] = ptr; + } + + //! Retrieves the string for a polymorphic type given a unique key for it + /*! This is used to retrieve a string previously registered during + a polymorphic load. + + @internal + @param id The unique id that was serialized for the polymorphic type + @return The string identifier for the type */ + inline std::string getPolymorphicName(std::uint32_t const id) + { + auto name = itsPolymorphicTypeMap.find( id ); + if(name == itsPolymorphicTypeMap.end()) + { + throw Exception("Error while trying to deserialize a polymorphic pointer. Could not find type id " + std::to_string(id)); + } + return name->second; + } + + //! Registers a polymorphic name string to its unique identifier + /*! After a polymorphic type has been loaded for the first time, it should + be registered with its loaded id for future references to it. + + @internal + @param id The unique identifier for the polymorphic type + @param name The name associated with the type */ + inline void registerPolymorphicName(std::uint32_t const id, std::string const & name) + { + std::uint32_t const stripped_id = id & ~detail::msb_32bit; + itsPolymorphicTypeMap.insert( {stripped_id, name} ); + } + + private: + //! Serializes data after calling prologue, then calls epilogue + template inline + void process( T && head ) + { + prologue( *self, head ); + self->processImpl( head ); + epilogue( *self, head ); + } + + //! Unwinds to process all data + template inline + void process( T && head, Other && ... tail ) + { + process( std::forward( head ) ); + process( std::forward( tail )... ); + } + + //! Serialization of a virtual_base_class wrapper + /*! \sa virtual_base_class */ + template inline + ArchiveType & processImpl(virtual_base_class & b) + { + traits::detail::base_class_id id(b.base_ptr); + if(itsBaseClassSet.count(id) == 0) + { + itsBaseClassSet.insert(id); + self->processImpl( *b.base_ptr ); + } + return *self; + } + + //! Serialization of a base_class wrapper + /*! \sa base_class */ + template inline + ArchiveType & processImpl(base_class & b) + { + self->processImpl( *b.base_ptr ); + return *self; + } + + std::vector> itsDeferments; + + template inline + ArchiveType & processImpl(DeferredData const & d) + { + std::function deferment( [this, d](){ self->process( d.value ); } ); + itsDeferments.emplace_back( std::move(deferment) ); + + return *self; + } + + //! Helper macro that expands the requirements for activating an overload + /*! Requirements: + Has the requested serialization function + Does not have version and unversioned at the same time + Is input serializable AND + is specialized for this type of function OR + has no specialization at all */ + #define PROCESS_IF(name) \ + traits::EnableIf::value, \ + !traits::has_invalid_input_versioning::value, \ + (traits::is_input_serializable::value && \ + (traits::is_specialized_##name::value || \ + !traits::is_specialized::value))> = traits::sfinae + + //! Member serialization + template inline + ArchiveType & processImpl(T & t) + { + access::member_serialize(*self, t); + return *self; + } + + //! Non member serialization + template inline + ArchiveType & processImpl(T & t) + { + CEREAL_SERIALIZE_FUNCTION_NAME(*self, t); + return *self; + } + + //! Member split (load) + template inline + ArchiveType & processImpl(T & t) + { + access::member_load(*self, t); + return *self; + } + + //! Non member split (load) + template inline + ArchiveType & processImpl(T & t) + { + CEREAL_LOAD_FUNCTION_NAME(*self, t); + return *self; + } + + //! Member split (load_minimal) + template inline + ArchiveType & processImpl(T & t) + { + using OutArchiveType = typename traits::detail::get_output_from_input::type; + typename traits::has_member_save_minimal::type value; + self->process( value ); + access::member_load_minimal(*self, t, value); + return *self; + } + + //! Non member split (load_minimal) + template inline + ArchiveType & processImpl(T & t) + { + using OutArchiveType = typename traits::detail::get_output_from_input::type; + typename traits::has_non_member_save_minimal::type value; + self->process( value ); + CEREAL_LOAD_MINIMAL_FUNCTION_NAME(*self, t, value); + return *self; + } + + //! Empty class specialization + template ::value, + std::is_empty::value> = traits::sfinae> inline + ArchiveType & processImpl(T const &) + { + return *self; + } + + //! No matching serialization + /*! Invalid if we have invalid input versioning or + we are not input serializable, and either + don't allow empty class ellision or allow it but are not serializing an empty class */ + template ::value || + (!traits::is_input_serializable::value && + (!(Flags & AllowEmptyClassElision) || ((Flags & AllowEmptyClassElision) && !std::is_empty::value)))> = traits::sfinae> inline + ArchiveType & processImpl(T const &) + { + static_assert(traits::detail::count_input_serializers::value != 0, + "cereal could not find any input serialization functions for the provided type and archive combination. \n\n " + "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " + "Serialize functions generally have the following signature: \n\n " + "template \n " + " void serialize(Archive & ar) \n " + " { \n " + " ar( member1, member2, member3 ); \n " + " } \n\n " ); + + static_assert(traits::detail::count_input_serializers::value < 2, + "cereal found more than one compatible input serialization function for the provided type and archive combination. \n\n " + "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " + "Use specialization (see access.hpp) if you need to disambiguate between serialize vs load/save functions. \n " + "Note that serialization functions can be inherited which may lead to the aforementioned ambiguities. \n " + "In addition, you may not mix versioned with non-versioned serialization functions. \n\n "); + + return *self; + } + + //! Befriend for versioning in load_and_construct + template friend struct detail::Construct; + + //! Registers a class version with the archive and serializes it if necessary + /*! If this is the first time this class has been serialized, we will record its + version number and serialize that. + + @tparam T The type of the class being serialized */ + template inline + std::uint32_t loadClassVersion() + { + static const auto hash = std::type_index(typeid(T)).hash_code(); + auto lookupResult = itsVersionedTypes.find( hash ); + + if( lookupResult != itsVersionedTypes.end() ) // already exists + return lookupResult->second; + else // need to load + { + std::uint32_t version; + + process( make_nvp("cereal_class_version", version) ); + itsVersionedTypes.emplace_hint( lookupResult, hash, version ); + + return version; + } + } + + //! Member serialization + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + const auto version = loadClassVersion(); + access::member_serialize(*self, t, version); + return *self; + } + + //! Non member serialization + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + const auto version = loadClassVersion(); + CEREAL_SERIALIZE_FUNCTION_NAME(*self, t, version); + return *self; + } + + //! Member split (load) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + const auto version = loadClassVersion(); + access::member_load(*self, t, version); + return *self; + } + + //! Non member split (load) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + const auto version = loadClassVersion(); + CEREAL_LOAD_FUNCTION_NAME(*self, t, version); + return *self; + } + + //! Member split (load_minimal) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + using OutArchiveType = typename traits::detail::get_output_from_input::type; + const auto version = loadClassVersion(); + typename traits::has_member_versioned_save_minimal::type value; + self->process(value); + access::member_load_minimal(*self, t, value, version); + return *self; + } + + //! Non member split (load_minimal) + /*! Versioning implementation */ + template inline + ArchiveType & processImpl(T & t) + { + using OutArchiveType = typename traits::detail::get_output_from_input::type; + const auto version = loadClassVersion(); + typename traits::has_non_member_versioned_save_minimal::type value; + self->process(value); + CEREAL_LOAD_MINIMAL_FUNCTION_NAME(*self, t, value, version); + return *self; + } + + #undef PROCESS_IF + + private: + ArchiveType * const self; + + //! A set of all base classes that have been serialized + std::unordered_set itsBaseClassSet; + + //! Maps from pointer ids to metadata + std::unordered_map> itsSharedPointerMap; + + //! Maps from name ids to names + std::unordered_map itsPolymorphicTypeMap; + + //! Maps from type hash codes to version numbers + std::unordered_map itsVersionedTypes; + }; // class InputArchive +} // namespace cereal + +// This include needs to come after things such as binary_data, make_nvp, etc +#include "cylon/thridparty/cereal/types/common.hpp" + +#endif // CEREAL_CEREAL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/helpers.hpp b/cpp/src/cylon/thridparty/cereal/details/helpers.hpp new file mode 100644 index 000000000..a0514fc41 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/helpers.hpp @@ -0,0 +1,422 @@ +/*! \file helpers.hpp + \brief Internal helper functionality + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_DETAILS_HELPERS_HPP_ +#define CEREAL_DETAILS_HELPERS_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "cylon/thridparty/cereal/macros.hpp" +#include "cylon/thridparty/cereal/details/static_object.hpp" + +namespace cereal +{ + // ###################################################################### + //! An exception class thrown when things go wrong at runtime + /*! @ingroup Utility */ + struct Exception : public std::runtime_error + { + explicit Exception( const std::string & what_ ) : std::runtime_error(what_) {} + explicit Exception( const char * what_ ) : std::runtime_error(what_) {} + }; + + // ###################################################################### + //! The size type used by cereal + /*! To ensure compatability between 32, 64, etc bit machines, we need to use + a fixed size type instead of size_t, which may vary from machine to + machine. + + The default value for CEREAL_SIZE_TYPE is specified in cereal/macros.hpp */ + using size_type = CEREAL_SIZE_TYPE; + + // forward decls + class BinaryOutputArchive; + class BinaryInputArchive; + + // ###################################################################### + namespace detail + { + struct NameValuePairCore {}; //!< Traits struct for NVPs + struct DeferredDataCore {}; //!< Traits struct for DeferredData + } + + // ###################################################################### + //! For holding name value pairs + /*! This pairs a name (some string) with some value such that an archive + can potentially take advantage of the pairing. + + In serialization functions, NameValuePairs are usually created like so: + @code{.cpp} + struct MyStruct + { + int a, b, c, d, e; + + template + void serialize(Archive & archive) + { + archive( CEREAL_NVP(a), + CEREAL_NVP(b), + CEREAL_NVP(c), + CEREAL_NVP(d), + CEREAL_NVP(e) ); + } + }; + @endcode + + Alternatively, you can give you data members custom names like so: + @code{.cpp} + struct MyStruct + { + int a, b, my_embarrassing_variable_name, d, e; + + template + void serialize(Archive & archive) + { + archive( CEREAL_NVP(a), + CEREAL_NVP(b), + cereal::make_nvp("var", my_embarrassing_variable_name) ); + CEREAL_NVP(d), + CEREAL_NVP(e) ); + } + }; + @endcode + + There is a slight amount of overhead to creating NameValuePairs, so there + is a third method which will elide the names when they are not used by + the Archive: + + @code{.cpp} + struct MyStruct + { + int a, b; + + template + void serialize(Archive & archive) + { + archive( cereal::make_nvp(a), + cereal::make_nvp(b) ); + } + }; + @endcode + + This third method is generally only used when providing generic type + support. Users writing their own serialize functions will normally + explicitly control whether they want to use NVPs or not. + + @internal */ + template + class NameValuePair : detail::NameValuePairCore + { + private: + // If we get passed an array, keep the type as is, otherwise store + // a reference if we were passed an l value reference, else copy the value + using Type = typename std::conditional::type>::value, + typename std::remove_cv::type, + typename std::conditional::value, + T, + typename std::decay::type>::type>::type; + + // prevent nested nvps + static_assert( !std::is_base_of::value, + "Cannot pair a name to a NameValuePair" ); + + NameValuePair & operator=( NameValuePair const & ) = delete; + + public: + //! Constructs a new NameValuePair + /*! @param n The name of the pair + @param v The value to pair. Ideally this should be an l-value reference so that + the value can be both loaded and saved to. If you pass an r-value reference, + the NameValuePair will store a copy of it instead of a reference. Thus you should + only pass r-values in cases where this makes sense, such as the result of some + size() call. + @internal */ + NameValuePair( char const * n, T && v ) : name(n), value(std::forward(v)) {} + + char const * name; + Type value; + }; + + //! A specialization of make_nvp<> that simply forwards the value for binary archives + /*! @relates NameValuePair + @internal */ + template inline + typename + std::enable_if::value || + std::is_same::value, + T && >::type + make_nvp( const char *, T && value ) + { + return std::forward(value); + } + + //! A specialization of make_nvp<> that actually creates an nvp for non-binary archives + /*! @relates NameValuePair + @internal */ + template inline + typename + std::enable_if::value && + !std::is_same::value, + NameValuePair >::type + make_nvp( const char * name, T && value) + { + return {name, std::forward(value)}; + } + + //! Convenience for creating a templated NVP + /*! For use in internal generic typing functions which have an + Archive type declared + @internal */ + #define CEREAL_NVP_(name, value) ::cereal::make_nvp(name, value) + + // ###################################################################### + //! A wrapper around data that can be serialized in a binary fashion + /*! This class is used to demarcate data that can safely be serialized + as a binary chunk of data. Individual archives can then choose how + best represent this during serialization. + + @internal */ + template + struct BinaryData + { + //! Internally store the pointer as a void *, keeping const if created with + //! a const pointer + using PT = typename std::conditional::type>::type>::value, + const void *, + void *>::type; + + BinaryData( T && d, uint64_t s ) : data(std::forward(d)), size(s) {} + + PT data; //!< pointer to beginning of data + uint64_t size; //!< size in bytes + }; + + // ###################################################################### + //! A wrapper around data that should be serialized after all non-deferred data + /*! This class is used to demarcate data that can only be safely serialized after + any data not wrapped in this class. + + @internal */ + template + class DeferredData : detail::DeferredDataCore + { + private: + // If we get passed an array, keep the type as is, otherwise store + // a reference if we were passed an l value reference, else copy the value + using Type = typename std::conditional::type>::value, + typename std::remove_cv::type, + typename std::conditional::value, + T, + typename std::decay::type>::type>::type; + + // prevent nested nvps + static_assert( !std::is_base_of::value, + "Cannot defer DeferredData" ); + + DeferredData & operator=( DeferredData const & ) = delete; + + public: + //! Constructs a new NameValuePair + /*! @param v The value to defer. Ideally this should be an l-value reference so that + the value can be both loaded and saved to. If you pass an r-value reference, + the DeferredData will store a copy of it instead of a reference. Thus you should + only pass r-values in cases where this makes sense, such as the result of some + size() call. + @internal */ + DeferredData( T && v ) : value(std::forward(v)) {} + + Type value; + }; + + // ###################################################################### + namespace detail + { + // base classes for type checking + /* The rtti virtual function only exists to enable an archive to + be used in a polymorphic fashion, if necessary. See the + archive adapters for an example of this */ + class OutputArchiveBase + { + public: + OutputArchiveBase() = default; + OutputArchiveBase( OutputArchiveBase && ) CEREAL_NOEXCEPT {} + OutputArchiveBase & operator=( OutputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } + virtual ~OutputArchiveBase() CEREAL_NOEXCEPT = default; + + private: + virtual void rtti() {} + }; + + class InputArchiveBase + { + public: + InputArchiveBase() = default; + InputArchiveBase( InputArchiveBase && ) CEREAL_NOEXCEPT {} + InputArchiveBase & operator=( InputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } + virtual ~InputArchiveBase() CEREAL_NOEXCEPT = default; + + private: + virtual void rtti() {} + }; + + // forward decls for polymorphic support + template struct polymorphic_serialization_support; + struct adl_tag; + + // used during saving pointers + static const uint32_t msb_32bit = 0x80000000; + static const int32_t msb2_32bit = 0x40000000; + } + + // ###################################################################### + //! A wrapper around size metadata + /*! This class provides a way for archives to have more flexibility over how + they choose to serialize size metadata for containers. For some archive + types, the size may be implicitly encoded in the output (e.g. JSON) and + not need an explicit entry. Specializing serialize or load/save for + your archive and SizeTags allows you to choose what happens. + + @internal */ + template + class SizeTag + { + private: + // Store a reference if passed an lvalue reference, otherwise + // make a copy of the data + using Type = typename std::conditional::value, + T, + typename std::decay::type>::type; + + SizeTag & operator=( SizeTag const & ) = delete; + + public: + SizeTag( T && sz ) : size(std::forward(sz)) {} + + Type size; + }; + + // ###################################################################### + //! A wrapper around a key and value for serializing data into maps. + /*! This class just provides a grouping of keys and values into a struct for + human readable archives. For example, XML archives will use this wrapper + to write maps like so: + + @code{.xml} + + + MyFirstKey + MyFirstValue + + + MySecondKey + MySecondValue + + + @endcode + + \sa make_map_item + @internal */ + template + struct MapItem + { + using KeyType = typename std::conditional< + std::is_lvalue_reference::value, + Key, + typename std::decay::type>::type; + + using ValueType = typename std::conditional< + std::is_lvalue_reference::value, + Value, + typename std::decay::type>::type; + + //! Construct a MapItem from a key and a value + /*! @internal */ + MapItem( Key && key_, Value && value_ ) : key(std::forward(key_)), value(std::forward(value_)) {} + + MapItem & operator=( MapItem const & ) = delete; + + KeyType key; + ValueType value; + + //! Serialize the MapItem with the NVPs "key" and "value" + template inline + void CEREAL_SERIALIZE_FUNCTION_NAME(Archive & archive) + { + archive( make_nvp("key", key), + make_nvp("value", value) ); + } + }; + + //! Create a MapItem so that human readable archives will group keys and values together + /*! @internal + @relates MapItem */ + template inline + MapItem make_map_item(KeyType && key, ValueType && value) + { + return {std::forward(key), std::forward(value)}; + } + + namespace detail + { + //! Tag for Version, which due to its anonymous namespace, becomes a different + //! type in each translation unit + /*! This allows CEREAL_CLASS_VERSION to be safely called in a header file */ + namespace{ struct version_binding_tag {}; } + + // ###################################################################### + //! Version information class + /*! This is the base case for classes that have not been explicitly + registered */ + template struct Version + { + static const std::uint32_t version = 0; + // we don't need to explicitly register these types since they + // always get a version number of 0 + }; + + //! Holds all registered version information + struct Versions + { + std::unordered_map mapping; + + std::uint32_t find( std::size_t hash, std::uint32_t version ) + { + const auto result = mapping.emplace( hash, version ); + return result.first->second; + } + }; // struct Versions + } // namespace detail +} // namespace cereal + +#endif // CEREAL_DETAILS_HELPERS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp new file mode 100644 index 000000000..64a58e458 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp @@ -0,0 +1,825 @@ +/*! \file polymorphic_impl.hpp + \brief Internal polymorphism support + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* This code is heavily inspired by the boost serialization implementation by the following authors + + (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt) + + See http://www.boost.org for updates, documentation, and revision history. + + (C) Copyright 2006 David Abrahams - http://www.boost.org. + + See /boost/serialization/export.hpp, /boost/archive/detail/register_archive.hpp, + and /boost/serialization/void_cast.hpp for their implementation. Additional details + found in other files split across serialization and archive. +*/ +#ifndef CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ +#define CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ + +#include "cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp" +#include "cylon/thridparty/cereal/details/static_object.hpp" +#include "cylon/thridparty/cereal/types/memory.hpp" +#include "cylon/thridparty/cereal/types/string.hpp" +#include +#include +#include +#include +#include +#include + +//! Helper macro to omit unused warning +#if defined(__GNUC__) + // GCC / clang don't want the function + #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION +#else + #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION static void unused() { (void)b; } +#endif + +//! Binds a polymorphic type to all registered archives +/*! This binds a polymorphic type to all compatible registered archives that + have been registered with CEREAL_REGISTER_ARCHIVE. This must be called + after all archives are registered (usually after the archives themselves + have been included). */ +#ifdef CEREAL_HAS_CPP17 +#define CEREAL_BIND_TO_ARCHIVES(...) \ + namespace cereal { \ + namespace detail { \ + template<> \ + struct init_binding<__VA_ARGS__> { \ + static inline bind_to_archives<__VA_ARGS__> const & b= \ + ::cereal::detail::StaticObject< \ + bind_to_archives<__VA_ARGS__> \ + >::getInstance().bind(); \ + CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION \ + }; \ + }} /* end namespaces */ +#else +#define CEREAL_BIND_TO_ARCHIVES(...) \ + namespace cereal { \ + namespace detail { \ + template<> \ + struct init_binding<__VA_ARGS__> { \ + static bind_to_archives<__VA_ARGS__> const& b; \ + CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION \ + }; \ + bind_to_archives<__VA_ARGS__> const & init_binding<__VA_ARGS__>::b = \ + ::cereal::detail::StaticObject< \ + bind_to_archives<__VA_ARGS__> \ + >::getInstance().bind(); \ + }} /* end namespaces */ +#endif + +namespace cereal +{ + /* Polymorphic casting support */ + namespace detail + { + //! Base type for polymorphic void casting + /*! Contains functions for casting between registered base and derived types. + + This is necessary so that cereal can properly cast between polymorphic types + even though void pointers are used, which normally have no type information. + Runtime type information is used instead to index a compile-time made mapping + that can perform the proper cast. In the case of multiple levels of inheritance, + cereal will attempt to find the shortest path by using registered relationships to + perform the cast. + + This class will be allocated as a StaticObject and only referenced by pointer, + allowing a templated derived version of it to define strongly typed functions + that cast between registered base and derived types. */ + struct PolymorphicCaster + { + PolymorphicCaster() = default; + PolymorphicCaster( const PolymorphicCaster & ) = default; + PolymorphicCaster & operator=( const PolymorphicCaster & ) = default; + PolymorphicCaster( PolymorphicCaster && ) CEREAL_NOEXCEPT {} + PolymorphicCaster & operator=( PolymorphicCaster && ) CEREAL_NOEXCEPT { return *this; } + virtual ~PolymorphicCaster() CEREAL_NOEXCEPT = default; + + //! Downcasts to the proper derived type + virtual void const * downcast( void const * const ptr ) const = 0; + //! Upcast to proper base type + virtual void * upcast( void * const ptr ) const = 0; + //! Upcast to proper base type, shared_ptr version + virtual std::shared_ptr upcast( std::shared_ptr const & ptr ) const = 0; + }; + + //! Holds registered mappings between base and derived types for casting + /*! This will be allocated as a StaticObject and holds a map containing + all registered mappings between base and derived types. */ + struct PolymorphicCasters + { + //! Maps from a derived type index to a set of chainable casters + using DerivedCasterMap = std::unordered_map>; + //! Maps from base type index to a map from derived type index to caster + std::unordered_map map; + + std::multimap reverseMap; + + //! Error message used for unregistered polymorphic casts + #define UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(LoadSave) \ + throw cereal::Exception("Trying to " #LoadSave " a registered polymorphic type with an unregistered polymorphic cast.\n" \ + "Could not find a path to a base class (" + util::demangle(baseInfo.name()) + ") for type: " + ::cereal::util::demangledName() + "\n" \ + "Make sure you either serialize the base class at some point via cereal::base_class or cereal::virtual_base_class.\n" \ + "Alternatively, manually register the association with CEREAL_REGISTER_POLYMORPHIC_RELATION."); + + //! Checks if the mapping object that can perform the upcast or downcast exists, and returns it if so + /*! Uses the type index from the base and derived class to find the matching + registered caster. If no matching caster exists, the bool in the pair will be false and the vector + reference should not be used. */ + static std::pair const &> + lookup_if_exists( std::type_index const & baseIndex, std::type_index const & derivedIndex ) + { + // First phase of lookup - match base type index + auto const & baseMap = StaticObject::getInstance().map; + auto baseIter = baseMap.find( baseIndex ); + if (baseIter == baseMap.end()) + return {false, {}}; + + // Second phase - find a match from base to derived + auto const & derivedMap = baseIter->second; + auto derivedIter = derivedMap.find( derivedIndex ); + if (derivedIter == derivedMap.end()) + return {false, {}}; + + return {true, derivedIter->second}; + } + + //! Gets the mapping object that can perform the upcast or downcast + /*! Uses the type index from the base and derived class to find the matching + registered caster. If no matching caster exists, calls the exception function. + + The returned PolymorphicCaster is capable of upcasting or downcasting between the two types. */ + template inline + static std::vector const & lookup( std::type_index const & baseIndex, std::type_index const & derivedIndex, F && exceptionFunc ) + { + // First phase of lookup - match base type index + auto const & baseMap = StaticObject::getInstance().map; + auto baseIter = baseMap.find( baseIndex ); + if( baseIter == baseMap.end() ) + exceptionFunc(); + + // Second phase - find a match from base to derived + auto const & derivedMap = baseIter->second; + auto derivedIter = derivedMap.find( derivedIndex ); + if( derivedIter == derivedMap.end() ) + exceptionFunc(); + + return derivedIter->second; + } + + //! Performs a downcast to the derived type using a registered mapping + template inline + static const Derived * downcast( const void * dptr, std::type_info const & baseInfo ) + { + auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(save) } ); + + for( auto const * dmap : mapping ) + dptr = dmap->downcast( dptr ); + + return static_cast( dptr ); + } + + //! Performs an upcast to the registered base type using the given a derived type + /*! The return is untyped because the final casting to the base type must happen in the polymorphic + serialization function, where the type is known at compile time */ + template inline + static void * upcast( Derived * const dptr, std::type_info const & baseInfo ) + { + auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(load) } ); + + void * uptr = dptr; + for( auto mIter = mapping.rbegin(), mEnd = mapping.rend(); mIter != mEnd; ++mIter ) + uptr = (*mIter)->upcast( uptr ); + + return uptr; + } + + //! Upcasts for shared pointers + template inline + static std::shared_ptr upcast( std::shared_ptr const & dptr, std::type_info const & baseInfo ) + { + auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(load) } ); + + std::shared_ptr uptr = dptr; + for( auto mIter = mapping.rbegin(), mEnd = mapping.rend(); mIter != mEnd; ++mIter ) + uptr = (*mIter)->upcast( uptr ); + + return uptr; + } + + #undef UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION + }; + + #ifdef CEREAL_OLDER_GCC + #define CEREAL_EMPLACE_MAP(map, key, value) \ + map.insert( std::make_pair(std::move(key), std::move(value)) ); + #else // NOT CEREAL_OLDER_GCC + #define CEREAL_EMPLACE_MAP(map, key, value) \ + map.emplace( key, value ); + #endif // NOT_CEREAL_OLDER_GCC + + //! Strongly typed derivation of PolymorphicCaster + template + struct PolymorphicVirtualCaster : PolymorphicCaster + { + //! Inserts an entry in the polymorphic casting map for this pairing + /*! Creates an explicit mapping between Base and Derived in both upwards and + downwards directions, allowing void pointers to either to be properly cast + assuming dynamic type information is available */ + PolymorphicVirtualCaster() + { + const auto baseKey = std::type_index(typeid(Base)); + const auto derivedKey = std::type_index(typeid(Derived)); + + // First insert the relation Base->Derived + const auto lock = StaticObject::lock(); + auto & baseMap = StaticObject::getInstance().map; + + { + auto & derivedMap = baseMap.insert( {baseKey, PolymorphicCasters::DerivedCasterMap{}} ).first->second; + auto & derivedVec = derivedMap.insert( {derivedKey, {}} ).first->second; + derivedVec.push_back( this ); + } + + // Insert reverse relation Derived->Base + auto & reverseMap = StaticObject::getInstance().reverseMap; + CEREAL_EMPLACE_MAP(reverseMap, derivedKey, baseKey); + + // Find all chainable unregistered relations + /* The strategy here is to process only the nodes in the class hierarchy graph that have been + affected by the new insertion. The algorithm iteratively processes a node an ensures that it + is updated with all new shortest length paths. It then processes the parents of the active node, + with the knowledge that all children have already been processed. + + Note that for the following, we'll use the nomenclature of parent and child to not confuse with + the inserted base derived relationship */ + { + // Checks whether there is a path from parent->child and returns a pair + // dist is set to MAX if the path does not exist + auto checkRelation = [](std::type_index const & parentInfo, std::type_index const & childInfo) -> + std::pair const &> + { + auto result = PolymorphicCasters::lookup_if_exists( parentInfo, childInfo ); + if( result.first ) + { + auto const & path = result.second; + return {path.size(), path}; + } + else + return {(std::numeric_limits::max)(), {}}; + }; + + std::stack parentStack; // Holds the parent nodes to be processed + std::vector dirtySet; // Marks child nodes that have been changed + std::unordered_set processedParents; // Marks parent nodes that have been processed + + // Checks if a child has been marked dirty + auto isDirty = [&](std::type_index const & c) + { + auto const dirtySetSize = dirtySet.size(); + for( size_t i = 0; i < dirtySetSize; ++i ) + if( dirtySet[i] == c ) + return true; + + return false; + }; + + // Begin processing the base key and mark derived as dirty + parentStack.push( baseKey ); + dirtySet.emplace_back( derivedKey ); + + while( !parentStack.empty() ) + { + using Relations = std::unordered_multimap>>; + Relations unregisteredRelations; // Defer insertions until after main loop to prevent iterator invalidation + + const auto parent = parentStack.top(); + parentStack.pop(); + + // Update paths to all children marked dirty + for( auto const & childPair : baseMap[parent] ) + { + const auto child = childPair.first; + if( isDirty( child ) && baseMap.count( child ) ) + { + auto parentChildPath = checkRelation( parent, child ); + + // Search all paths from the child to its own children (finalChild), + // looking for a shorter path from parent to finalChild + for( auto const & finalChildPair : baseMap[child] ) + { + const auto finalChild = finalChildPair.first; + + auto parentFinalChildPath = checkRelation( parent, finalChild ); + auto childFinalChildPath = checkRelation( child, finalChild ); + + const size_t newLength = 1u + parentChildPath.first; + + if( newLength < parentFinalChildPath.first ) + { + std::vector path = parentChildPath.second; + path.insert( path.end(), childFinalChildPath.second.begin(), childFinalChildPath.second.end() ); + + // Check to see if we have a previous uncommitted path in unregisteredRelations + // that is shorter. If so, ignore this path + auto hintRange = unregisteredRelations.equal_range( parent ); + auto hint = hintRange.first; + for( ; hint != hintRange.second; ++hint ) + if( hint->second.first == finalChild ) + break; + + const bool uncommittedExists = hint != unregisteredRelations.end(); + if( uncommittedExists && (hint->second.second.size() <= newLength) ) + continue; + + auto newPath = std::pair>{finalChild, std::move(path)}; + + // Insert the new path if it doesn't exist, otherwise this will just lookup where to do the + // replacement + #ifdef CEREAL_OLDER_GCC + auto old = unregisteredRelations.insert( hint, std::make_pair(parent, newPath) ); + #else // NOT CEREAL_OLDER_GCC + auto old = unregisteredRelations.emplace_hint( hint, parent, newPath ); + #endif // NOT CEREAL_OLDER_GCC + + // If there was an uncommitted path, we need to perform a replacement + if( uncommittedExists ) + old->second = newPath; + } + } // end loop over child's children + } // end if dirty and child has children + } // end loop over children + + // Insert chained relations + for( auto const & it : unregisteredRelations ) + { + auto & derivedMap = baseMap.find( it.first )->second; + derivedMap[it.second.first] = it.second.second; + CEREAL_EMPLACE_MAP(reverseMap, it.second.first, it.first ); + } + + // Mark current parent as modified + dirtySet.emplace_back( parent ); + + // Insert all parents of the current parent node that haven't yet been processed + auto parentRange = reverseMap.equal_range( parent ); + for( auto pIter = parentRange.first; pIter != parentRange.second; ++pIter ) + { + const auto pParent = pIter->second; + if( !processedParents.count( pParent ) ) + { + parentStack.push( pParent ); + processedParents.insert( pParent ); + } + } + } // end loop over parent stack + } // end chainable relations + } // end PolymorphicVirtualCaster() + + #undef CEREAL_EMPLACE_MAP + + //! Performs the proper downcast with the templated types + void const * downcast( void const * const ptr ) const override + { + return dynamic_cast( static_cast( ptr ) ); + } + + //! Performs the proper upcast with the templated types + void * upcast( void * const ptr ) const override + { + return dynamic_cast( static_cast( ptr ) ); + } + + //! Performs the proper upcast with the templated types (shared_ptr version) + std::shared_ptr upcast( std::shared_ptr const & ptr ) const override + { + return std::dynamic_pointer_cast( std::static_pointer_cast( ptr ) ); + } + }; + + //! Registers a polymorphic casting relation between a Base and Derived type + /*! Registering a relation allows cereal to properly cast between the two types + given runtime type information and void pointers. + + Registration happens automatically via cereal::base_class and cereal::virtual_base_class + instantiations. For cases where neither is called, see the CEREAL_REGISTER_POLYMORPHIC_RELATION + macro */ + template + struct RegisterPolymorphicCaster + { + static PolymorphicCaster const * bind( std::true_type /* is_polymorphic */) + { + return &StaticObject>::getInstance(); + } + + static PolymorphicCaster const * bind( std::false_type /* is_polymorphic */ ) + { return nullptr; } + + //! Performs registration (binding) between Base and Derived + /*! If the type is not polymorphic, nothing will happen */ + static PolymorphicCaster const * bind() + { return bind( typename std::is_polymorphic::type() ); } + }; + } + + /* General polymorphism support */ + namespace detail + { + //! Binds a compile time type with a user defined string + template + struct binding_name {}; + + //! A structure holding a map from type_indices to output serializer functions + /*! A static object of this map should be created for each registered archive + type, containing entries for every registered type that describe how to + properly cast the type to its real type in polymorphic scenarios for + shared_ptr, weak_ptr, and unique_ptr. */ + template + struct OutputBindingMap + { + //! A serializer function + /*! Serializer functions return nothing and take an archive as + their first parameter (will be cast properly inside the function, + a pointer to actual data (contents of smart_ptr's get() function) + as their second parameter, and the type info of the owning smart_ptr + as their final parameter */ + typedef std::function Serializer; + + //! Struct containing the serializer functions for all pointer types + struct Serializers + { + Serializer shared_ptr, //!< Serializer function for shared/weak pointers + unique_ptr; //!< Serializer function for unique pointers + }; + + //! A map of serializers for pointers of all registered types + std::map map; + }; + + //! An empty noop deleter + template struct EmptyDeleter { void operator()(T *) const {} }; + + //! A structure holding a map from type name strings to input serializer functions + /*! A static object of this map should be created for each registered archive + type, containing entries for every registered type that describe how to + properly cast the type to its real type in polymorphic scenarios for + shared_ptr, weak_ptr, and unique_ptr. */ + template + struct InputBindingMap + { + //! Shared ptr serializer function + /*! Serializer functions return nothing and take an archive as + their first parameter (will be cast properly inside the function, + a shared_ptr (or unique_ptr for the unique case) of any base + type, and the type id of said base type as the third parameter. + Internally it will properly be loaded and cast to the correct type. */ + typedef std::function &, std::type_info const &)> SharedSerializer; + //! Unique ptr serializer function + typedef std::function> &, std::type_info const &)> UniqueSerializer; + + //! Struct containing the serializer functions for all pointer types + struct Serializers + { + SharedSerializer shared_ptr; //!< Serializer function for shared/weak pointers + UniqueSerializer unique_ptr; //!< Serializer function for unique pointers + }; + + //! A map of serializers for pointers of all registered types + std::map map; + }; + + // forward decls for archives from cereal.hpp + class InputArchiveBase; + class OutputArchiveBase; + + //! Creates a binding (map entry) between an input archive type and a polymorphic type + /*! Bindings are made when types are registered, assuming that at least one + archive has already been registered. When this struct is created, + it will insert (at run time) an entry into a map that properly handles + casting for serializing polymorphic objects */ + template struct InputBindingCreator + { + //! Initialize the binding + InputBindingCreator() + { + auto & map = StaticObject>::getInstance().map; + auto lock = StaticObject>::lock(); + auto key = std::string(binding_name::name()); + auto lb = map.lower_bound(key); + + if (lb != map.end() && lb->first == key) + return; + + typename InputBindingMap::Serializers serializers; + + serializers.shared_ptr = + [](void * arptr, std::shared_ptr & dptr, std::type_info const & baseInfo) + { + Archive & ar = *static_cast(arptr); + std::shared_ptr ptr; + + ar( CEREAL_NVP_("ptr_wrapper", ::cereal::memory_detail::make_ptr_wrapper(ptr)) ); + + dptr = PolymorphicCasters::template upcast( ptr, baseInfo ); + }; + + serializers.unique_ptr = + [](void * arptr, std::unique_ptr> & dptr, std::type_info const & baseInfo) + { + Archive & ar = *static_cast(arptr); + std::unique_ptr ptr; + + ar( CEREAL_NVP_("ptr_wrapper", ::cereal::memory_detail::make_ptr_wrapper(ptr)) ); + + dptr.reset( PolymorphicCasters::template upcast( ptr.release(), baseInfo )); + }; + + map.insert( lb, { std::move(key), std::move(serializers) } ); + } + }; + + //! Creates a binding (map entry) between an output archive type and a polymorphic type + /*! Bindings are made when types are registered, assuming that at least one + archive has already been registered. When this struct is created, + it will insert (at run time) an entry into a map that properly handles + casting for serializing polymorphic objects */ + template struct OutputBindingCreator + { + //! Writes appropriate metadata to the archive for this polymorphic type + static void writeMetadata(Archive & ar) + { + // Register the polymorphic type name with the archive, and get the id + char const * name = binding_name::name(); + std::uint32_t id = ar.registerPolymorphicType(name); + + // Serialize the id + ar( CEREAL_NVP_("polymorphic_id", id) ); + + // If the msb of the id is 1, then the type name is new, and we should serialize it + if( id & detail::msb_32bit ) + { + std::string namestring(name); + ar( CEREAL_NVP_("polymorphic_name", namestring) ); + } + } + + //! Holds a properly typed shared_ptr to the polymorphic type + class PolymorphicSharedPointerWrapper + { + public: + /*! Wrap a raw polymorphic pointer in a shared_ptr to its true type + + The wrapped pointer will not be responsible for ownership of the held pointer + so it will not attempt to destroy it; instead the refcount of the wrapped + pointer will be tied to a fake 'ownership pointer' that will do nothing + when it ultimately goes out of scope. + + The main reason for doing this, other than not to destroy the true object + with our wrapper pointer, is to avoid meddling with the internal reference + count in a polymorphic type that inherits from std::enable_shared_from_this. + + @param dptr A void pointer to the contents of the shared_ptr to serialize */ + PolymorphicSharedPointerWrapper( T const * dptr ) : refCount(), wrappedPtr( refCount, dptr ) + { } + + //! Get the wrapped shared_ptr */ + inline std::shared_ptr const & operator()() const { return wrappedPtr; } + + private: + std::shared_ptr refCount; //!< The ownership pointer + std::shared_ptr wrappedPtr; //!< The wrapped pointer + }; + + //! Does the actual work of saving a polymorphic shared_ptr + /*! This function will properly create a shared_ptr from the void * that is passed in + before passing it to the archive for serialization. + + In addition, this will also preserve the state of any internal enable_shared_from_this mechanisms + + @param ar The archive to serialize to + @param dptr Pointer to the actual data held by the shared_ptr */ + static inline void savePolymorphicSharedPtr( Archive & ar, T const * dptr, std::true_type /* has_shared_from_this */ ) + { + ::cereal::memory_detail::EnableSharedStateHelper state( const_cast(dptr) ); + PolymorphicSharedPointerWrapper psptr( dptr ); + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( psptr() ) ) ); + } + + //! Does the actual work of saving a polymorphic shared_ptr + /*! This function will properly create a shared_ptr from the void * that is passed in + before passing it to the archive for serialization. + + This version is for types that do not inherit from std::enable_shared_from_this. + + @param ar The archive to serialize to + @param dptr Pointer to the actual data held by the shared_ptr */ + static inline void savePolymorphicSharedPtr( Archive & ar, T const * dptr, std::false_type /* has_shared_from_this */ ) + { + PolymorphicSharedPointerWrapper psptr( dptr ); + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( psptr() ) ) ); + } + + //! Initialize the binding + OutputBindingCreator() + { + auto & map = StaticObject>::getInstance().map; + auto key = std::type_index(typeid(T)); + auto lb = map.lower_bound(key); + + if (lb != map.end() && lb->first == key) + return; + + typename OutputBindingMap::Serializers serializers; + + serializers.shared_ptr = + [&](void * arptr, void const * dptr, std::type_info const & baseInfo) + { + Archive & ar = *static_cast(arptr); + writeMetadata(ar); + + auto ptr = PolymorphicCasters::template downcast( dptr, baseInfo ); + + #if defined(_MSC_VER) && _MSC_VER < 1916 && !defined(__clang__) + savePolymorphicSharedPtr( ar, ptr, ::cereal::traits::has_shared_from_this::type() ); // MSVC doesn't like typename here + #else // not _MSC_VER + savePolymorphicSharedPtr( ar, ptr, typename ::cereal::traits::has_shared_from_this::type() ); + #endif // _MSC_VER + }; + + serializers.unique_ptr = + [&](void * arptr, void const * dptr, std::type_info const & baseInfo) + { + Archive & ar = *static_cast(arptr); + writeMetadata(ar); + + std::unique_ptr> const ptr( PolymorphicCasters::template downcast( dptr, baseInfo ) ); + + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); + }; + + map.insert( { std::move(key), std::move(serializers) } ); + } + }; + + //! Used to help out argument dependent lookup for finding potential overloads + //! of instantiate_polymorphic_binding + struct adl_tag {}; + + //! Tag for init_binding, bind_to_archives and instantiate_polymorphic_binding. + //! For C++14 and below, we must instantiate a unique StaticObject per TU that is + //! otherwise identical -- otherwise we get multiple definition problems (ODR violations). + //! To achieve this, put a tag in an anonymous namespace and use it as a template argument. + //! + //! For C++17, we can use static inline global variables to unify these definitions across + //! all TUs in the same shared object (DLL). The tag is therefore not necessary. + //! For convenience, keep it to not complicate other code, but don't put it in + //! an anonymous namespace. Now the template instantiations will correspond + //! to the same type, and since they are marked inline with C++17, they will be merged + //! across all TUs. +#ifdef CEREAL_HAS_CPP17 + struct polymorphic_binding_tag {}; +#else + namespace { struct polymorphic_binding_tag {}; } +#endif + + + //! Causes the static object bindings between an archive type and a serializable type T + template + struct create_bindings + { + static const InputBindingCreator & + load(std::true_type) + { + return cereal::detail::StaticObject>::getInstance(); + } + + static const OutputBindingCreator & + save(std::true_type) + { + return cereal::detail::StaticObject>::getInstance(); + } + + inline static void load(std::false_type) {} + inline static void save(std::false_type) {} + }; + + //! When specialized, causes the compiler to instantiate its parameter + template + struct instantiate_function {}; + + /*! This struct is used as the return type of instantiate_polymorphic_binding + for specific Archive types. When the compiler looks for overloads of + instantiate_polymorphic_binding, it will be forced to instantiate this + struct during overload resolution, even though it will not be part of a valid + overload */ + template + struct polymorphic_serialization_support + { + #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) + //! Creates the appropriate bindings depending on whether the archive supports + //! saving or loading + virtual CEREAL_DLL_EXPORT void instantiate() CEREAL_USED; + #else // NOT _MSC_VER + //! Creates the appropriate bindings depending on whether the archive supports + //! saving or loading + static CEREAL_DLL_EXPORT void instantiate() CEREAL_USED; + //! This typedef causes the compiler to instantiate this static function + typedef instantiate_function unused; + #endif // _MSC_VER + }; + + // instantiate implementation + template + CEREAL_DLL_EXPORT void polymorphic_serialization_support::instantiate() + { + create_bindings::save( std::integral_constant::value && + traits::is_output_serializable::value>{} ); + + create_bindings::load( std::integral_constant::value && + traits::is_input_serializable::value>{} ); + } + + //! Begins the binding process of a type to all registered archives + /*! Archives need to be registered prior to this struct being instantiated via + the CEREAL_REGISTER_ARCHIVE macro. Overload resolution will then force + several static objects to be made that allow us to bind together all + registered archive types with the parameter type T. */ + template + struct bind_to_archives + { + //! Binding for non abstract types + void bind(std::false_type) const + { + instantiate_polymorphic_binding(static_cast(nullptr), 0, Tag{}, adl_tag{}); + } + + //! Binding for abstract types + void bind(std::true_type) const + { } + + //! Binds the type T to all registered archives + /*! If T is abstract, we will not serialize it and thus + do not need to make a binding */ + bind_to_archives const & bind() const + { + static_assert( std::is_polymorphic::value, + "Attempting to register non polymorphic type" ); + bind( std::is_abstract() ); + return *this; + } + }; + + //! Used to hide the static object used to bind T to registered archives + template + struct init_binding; + + //! Base case overload for instantiation + /*! This will end up always being the best overload due to the second + parameter always being passed as an int. All other overloads will + accept pointers to archive types and have lower precedence than int. + + Since the compiler needs to check all possible overloads, the + other overloads created via CEREAL_REGISTER_ARCHIVE, which will have + lower precedence due to requiring a conversion from int to (Archive*), + will cause their return types to be instantiated through the static object + mechanisms even though they are never called. + + See the documentation for the other functions to try and understand this */ + template + void instantiate_polymorphic_binding( T*, int, BindingTag, adl_tag ) {} + } // namespace detail +} // namespace cereal + +#endif // CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp new file mode 100644 index 000000000..83ae7fad5 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp @@ -0,0 +1,65 @@ +/*! \file polymorphic_impl_fwd.hpp + \brief Internal polymorphism support forward declarations + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* This code is heavily inspired by the boost serialization implementation by the following authors + + (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt) + + See http://www.boost.org for updates, documentation, and revision history. + + (C) Copyright 2006 David Abrahams - http://www.boost.org. + + See /boost/serialization/export.hpp and /boost/archive/detail/register_archive.hpp for their + implementation. +*/ + +#ifndef CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ +#define CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ + +namespace cereal +{ + namespace detail + { + //! Forward declaration, see polymorphic_impl.hpp for more information + template + struct RegisterPolymorphicCaster; + + //! Forward declaration, see polymorphic_impl.hpp for more information + struct PolymorphicCasters; + + //! Forward declaration, see polymorphic_impl.hpp for more information + template + struct PolymorphicRelation; + } // namespace detail +} // namespace cereal + +#endif // CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/static_object.hpp b/cpp/src/cylon/thridparty/cereal/details/static_object.hpp new file mode 100644 index 000000000..727cf15d0 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/static_object.hpp @@ -0,0 +1,128 @@ +/*! \file static_object.hpp + \brief Internal polymorphism static object support + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_DETAILS_STATIC_OBJECT_HPP_ +#define CEREAL_DETAILS_STATIC_OBJECT_HPP_ + +#include "cylon/thridparty/cereal/macros.hpp" + +#if CEREAL_THREAD_SAFE +#include +#endif + +//! Prevent link optimization from removing non-referenced static objects +/*! Especially for polymorphic support, we create static objects which + may not ever be explicitly referenced. Most linkers will detect this + and remove the code causing various unpleasant runtime errors. These + macros, adopted from Boost (see force_include.hpp) prevent this + (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) */ + +#if defined(_MSC_VER) && !defined(__clang__) +# define CEREAL_DLL_EXPORT __declspec(dllexport) +# define CEREAL_USED +#else // clang or gcc +# define CEREAL_DLL_EXPORT __attribute__ ((visibility("default"))) +# define CEREAL_USED __attribute__ ((__used__)) +#endif + +namespace cereal +{ + namespace detail + { + //! A static, pre-execution object + /*! This class will create a single copy (singleton) of some + type and ensures that merely referencing this type will + cause it to be instantiated and initialized pre-execution. + For example, this is used heavily in the polymorphic pointer + serialization mechanisms to bind various archive types with + different polymorphic classes */ + template + class CEREAL_DLL_EXPORT StaticObject + { + private: + + static T & create() + { + static T t; + //! Forces instantiation at pre-execution time + (void)instance; + return t; + } + + StaticObject( StaticObject const & /*other*/ ) {} + + public: + static T & getInstance() + { + return create(); + } + + //! A class that acts like std::lock_guard + class LockGuard + { + #if CEREAL_THREAD_SAFE + public: + LockGuard(std::mutex & m) : lock(m) {} + private: + std::unique_lock lock; + #else + public: + LockGuard() = default; + LockGuard(LockGuard const &) = default; // prevents implicit copy ctor warning + ~LockGuard() CEREAL_NOEXCEPT {} // prevents variable not used + #endif + }; + + //! Attempts to lock this static object for the current scope + /*! @note This function is a no-op if cereal is not compiled with + thread safety enabled (CEREAL_THREAD_SAFE = 1). + + This function returns an object that holds a lock for + this StaticObject that will release its lock upon destruction. This + call will block until the lock is available. */ + static LockGuard lock() + { + #if CEREAL_THREAD_SAFE + static std::mutex instanceMutex; + return LockGuard{instanceMutex}; + #else + return LockGuard{}; + #endif + } + + private: + static T & instance; + }; + + template T & StaticObject::instance = StaticObject::create(); + } // namespace detail +} // namespace cereal + +#endif // CEREAL_DETAILS_STATIC_OBJECT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/traits.hpp b/cpp/src/cylon/thridparty/cereal/details/traits.hpp new file mode 100644 index 000000000..ae5cabc1f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/traits.hpp @@ -0,0 +1,1411 @@ +/*! \file traits.hpp + \brief Internal type trait support + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_DETAILS_TRAITS_HPP_ +#define CEREAL_DETAILS_TRAITS_HPP_ + +#ifndef __clang__ +#if (__GNUC__ == 4 && __GNUC_MINOR__ <= 7) +#define CEREAL_OLDER_GCC +#endif // gcc 4.7 or earlier +#endif // __clang__ + +#include +#include + +#include "cylon/thridparty/cereal/macros.hpp" +#include "cylon/thridparty/cereal/access.hpp" + +namespace cereal +{ + namespace traits + { + using yes = std::true_type; + using no = std::false_type; + + namespace detail + { + // ###################################################################### + //! Used to delay a static_assert until template instantiation + template + struct delay_static_assert : std::false_type {}; + + // ###################################################################### + // SFINAE Helpers + #ifdef CEREAL_OLDER_GCC // when VS supports better SFINAE, we can use this as the default + template struct Void { typedef void type; }; + #endif // CEREAL_OLDER_GCC + + //! Return type for SFINAE Enablers + enum class sfinae {}; + + // ###################################################################### + // Helper functionality for boolean integral constants and Enable/DisableIf + template struct meta_bool_and : std::integral_constant::value> {}; + template struct meta_bool_and : std::integral_constant {}; + + template struct meta_bool_or : std::integral_constant::value> {}; + template struct meta_bool_or : std::integral_constant {}; + + // workaround needed due to bug in MSVC 2013, see + // http://connect.microsoft.com/VisualStudio/feedback/details/800231/c-11-alias-template-issue + template + struct EnableIfHelper : std::enable_if::value, sfinae> {}; + + template + struct DisableIfHelper : std::enable_if::value, sfinae> {}; + } // namespace detail + + //! Used as the default value for EnableIf and DisableIf template parameters + /*! @relates EnableIf + @relates DisableIf */ + static const detail::sfinae sfinae = {}; + + // ###################################################################### + //! Provides a way to enable a function if conditions are met + /*! This is intended to be used in a near identical fashion to std::enable_if + while being significantly easier to read at the cost of not allowing for as + complicated of a condition. + + This will compile (allow the function) if every condition evaluates to true. + at compile time. This should be used with SFINAE to ensure that at least + one other candidate function works when one fails due to an EnableIf. + + This should be used as the las template parameter to a function as + an unnamed parameter with a default value of cereal::traits::sfinae: + + @code{cpp} + // using by making the last template argument variadic + template ::value> = sfinae> + void func(T t ); + @endcode + + Note that this performs a logical AND of all conditions, so you will need + to construct more complicated requirements with this fact in mind. + + @relates DisableIf + @relates sfinae + @tparam Conditions The conditions which will be logically ANDed to enable the function. */ + template + using EnableIf = typename detail::EnableIfHelper::type; + + // ###################################################################### + //! Provides a way to disable a function if conditions are met + /*! This is intended to be used in a near identical fashion to std::enable_if + while being significantly easier to read at the cost of not allowing for as + complicated of a condition. + + This will compile (allow the function) if every condition evaluates to false. + This should be used with SFINAE to ensure that at least one other candidate + function works when one fails due to a DisableIf. + + This should be used as the las template parameter to a function as + an unnamed parameter with a default value of cereal::traits::sfinae: + + @code{cpp} + // using by making the last template argument variadic + template ::value> = sfinae> + void func(T t ); + @endcode + + This is often used in conjunction with EnableIf to form an enable/disable pair of + overloads. + + Note that this performs a logical AND of all conditions, so you will need + to construct more complicated requirements with this fact in mind. If all conditions + hold, the function will be disabled. + + @relates EnableIf + @relates sfinae + @tparam Conditions The conditions which will be logically ANDed to disable the function. */ + template + using DisableIf = typename detail::DisableIfHelper::type; + + // ###################################################################### + namespace detail + { + template + struct get_output_from_input : no + { + static_assert( detail::delay_static_assert::value, + "Could not find an associated output archive for input archive." ); + }; + + template + struct get_input_from_output : no + { + static_assert( detail::delay_static_assert::value, + "Could not find an associated input archive for output archive." ); + }; + } + + //! Sets up traits that relate an input archive to an output archive + #define CEREAL_SETUP_ARCHIVE_TRAITS(InputArchive, OutputArchive) \ + namespace cereal { namespace traits { namespace detail { \ + template <> struct get_output_from_input \ + { using type = OutputArchive; }; \ + template <> struct get_input_from_output \ + { using type = InputArchive; }; } } } /* end namespaces */ + + // ###################################################################### + //! Used to convert a MAKE_HAS_XXX macro into a versioned variant + #define CEREAL_MAKE_VERSIONED_TEST ,0 + + // ###################################################################### + //! Creates a test for whether a non const member function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param name The name of the function to test for (e.g. serialize, load, save) + @param test_name The name to give the test for the function being tested for (e.g. serialize, versioned_serialize) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #ifdef CEREAL_OLDER_GCC + #define CEREAL_MAKE_HAS_MEMBER_TEST(name, test_name, versioned) \ + template \ + struct has_member_##test_name : no {}; \ + template \ + struct has_member_##test_name(), std::declval() versioned ) ) >::type> : yes {} + #else // NOT CEREAL_OLDER_GCC + #define CEREAL_MAKE_HAS_MEMBER_TEST(name, test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##name##_##versioned##_impl \ + { \ + template \ + static auto test(int) -> decltype( cereal::access::member_##name( std::declval(), std::declval() versioned ), yes()); \ + template \ + static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + }; \ + } /* end namespace detail */ \ + template \ + struct has_member_##test_name : std::integral_constant::value> {} + #endif // NOT CEREAL_OLDER_GCC + + // ###################################################################### + //! Creates a test for whether a non const non-member function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper non-member function for the given archive. */ + #define CEREAL_MAKE_HAS_NON_MEMBER_TEST(test_name, func, versioned) \ + namespace detail \ + { \ + template \ + struct has_non_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( func( std::declval(), std::declval() versioned ), yes()); \ + template \ + static no test( ... ); \ + static const bool value = std::is_same( 0 ) ), yes>::value; \ + }; \ + } /* end namespace detail */ \ + template \ + struct has_non_member_##test_name : std::integral_constant::value> {} + + // ###################################################################### + // Member Serialize + CEREAL_MAKE_HAS_MEMBER_TEST(serialize, serialize,); + + // ###################################################################### + // Member Serialize (versioned) + CEREAL_MAKE_HAS_MEMBER_TEST(serialize, versioned_serialize, CEREAL_MAKE_VERSIONED_TEST); + + // ###################################################################### + // Non Member Serialize + CEREAL_MAKE_HAS_NON_MEMBER_TEST(serialize, CEREAL_SERIALIZE_FUNCTION_NAME,); + + // ###################################################################### + // Non Member Serialize (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_TEST(versioned_serialize, CEREAL_SERIALIZE_FUNCTION_NAME, CEREAL_MAKE_VERSIONED_TEST); + + // ###################################################################### + // Member Load + CEREAL_MAKE_HAS_MEMBER_TEST(load, load,); + + // ###################################################################### + // Member Load (versioned) + CEREAL_MAKE_HAS_MEMBER_TEST(load, versioned_load, CEREAL_MAKE_VERSIONED_TEST); + + // ###################################################################### + // Non Member Load + CEREAL_MAKE_HAS_NON_MEMBER_TEST(load, CEREAL_LOAD_FUNCTION_NAME,); + + // ###################################################################### + // Non Member Load (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_TEST(versioned_load, CEREAL_LOAD_FUNCTION_NAME, CEREAL_MAKE_VERSIONED_TEST); + + // ###################################################################### + #undef CEREAL_MAKE_HAS_NON_MEMBER_TEST + #undef CEREAL_MAKE_HAS_MEMBER_TEST + + // ###################################################################### + //! Creates a test for whether a member save function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param test_name The name to give the test (e.g. save or versioned_save) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #ifdef CEREAL_OLDER_GCC + #define CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##test_name##_impl \ + { \ + template struct test : no {}; \ + template \ + struct test(), \ + std::declval() versioned ) ) >::type> : yes {}; \ + static const bool value = test(); \ + \ + template struct test2 : no {}; \ + template \ + struct test2(), \ + std::declval::type&>() versioned ) ) >::type> : yes {}; \ + static const bool not_const_type = test2(); \ + }; \ + } /* end namespace detail */ + #else /* NOT CEREAL_OLDER_GCC =================================== */ + #define CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( cereal::access::member_save( std::declval(), \ + std::declval() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + \ + template \ + static auto test2(int) -> decltype( cereal::access::member_save_non_const( \ + std::declval(), \ + std::declval::type&>() versioned ), yes()); \ + template static no test2(...); \ + static const bool not_const_type = std::is_same(0)), yes>::value; \ + }; \ + } /* end namespace detail */ + #endif /* NOT CEREAL_OLDER_GCC */ + + // ###################################################################### + // Member Save + CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(save, ) + + template + struct has_member_save : std::integral_constant::value> + { + typedef typename detail::has_member_save_impl check; + static_assert( check::value || !check::not_const_type, + "cereal detected a non-const save. \n " + "save member functions must always be const" ); + }; + + // ###################################################################### + // Member Save (versioned) + CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(versioned_save, CEREAL_MAKE_VERSIONED_TEST) + + template + struct has_member_versioned_save : std::integral_constant::value> + { + typedef typename detail::has_member_versioned_save_impl check; + static_assert( check::value || !check::not_const_type, + "cereal detected a versioned non-const save. \n " + "save member functions must always be const" ); + }; + + // ###################################################################### + #undef CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL + + // ###################################################################### + //! Creates a test for whether a non-member save function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper non-member function for the given archive. + + @param test_name The name to give the test (e.g. save or versioned_save) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #define CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_non_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( CEREAL_SAVE_FUNCTION_NAME( \ + std::declval(), \ + std::declval() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + \ + template \ + static auto test2(int) -> decltype( CEREAL_SAVE_FUNCTION_NAME( \ + std::declval(), \ + std::declval::type&>() versioned ), yes()); \ + template static no test2(...); \ + static const bool not_const_type = std::is_same(0)), yes>::value; \ + }; \ + } /* end namespace detail */ \ + \ + template \ + struct has_non_member_##test_name : std::integral_constant::value> \ + { \ + using check = typename detail::has_non_member_##test_name##_impl; \ + static_assert( check::value || !check::not_const_type, \ + "cereal detected a non-const type parameter in non-member " #test_name ". \n " \ + #test_name " non-member functions must always pass their types as const" ); \ + }; + + // ###################################################################### + // Non Member Save + CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(save, ) + + // ###################################################################### + // Non Member Save (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(versioned_save, CEREAL_MAKE_VERSIONED_TEST) + + // ###################################################################### + #undef CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST + + // ###################################################################### + // Minimal Utilities + namespace detail + { + // Determines if the provided type is an std::string + template struct is_string : std::false_type {}; + + template + struct is_string> : std::true_type {}; + } + + // Determines if the type is valid for use with a minimal serialize function + template + struct is_minimal_type : std::integral_constant::value || std::is_arithmetic::value> {}; + + // ###################################################################### + //! Creates implementation details for whether a member save_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #ifdef CEREAL_OLDER_GCC + #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##test_name##_impl \ + { \ + template struct test : no {}; \ + template \ + struct test(), \ + std::declval() versioned ) ) >::type> : yes {}; \ + \ + static const bool value = test(); \ + \ + template struct test2 : no {}; \ + template \ + struct test2(), \ + std::declval::type&>() versioned ) ) >::type> : yes {}; \ + static const bool not_const_type = test2(); \ + \ + static const bool valid = value || !not_const_type; \ + }; \ + } /* end namespace detail */ + #else /* NOT CEREAL_OLDER_GCC =================================== */ + #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( cereal::access::member_save_minimal( \ + std::declval(), \ + std::declval() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + \ + template \ + static auto test2(int) -> decltype( cereal::access::member_save_minimal_non_const( \ + std::declval(), \ + std::declval::type&>() versioned ), yes()); \ + template static no test2(...); \ + static const bool not_const_type = std::is_same(0)), yes>::value; \ + \ + static const bool valid = value || !not_const_type; \ + }; \ + } /* end namespace detail */ + #endif // NOT CEREAL_OLDER_GCC + + // ###################################################################### + //! Creates helpers for minimal save functions + /*! The get_member_*_type structs allow access to the return type of a save_minimal, + assuming that the function actually exists. If the function does not + exist, the type will be void. + + @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct get_member_##test_name##_type { using type = void; }; \ + \ + template \ + struct get_member_##test_name##_type \ + { \ + using type = decltype( cereal::access::member_save_minimal( std::declval(), \ + std::declval() versioned ) ); \ + }; \ + } /* end namespace detail */ + + // ###################################################################### + //! Creates a test for whether a member save_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) */ + #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(test_name) \ + template \ + struct has_member_##test_name : std::integral_constant::value> \ + { \ + using check = typename detail::has_member_##test_name##_impl; \ + static_assert( check::valid, \ + "cereal detected a non-const member " #test_name ". \n " \ + #test_name " member functions must always be const" ); \ + \ + using type = typename detail::get_member_##test_name##_type::type; \ + static_assert( (check::value && is_minimal_type::value) || !check::value, \ + "cereal detected a member " #test_name " with an invalid return type. \n " \ + "return type must be arithmetic or string" ); \ + }; + + // ###################################################################### + // Member Save Minimal + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(save_minimal, ) + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(save_minimal, ) + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(save_minimal) + + // ###################################################################### + // Member Save Minimal (versioned) + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) + CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(versioned_save_minimal) + + // ###################################################################### + #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL + #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL + #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST + + // ###################################################################### + //! Creates a test for whether a non-member save_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #define CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_non_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( \ + std::declval(), \ + std::declval() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + \ + template \ + static auto test2(int) -> decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( \ + std::declval(), \ + std::declval::type&>() versioned ), yes()); \ + template static no test2(...); \ + static const bool not_const_type = std::is_same(0)), yes>::value; \ + \ + static const bool valid = value || !not_const_type; \ + }; \ + \ + template \ + struct get_non_member_##test_name##_type { using type = void; }; \ + \ + template \ + struct get_non_member_##test_name##_type \ + { \ + using type = decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( std::declval(), \ + std::declval() versioned ) ); \ + }; \ + } /* end namespace detail */ \ + \ + template \ + struct has_non_member_##test_name : std::integral_constant::value> \ + { \ + using check = typename detail::has_non_member_##test_name##_impl; \ + static_assert( check::valid, \ + "cereal detected a non-const type parameter in non-member " #test_name ". \n " \ + #test_name " non-member functions must always pass their types as const" ); \ + \ + using type = typename detail::get_non_member_##test_name##_type::type; \ + static_assert( (check::value && is_minimal_type::value) || !check::value, \ + "cereal detected a non-member " #test_name " with an invalid return type. \n " \ + "return type must be arithmetic or string" ); \ + }; + + // ###################################################################### + // Non-Member Save Minimal + CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(save_minimal, ) + + // ###################################################################### + // Non-Member Save Minimal (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) + + // ###################################################################### + #undef CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST + + // ###################################################################### + // Load Minimal Utilities + namespace detail + { + //! Used to help strip away conversion wrappers + /*! If someone writes a non-member load/save minimal function that accepts its + parameter as some generic template type and needs to perform trait checks + on that type, our NoConvert wrappers will interfere with this. Using + the struct strip_minmal, users can strip away our wrappers to get to + the underlying type, allowing traits to work properly */ + struct NoConvertBase {}; + + //! A struct that prevents implicit conversion + /*! Any type instantiated with this struct will be unable to implicitly convert + to another type. Is designed to only allow conversion to Source const &. + + @tparam Source the type of the original source */ + template + struct NoConvertConstRef : NoConvertBase + { + using type = Source; //!< Used to get underlying type easily + + template ::value>::type> + operator Dest () = delete; + + //! only allow conversion if the types are the same and we are converting into a const reference + template ::value>::type> + operator Dest const & (); + }; + + //! A struct that prevents implicit conversion + /*! Any type instantiated with this struct will be unable to implicitly convert + to another type. Is designed to only allow conversion to Source &. + + @tparam Source the type of the original source */ + template + struct NoConvertRef : NoConvertBase + { + using type = Source; //!< Used to get underlying type easily + + template ::value>::type> + operator Dest () = delete; + + #ifdef __clang__ + template ::value>::type> + operator Dest const & () = delete; + #endif // __clang__ + + //! only allow conversion if the types are the same and we are converting into a const reference + template ::value>::type> + operator Dest & (); + }; + + //! A type that can implicitly convert to anything else + struct AnyConvert + { + template + operator Dest & (); + + template + operator Dest const & () const; + }; + } // namespace detail + + // ###################################################################### + //! Creates a test for whether a member load_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + Our strategy here is to first check if a function matching the signature more or less exists + (allow anything like load_minimal(xxx) using AnyConvert, and then secondly enforce + that it has the correct signature using NoConvertConstRef + + @param test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #ifdef CEREAL_OLDER_GCC + #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template struct has_member_##test_name##_impl : no {}; \ + template \ + struct has_member_##test_name##_impl(), \ + std::declval(), AnyConvert() versioned ) ) >::type> : yes {}; \ + \ + template struct has_member_##test_name##_type_impl : no {}; \ + template \ + struct has_member_##test_name##_type_impl(), \ + std::declval(), NoConvertConstRef() versioned ) ) >::type> : yes {}; \ + } /* end namespace detail */ + #else /* NOT CEREAL_OLDER_GCC =================================== */ + #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( cereal::access::member_load_minimal( \ + std::declval(), \ + std::declval(), AnyConvert() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + }; \ + template \ + struct has_member_##test_name##_type_impl \ + { \ + template \ + static auto test(int) -> decltype( cereal::access::member_load_minimal( \ + std::declval(), \ + std::declval(), NoConvertConstRef() versioned ), yes()); \ + template static no test(...); \ + static const bool value = std::is_same(0)), yes>::value; \ + \ + }; \ + } /* end namespace detail */ + #endif // NOT CEREAL_OLDER_GCC + + // ###################################################################### + //! Creates helpers for minimal load functions + /*! The has_member_*_wrapper structs ensure that the load and save types for the + requested function type match appropriately. + + @param load_test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) + @param save_test_name The name to give the test (e.g. save_minimal or versioned_save_minimal, + should match the load name. + @param save_test_prefix The name to give the test (e.g. save_minimal or versioned_save_minimal, + should match the load name, without the trailing "_minimal" (e.g. + save or versioned_save). Needed because the preprocessor is an abomination. + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(load_test_name, save_test_name, save_test_prefix, versioned) \ + namespace detail \ + { \ + template \ + struct has_member_##load_test_name##_wrapper : std::false_type {}; \ + \ + template \ + struct has_member_##load_test_name##_wrapper \ + { \ + using AOut = typename detail::get_output_from_input::type; \ + \ + static_assert( has_member_##save_test_prefix##_minimal::value, \ + "cereal detected member " #load_test_name " but no valid member " #save_test_name ". \n " \ + "cannot evaluate correctness of " #load_test_name " without valid " #save_test_name "." ); \ + \ + using SaveType = typename detail::get_member_##save_test_prefix##_minimal_type::type; \ + const static bool value = has_member_##load_test_name##_impl::value; \ + const static bool valid = has_member_##load_test_name##_type_impl::value; \ + \ + static_assert( valid || !value, "cereal detected different or invalid types in corresponding member " \ + #load_test_name " and " #save_test_name " functions. \n " \ + "the paramater to " #load_test_name " must be a constant reference to the type that " \ + #save_test_name " returns." ); \ + }; \ + } /* end namespace detail */ + + // ###################################################################### + //! Creates a test for whether a member load_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + @param load_test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) + @param load_test_prefix The above parameter minus the trailing "_minimal" */ + #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(load_test_name, load_test_prefix) \ + template \ + struct has_member_##load_test_prefix##_minimal : std::integral_constant::value>::value> {}; + + // ###################################################################### + // Member Load Minimal + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(load_minimal, ) + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(load_minimal, save_minimal, save, ) + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(load_minimal, load) + + // ###################################################################### + // Member Load Minimal (versioned) + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(versioned_load_minimal, CEREAL_MAKE_VERSIONED_TEST) + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(versioned_load_minimal, versioned_save_minimal, versioned_save, CEREAL_MAKE_VERSIONED_TEST) + CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(versioned_load_minimal, versioned_load) + + // ###################################################################### + #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL + #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL + #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST + + // ###################################################################### + // Non-Member Load Minimal + namespace detail + { + #ifdef CEREAL_OLDER_GCC + void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(); // prevents nonsense complaining about not finding this + void CEREAL_SAVE_MINIMAL_FUNCTION_NAME(); + #endif // CEREAL_OLDER_GCC + } // namespace detail + + // ###################################################################### + //! Creates a test for whether a non-member load_minimal function exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper member function for the given archive. + + See notes from member load_minimal implementation. + + Note that there should be an additional const check on load_minimal after the valid check, + but this currently interferes with many valid uses of minimal serialization. It has been + removed (see #565 on github) and previously was: + + @code + static_assert( check::const_valid || !check::exists, + "cereal detected an invalid serialization type parameter in non-member " #test_name ". " + #test_name " non-member functions must accept their serialization type by non-const reference" ); + @endcode + + See #132, #436, #263, and #565 on https://github.com/USCiLab/cereal for more details. + + @param test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) + @param save_name The corresponding name the save test would have (e.g. save_minimal or versioned_save_minimal) + @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ + #define CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(test_name, save_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_non_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ + std::declval(), std::declval(), AnyConvert() versioned ), yes() ); \ + template static no test( ... ); \ + static const bool exists = std::is_same( 0 ) ), yes>::value; \ + \ + template \ + static auto test2(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ + std::declval(), std::declval(), NoConvertConstRef() versioned ), yes() ); \ + template static no test2( ... ); \ + static const bool valid = std::is_same( 0 ) ), yes>::value; \ + \ + template \ + static auto test3(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ + std::declval(), NoConvertRef(), AnyConvert() versioned ), yes() ); \ + template static no test3( ... ); \ + static const bool const_valid = std::is_same( 0 ) ), yes>::value; \ + }; \ + \ + template \ + struct has_non_member_##test_name##_wrapper : std::false_type {}; \ + \ + template \ + struct has_non_member_##test_name##_wrapper \ + { \ + using AOut = typename detail::get_output_from_input::type; \ + \ + static_assert( detail::has_non_member_##save_name##_impl::valid, \ + "cereal detected non-member " #test_name " but no valid non-member " #save_name ". \n " \ + "cannot evaluate correctness of " #test_name " without valid " #save_name "." ); \ + \ + using SaveType = typename detail::get_non_member_##save_name##_type::type; \ + using check = has_non_member_##test_name##_impl; \ + static const bool value = check::exists; \ + \ + static_assert( check::valid || !check::exists, "cereal detected different types in corresponding non-member " \ + #test_name " and " #save_name " functions. \n " \ + "the paramater to " #test_name " must be a constant reference to the type that " #save_name " returns." ); \ + }; \ + } /* namespace detail */ \ + \ + template \ + struct has_non_member_##test_name : std::integral_constant::exists>::value> {}; + + // ###################################################################### + // Non-Member Load Minimal + CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(load_minimal, save_minimal, ) + + // ###################################################################### + // Non-Member Load Minimal (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(versioned_load_minimal, versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) + + // ###################################################################### + #undef CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST + + // ###################################################################### + namespace detail + { + // const stripped away before reaching here, prevents errors on conversion from + // construct to construct + template + struct has_member_load_and_construct_impl : std::integral_constant( std::declval(), std::declval< ::cereal::construct&>() ) ), void>::value> + { }; + + template + struct has_member_versioned_load_and_construct_impl : std::integral_constant( std::declval(), std::declval< ::cereal::construct&>(), 0 ) ), void>::value> + { }; + } // namespace detail + + //! Member load and construct check + template + struct has_member_load_and_construct : detail::has_member_load_and_construct_impl::type, A> + { }; + + //! Member load and construct check (versioned) + template + struct has_member_versioned_load_and_construct : detail::has_member_versioned_load_and_construct_impl::type, A> + { }; + + // ###################################################################### + //! Creates a test for whether a non-member load_and_construct specialization exists + /*! This creates a class derived from std::integral_constant that will be true if + the type has the proper non-member function for the given archive. */ + #define CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(test_name, versioned) \ + namespace detail \ + { \ + template \ + struct has_non_member_##test_name##_impl \ + { \ + template \ + static auto test(int) -> decltype( LoadAndConstruct::load_and_construct( \ + std::declval(), std::declval< ::cereal::construct&>() versioned ), yes()); \ + template \ + static no test( ... ); \ + static const bool value = std::is_same( 0 ) ), yes>::value; \ + }; \ + } /* end namespace detail */ \ + template \ + struct has_non_member_##test_name : \ + std::integral_constant::type, A>::value> {}; + + // ###################################################################### + //! Non member load and construct check + CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(load_and_construct, ) + + // ###################################################################### + //! Non member load and construct check (versioned) + CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(versioned_load_and_construct, CEREAL_MAKE_VERSIONED_TEST) + + // ###################################################################### + //! Has either a member or non member load and construct + template + struct has_load_and_construct : std::integral_constant::value || has_non_member_load_and_construct::value || + has_member_versioned_load_and_construct::value || has_non_member_versioned_load_and_construct::value> + { }; + + // ###################################################################### + #undef CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST + + // ###################################################################### + // End of serialization existence tests + #undef CEREAL_MAKE_VERSIONED_TEST + + // ###################################################################### + template + struct has_member_split : std::integral_constant::value && has_member_save::value) || + (has_member_versioned_load::value && has_member_versioned_save::value)> {}; + + // ###################################################################### + template + struct has_non_member_split : std::integral_constant::value && has_non_member_save::value) || + (has_non_member_versioned_load::value && has_non_member_versioned_save::value)> {}; + + // ###################################################################### + template + struct has_invalid_output_versioning : std::integral_constant::value && has_member_save::value) || + (has_non_member_versioned_save::value && has_non_member_save::value) || + (has_member_versioned_serialize::value && has_member_serialize::value) || + (has_non_member_versioned_serialize::value && has_non_member_serialize::value) || + (has_member_versioned_save_minimal::value && has_member_save_minimal::value) || + (has_non_member_versioned_save_minimal::value && has_non_member_save_minimal::value)> {}; + + // ###################################################################### + template + struct has_invalid_input_versioning : std::integral_constant::value && has_member_load::value) || + (has_non_member_versioned_load::value && has_non_member_load::value) || + (has_member_versioned_serialize::value && has_member_serialize::value) || + (has_non_member_versioned_serialize::value && has_non_member_serialize::value) || + (has_member_versioned_load_minimal::value && has_member_load_minimal::value) || + (has_non_member_versioned_load_minimal::value && has_non_member_load_minimal::value)> {}; + + // ###################################################################### + namespace detail + { + //! Create a test for a cereal::specialization entry + #define CEREAL_MAKE_IS_SPECIALIZED_IMPL(name) \ + template \ + struct is_specialized_##name : std::integral_constant>::value> {} + + CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_serialize); + CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_load_save); + CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_load_save_minimal); + CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_serialize); + CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_load_save); + CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_load_save_minimal); + + #undef CEREAL_MAKE_IS_SPECIALIZED_IMPL + + //! Number of specializations detected + template + struct count_specializations : std::integral_constant::value + + is_specialized_member_load_save::value + + is_specialized_member_load_save_minimal::value + + is_specialized_non_member_serialize::value + + is_specialized_non_member_load_save::value + + is_specialized_non_member_load_save_minimal::value> {}; + } // namespace detail + + //! Check if any specialization exists for a type + template + struct is_specialized : std::integral_constant::value || + detail::is_specialized_member_load_save::value || + detail::is_specialized_member_load_save_minimal::value || + detail::is_specialized_non_member_serialize::value || + detail::is_specialized_non_member_load_save::value || + detail::is_specialized_non_member_load_save_minimal::value> + { + static_assert(detail::count_specializations::value <= 1, "More than one explicit specialization detected for type."); + }; + + //! Create the static assertion for some specialization + /*! This assertion will fail if the type is indeed specialized and does not have the appropriate + type of serialization functions */ + #define CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, print_name, spec_name) \ + static_assert( (is_specialized::value && detail::is_specialized_##spec_name::value && \ + (has_##name::value || has_##versioned_name::value)) \ + || !(is_specialized::value && detail::is_specialized_##spec_name::value), \ + "cereal detected " #print_name " specialization but no " #print_name " serialize function" ) + + //! Generates a test for specialization for versioned and unversioned functions + /*! This creates checks that can be queried to see if a given type of serialization function + has been specialized for this type */ + #define CEREAL_MAKE_IS_SPECIALIZED(name, versioned_name, spec_name) \ + template \ + struct is_specialized_##name : std::integral_constant::value && detail::is_specialized_##spec_name::value> \ + { CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, name, spec_name); }; \ + template \ + struct is_specialized_##versioned_name : std::integral_constant::value && detail::is_specialized_##spec_name::value> \ + { CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, versioned_name, spec_name); } + + CEREAL_MAKE_IS_SPECIALIZED(member_serialize, member_versioned_serialize, member_serialize); + CEREAL_MAKE_IS_SPECIALIZED(non_member_serialize, non_member_versioned_serialize, non_member_serialize); + + CEREAL_MAKE_IS_SPECIALIZED(member_save, member_versioned_save, member_load_save); + CEREAL_MAKE_IS_SPECIALIZED(non_member_save, non_member_versioned_save, non_member_load_save); + CEREAL_MAKE_IS_SPECIALIZED(member_load, member_versioned_load, member_load_save); + CEREAL_MAKE_IS_SPECIALIZED(non_member_load, non_member_versioned_load, non_member_load_save); + + CEREAL_MAKE_IS_SPECIALIZED(member_save_minimal, member_versioned_save_minimal, member_load_save_minimal); + CEREAL_MAKE_IS_SPECIALIZED(non_member_save_minimal, non_member_versioned_save_minimal, non_member_load_save_minimal); + CEREAL_MAKE_IS_SPECIALIZED(member_load_minimal, member_versioned_load_minimal, member_load_save_minimal); + CEREAL_MAKE_IS_SPECIALIZED(non_member_load_minimal, non_member_versioned_load_minimal, non_member_load_save_minimal); + + #undef CEREAL_MAKE_IS_SPECIALIZED_ASSERT + #undef CEREAL_MAKE_IS_SPECIALIZED + + // ###################################################################### + // detects if a type has any active minimal output serialization + template + struct has_minimal_output_serialization : std::integral_constant::value || + ((has_member_save_minimal::value || + has_non_member_save_minimal::value || + has_member_versioned_save_minimal::value || + has_non_member_versioned_save_minimal::value) && + !(is_specialized_member_serialize::value || + is_specialized_member_save::value))> {}; + + // ###################################################################### + // detects if a type has any active minimal input serialization + template + struct has_minimal_input_serialization : std::integral_constant::value || + ((has_member_load_minimal::value || + has_non_member_load_minimal::value || + has_member_versioned_load_minimal::value || + has_non_member_versioned_load_minimal::value) && + !(is_specialized_member_serialize::value || + is_specialized_member_load::value))> {}; + + // ###################################################################### + namespace detail + { + //! The number of output serialization functions available + /*! If specialization is being used, we'll count only those; otherwise we'll count everything */ + template + struct count_output_serializers : std::integral_constant::value ? count_specializations::value : + has_member_save::value + + has_non_member_save::value + + has_member_serialize::value + + has_non_member_serialize::value + + has_member_save_minimal::value + + has_non_member_save_minimal::value + + /*-versioned---------------------------------------------------------*/ + has_member_versioned_save::value + + has_non_member_versioned_save::value + + has_member_versioned_serialize::value + + has_non_member_versioned_serialize::value + + has_member_versioned_save_minimal::value + + has_non_member_versioned_save_minimal::value> {}; + } + + template + struct is_output_serializable : std::integral_constant::value == 1> {}; + + // ###################################################################### + namespace detail + { + //! The number of input serialization functions available + /*! If specialization is being used, we'll count only those; otherwise we'll count everything */ + template + struct count_input_serializers : std::integral_constant::value ? count_specializations::value : + has_member_load::value + + has_non_member_load::value + + has_member_serialize::value + + has_non_member_serialize::value + + has_member_load_minimal::value + + has_non_member_load_minimal::value + + /*-versioned---------------------------------------------------------*/ + has_member_versioned_load::value + + has_non_member_versioned_load::value + + has_member_versioned_serialize::value + + has_non_member_versioned_serialize::value + + has_member_versioned_load_minimal::value + + has_non_member_versioned_load_minimal::value> {}; + } + + template + struct is_input_serializable : std::integral_constant::value == 1> {}; + + // ###################################################################### + // Base Class Support + namespace detail + { + struct base_class_id + { + template + base_class_id(T const * const t) : + type(typeid(T)), + ptr(t), + hash(std::hash()(typeid(T)) ^ (std::hash()(t) << 1)) + { } + + bool operator==(base_class_id const & other) const + { return (type == other.type) && (ptr == other.ptr); } + + std::type_index type; + void const * ptr; + size_t hash; + }; + struct base_class_id_hash { size_t operator()(base_class_id const & id) const { return id.hash; } }; + } // namespace detail + + namespace detail + { + //! Common base type for base class casting + struct BaseCastBase {}; + + template + struct get_base_class; + + template class Cast, class Base> + struct get_base_class> + { + using type = Base; + }; + + //! Base class cast, behave as the test + template class Test, class Archive, + bool IsBaseCast = std::is_base_of::value> + struct has_minimal_base_class_serialization_impl : Test::type, Archive> + { }; + + //! Not a base class cast + template class Test, class Archive> + struct has_minimal_base_class_serialization_impl : std::false_type + { }; + } + + //! Checks to see if the base class used in a cast has a minimal serialization + /*! @tparam Cast Either base_class or virtual_base_class wrapped type + @tparam Test A has_minimal test (for either input or output) + @tparam Archive The archive to use with the test */ + template class Test, class Archive> + struct has_minimal_base_class_serialization : detail::has_minimal_base_class_serialization_impl + { }; + + + // ###################################################################### + namespace detail + { + struct shared_from_this_wrapper + { + template + static auto (check)( U const & t ) -> decltype( ::cereal::access::shared_from_this(t), std::true_type() ); + + static auto (check)( ... ) -> decltype( std::false_type() ); + + template + static auto get( U const & t ) -> decltype( t.shared_from_this() ); + }; + } + + //! Determine if T or any base class of T has inherited from std::enable_shared_from_this + template + struct has_shared_from_this : decltype((detail::shared_from_this_wrapper::check)(std::declval())) + { }; + + //! Get the type of the base class of T which inherited from std::enable_shared_from_this + template + struct get_shared_from_this_base + { + private: + using PtrType = decltype(detail::shared_from_this_wrapper::get(std::declval())); + public: + //! The type of the base of T that inherited from std::enable_shared_from_this + using type = typename std::decay::type; + }; + + // ###################################################################### + //! Extracts the true type from something possibly wrapped in a cereal NoConvert + /*! Internally cereal uses some wrapper classes to test the validity of non-member + minimal load and save functions. This can interfere with user type traits on + templated load and save minimal functions. To get to the correct underlying type, + users should use strip_minimal when performing any enable_if type type trait checks. + + See the enum serialization in types/common.hpp for an example of using this */ + template ::value> + struct strip_minimal + { + using type = T; + }; + + //! Specialization for types wrapped in a NoConvert + template + struct strip_minimal + { + using type = typename T::type; + }; + + // ###################################################################### + //! Determines whether the class T can be default constructed by cereal::access + template + struct is_default_constructible + { + #ifdef CEREAL_OLDER_GCC + template + struct test : no {}; + template + struct test() ) >::type> : yes {}; + static const bool value = test(); + #else // NOT CEREAL_OLDER_GCC ========================================= + template + static auto test(int) -> decltype( cereal::access::construct(), yes()); + template + static no test(...); + static const bool value = std::is_same(0)), yes>::value; + #endif // NOT CEREAL_OLDER_GCC + }; + + // ###################################################################### + namespace detail + { + //! Removes all qualifiers and minimal wrappers from an archive + template + using decay_archive = typename std::decay::type>::type; + } + + //! Checks if the provided archive type is equal to some cereal archive type + /*! This automatically does things such as std::decay and removing any other wrappers that may be + on the Archive template parameter. + + Example use: + @code{cpp} + // example use to disable a serialization function + template ::value> = sfinae> + void save( Archive & ar, MyType const & mt ); + @endcode */ + template + struct is_same_archive : std::integral_constant, CerealArchiveT>::value> + { }; + + // ###################################################################### + //! A macro to use to restrict which types of archives your function will work for. + /*! This requires you to have a template class parameter named Archive and replaces the void return + type for your function. + + INTYPE refers to the input archive type you wish to restrict on. + OUTTYPE refers to the output archive type you wish to restrict on. + + For example, if we want to limit a serialize to only work with binary serialization: + + @code{.cpp} + template + CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) + serialize( Archive & ar, MyCoolType & m ) + { + ar & m; + } + @endcode + + If you need to do more restrictions in your enable_if, you will need to do this by hand. + */ + #define CEREAL_ARCHIVE_RESTRICT(INTYPE, OUTTYPE) \ + typename std::enable_if::value || cereal::traits::is_same_archive::value, void>::type + + //! Type traits only struct used to mark an archive as human readable (text based) + /*! Archives that wish to identify as text based/human readable should inherit from + this struct */ + struct TextArchive {}; + + //! Checks if an archive is a text archive (human readable) + template + struct is_text_archive : std::integral_constant>::value> + { }; + } // namespace traits + + // ###################################################################### + namespace detail + { + template ::value, + bool MemberVersioned = traits::has_member_versioned_load_and_construct::value, + bool NonMember = traits::has_non_member_load_and_construct::value, + bool NonMemberVersioned = traits::has_non_member_versioned_load_and_construct::value> + struct Construct + { + static_assert( cereal::traits::detail::delay_static_assert::value, + "cereal found more than one compatible load_and_construct function for the provided type and archive combination. \n\n " + "Types must either have a member load_and_construct function or a non-member specialization of LoadAndConstruct (you may not mix these). \n " + "In addition, you may not mix versioned with non-versioned load_and_construct functions. \n\n " ); + static T * load_andor_construct( A & /*ar*/, construct & /*construct*/ ) + { return nullptr; } + }; + + // no load and construct case + template + struct Construct + { + static_assert( ::cereal::traits::is_default_constructible::value, + "Trying to serialize a an object with no default constructor. \n\n " + "Types must either be default constructible or define either a member or non member Construct function. \n " + "Construct functions generally have the signature: \n\n " + "template \n " + "static void load_and_construct(Archive & ar, cereal::construct & construct) \n " + "{ \n " + " var a; \n " + " ar( a ) \n " + " construct( a ); \n " + "} \n\n" ); + static T * load_andor_construct() + { return ::cereal::access::construct(); } + }; + + // member non-versioned + template + struct Construct + { + static void load_andor_construct( A & ar, construct & construct ) + { + access::load_and_construct( ar, construct ); + } + }; + + // member versioned + template + struct Construct + { + static void load_andor_construct( A & ar, construct & construct ) + { + const auto version = ar.template loadClassVersion(); + access::load_and_construct( ar, construct, version ); + } + }; + + // non-member non-versioned + template + struct Construct + { + static void load_andor_construct( A & ar, construct & construct ) + { + LoadAndConstruct::load_and_construct( ar, construct ); + } + }; + + // non-member versioned + template + struct Construct + { + static void load_andor_construct( A & ar, construct & construct ) + { + const auto version = ar.template loadClassVersion(); + LoadAndConstruct::load_and_construct( ar, construct, version ); + } + }; + } // namespace detail +} // namespace cereal + +#endif // CEREAL_DETAILS_TRAITS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/util.hpp b/cpp/src/cylon/thridparty/cereal/details/util.hpp new file mode 100644 index 000000000..e4aebe91c --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/details/util.hpp @@ -0,0 +1,84 @@ +/*! \file util.hpp + \brief Internal misc utilities + \ingroup Internal */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_DETAILS_UTIL_HPP_ +#define CEREAL_DETAILS_UTIL_HPP_ + +#include +#include + +#ifdef _MSC_VER +namespace cereal +{ + namespace util + { + //! Demangles the type encoded in a string + /*! @internal */ + inline std::string demangle( std::string const & name ) + { return name; } + + //! Gets the demangled name of a type + /*! @internal */ + template inline + std::string demangledName() + { return typeid( T ).name(); } + } // namespace util +} // namespace cereal +#else // clang or gcc +#include +#include +namespace cereal +{ + namespace util + { + //! Demangles the type encoded in a string + /*! @internal */ + inline std::string demangle(std::string mangledName) + { + int status = 0; + char *demangledName = nullptr; + std::size_t len; + + demangledName = abi::__cxa_demangle(mangledName.c_str(), 0, &len, &status); + + std::string retName(demangledName); + free(demangledName); + + return retName; + } + + //! Gets the demangled name of a type + /*! @internal */ + template inline + std::string demangledName() + { return demangle(typeid(T).name()); } + } +} // namespace cereal +#endif // clang or gcc branch of _MSC_VER +#endif // CEREAL_DETAILS_UTIL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/external/LICENSE b/cpp/src/cylon/thridparty/cereal/external/LICENSE new file mode 100644 index 000000000..66300b68b --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/LICENSE @@ -0,0 +1,21 @@ +Copyright (C) 2004-2008 René Nyffenegger + +This source code is provided 'as-is', without any express or implied +warranty. In no event will the author be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + +3. This notice may not be removed or altered from any source distribution. + +René Nyffenegger rene.nyffenegger@adp-gmbh.ch diff --git a/cpp/src/cylon/thridparty/cereal/external/base64.hpp b/cpp/src/cylon/thridparty/cereal/external/base64.hpp new file mode 100644 index 000000000..ce32324f6 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/base64.hpp @@ -0,0 +1,134 @@ +/* + Copyright (C) 2004-2008 René Nyffenegger + + This source code is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + + 3. This notice may not be removed or altered from any source distribution. + + René Nyffenegger rene.nyffenegger@adp-gmbh.ch +*/ + +#ifndef CEREAL_EXTERNAL_BASE64_HPP_ +#define CEREAL_EXTERNAL_BASE64_HPP_ + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + +#include + +namespace cereal +{ + namespace base64 + { + static const std::string chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + static inline bool is_base64(unsigned char c) { + return (isalnum(c) || (c == '+') || (c == '/')); + } + + inline std::string encode(unsigned char const* bytes_to_encode, size_t in_len) { + std::string ret; + int i = 0; + int j = 0; + unsigned char char_array_3[3]; + unsigned char char_array_4[4]; + + while (in_len--) { + char_array_3[i++] = *(bytes_to_encode++); + if (i == 3) { + char_array_4[0] = static_cast((char_array_3[0] & 0xfc) >> 2); + char_array_4[1] = static_cast( ( ( char_array_3[0] & 0x03 ) << 4 ) + ( ( char_array_3[1] & 0xf0 ) >> 4 ) ); + char_array_4[2] = static_cast( ( ( char_array_3[1] & 0x0f ) << 2 ) + ( ( char_array_3[2] & 0xc0 ) >> 6 ) ); + char_array_4[3] = static_cast( char_array_3[2] & 0x3f ); + + for(i = 0; (i <4) ; i++) + ret += chars[char_array_4[i]]; + i = 0; + } + } + + if (i) + { + for(j = i; j < 3; j++) + char_array_3[j] = '\0'; + + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for (j = 0; (j < i + 1); j++) + ret += chars[char_array_4[j]]; + + while((i++ < 3)) + ret += '='; + } + + return ret; + } + + inline std::string decode(std::string const& encoded_string) { + size_t in_len = encoded_string.size(); + size_t i = 0; + size_t j = 0; + int in_ = 0; + unsigned char char_array_4[4], char_array_3[3]; + std::string ret; + + while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { + char_array_4[i++] = encoded_string[in_]; in_++; + if (i ==4) { + for (i = 0; i <4; i++) + char_array_4[i] = static_cast(chars.find( char_array_4[i] )); + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (i = 0; (i < 3); i++) + ret += char_array_3[i]; + i = 0; + } + } + + if (i) { + for (j = i; j <4; j++) + char_array_4[j] = 0; + + for (j = 0; j <4; j++) + char_array_4[j] = static_cast(chars.find( char_array_4[j] )); + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; + } + + return ret; + } + } // namespace base64 +} // namespace cereal +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#endif // CEREAL_EXTERNAL_BASE64_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE b/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE new file mode 100644 index 000000000..4546f15a2 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE @@ -0,0 +1,13 @@ +Tencent is pleased to support the open source community by making RapidJSON available. + +Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. + +Licensed under the MIT License (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at + +http://opensource.org/licenses/MIT + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h new file mode 100644 index 000000000..d375e28a1 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h @@ -0,0 +1,284 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ALLOCATORS_H_ +#define CEREAL_RAPIDJSON_ALLOCATORS_H_ + +#include "rapidjson.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Allocator + +/*! \class rapidjson::Allocator + \brief Concept for allocating, resizing and freeing memory block. + + Note that Malloc() and Realloc() are non-static but Free() is static. + + So if an allocator need to support Free(), it needs to put its pointer in + the header of memory block. + +\code +concept Allocator { + static const bool kNeedFree; //!< Whether this allocator needs to call Free(). + + // Allocate a memory block. + // \param size of the memory block in bytes. + // \returns pointer to the memory block. + void* Malloc(size_t size); + + // Resize a memory block. + // \param originalPtr The pointer to current memory block. Null pointer is permitted. + // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) + // \param newSize the new size in bytes. + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); + + // Free a memory block. + // \param pointer to the memory block. Null pointer is permitted. + static void Free(void *ptr); +}; +\endcode +*/ + + +/*! \def CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief User-defined kDefaultChunkCapacity definition. + + User can define this as any \c size that is a power of 2. +*/ + +#ifndef CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY +#define CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024) +#endif + + +/////////////////////////////////////////////////////////////////////////////// +// CrtAllocator + +//! C-runtime library allocator. +/*! This class is just wrapper for standard C library memory routines. + \note implements Allocator concept +*/ +class CrtAllocator { +public: + static const bool kNeedFree = true; + void* Malloc(size_t size) { + if (size) // behavior of malloc(0) is implementation defined. + return std::malloc(size); + else + return NULL; // standardize to returning NULL. + } + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + (void)originalSize; + if (newSize == 0) { + std::free(originalPtr); + return NULL; + } + return std::realloc(originalPtr, newSize); + } + static void Free(void *ptr) { std::free(ptr); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// MemoryPoolAllocator + +//! Default memory allocator used by the parser and DOM. +/*! This allocator allocate memory blocks from pre-allocated memory chunks. + + It does not free memory blocks. And Realloc() only allocate new memory. + + The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. + + User may also supply a buffer as the first chunk. + + If the user-buffer is full then additional chunks are allocated by BaseAllocator. + + The user-buffer is not deallocated by this allocator. + + \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. + \note implements Allocator concept +*/ +template +class MemoryPoolAllocator { +public: + static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) + + //! Constructor with chunkSize. + /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0) + { + } + + //! Constructor with user-supplied buffer. + /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. + + The user buffer will not be deallocated when this allocator is destructed. + + \param buffer User supplied buffer. + \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). + \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0) + { + CEREAL_RAPIDJSON_ASSERT(buffer != 0); + CEREAL_RAPIDJSON_ASSERT(size > sizeof(ChunkHeader)); + chunkHead_ = reinterpret_cast(buffer); + chunkHead_->capacity = size - sizeof(ChunkHeader); + chunkHead_->size = 0; + chunkHead_->next = 0; + } + + //! Destructor. + /*! This deallocates all memory chunks, excluding the user-supplied buffer. + */ + ~MemoryPoolAllocator() { + Clear(); + CEREAL_RAPIDJSON_DELETE(ownBaseAllocator_); + } + + //! Deallocates all memory chunks, excluding the user-supplied buffer. + void Clear() { + while (chunkHead_ && chunkHead_ != userBuffer_) { + ChunkHeader* next = chunkHead_->next; + baseAllocator_->Free(chunkHead_); + chunkHead_ = next; + } + if (chunkHead_ && chunkHead_ == userBuffer_) + chunkHead_->size = 0; // Clear user buffer + } + + //! Computes the total capacity of allocated memory chunks. + /*! \return total capacity in bytes. + */ + size_t Capacity() const { + size_t capacity = 0; + for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) + capacity += c->capacity; + return capacity; + } + + //! Computes the memory blocks allocated. + /*! \return total used bytes. + */ + size_t Size() const { + size_t size = 0; + for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) + size += c->size; + return size; + } + + //! Allocates a memory block. (concept Allocator) + void* Malloc(size_t size) { + if (!size) + return NULL; + + size = CEREAL_RAPIDJSON_ALIGN(size); + if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity) + if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size)) + return NULL; + + void *buffer = reinterpret_cast(chunkHead_) + CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size; + chunkHead_->size += size; + return buffer; + } + + //! Resizes a memory block (concept Allocator) + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + if (originalPtr == 0) + return Malloc(newSize); + + if (newSize == 0) + return NULL; + + originalSize = CEREAL_RAPIDJSON_ALIGN(originalSize); + newSize = CEREAL_RAPIDJSON_ALIGN(newSize); + + // Do not shrink if new size is smaller than original + if (originalSize >= newSize) + return originalPtr; + + // Simply expand it if it is the last allocation and there is sufficient space + if (originalPtr == reinterpret_cast(chunkHead_) + CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size - originalSize) { + size_t increment = static_cast(newSize - originalSize); + if (chunkHead_->size + increment <= chunkHead_->capacity) { + chunkHead_->size += increment; + return originalPtr; + } + } + + // Realloc process: allocate and copy memory, do not free original buffer. + if (void* newBuffer = Malloc(newSize)) { + if (originalSize) + std::memcpy(newBuffer, originalPtr, originalSize); + return newBuffer; + } + else + return NULL; + } + + //! Frees a memory block (concept Allocator) + static void Free(void *ptr) { (void)ptr; } // Do nothing + +private: + //! Copy constructor is not permitted. + MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */; + //! Copy assignment operator is not permitted. + MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */; + + //! Creates a new chunk. + /*! \param capacity Capacity of the chunk in bytes. + \return true if success. + */ + bool AddChunk(size_t capacity) { + if (!baseAllocator_) + ownBaseAllocator_ = baseAllocator_ = CEREAL_RAPIDJSON_NEW(BaseAllocator)(); + if (ChunkHeader* chunk = reinterpret_cast(baseAllocator_->Malloc(CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity))) { + chunk->capacity = capacity; + chunk->size = 0; + chunk->next = chunkHead_; + chunkHead_ = chunk; + return true; + } + else + return false; + } + + static const int kDefaultChunkCapacity = CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity. + + //! Chunk header for perpending to each chunk. + /*! Chunks are stored as a singly linked list. + */ + struct ChunkHeader { + size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). + size_t size; //!< Current size of allocated memory in bytes. + ChunkHeader *next; //!< Next chunk in the linked list. + }; + + ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation. + size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. + void *userBuffer_; //!< User supplied buffer. + BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. + BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object. +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_ENCODINGS_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h new file mode 100644 index 000000000..f3d20f7f3 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h @@ -0,0 +1,78 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ +#define CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ + +#include "stream.h" + +#if defined(__GNUC__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code +CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + + +//! Cursor stream wrapper for counting line and column number if error exists. +/*! + \tparam InputStream Any stream that implements Stream Concept +*/ +template > +class CursorStreamWrapper : public GenericStreamWrapper { +public: + typedef typename Encoding::Ch Ch; + + CursorStreamWrapper(InputStream& is): + GenericStreamWrapper(is), line_(1), col_(0) {} + + // counting line and column number + Ch Take() { + Ch ch = this->is_.Take(); + if(ch == '\n') { + line_ ++; + col_ = 0; + } else { + col_ ++; + } + return ch; + } + + //! Get the error line number, if error exists. + size_t GetLine() const { return line_; } + //! Get the error column number, if error exists. + size_t GetColumn() const { return col_; } + +private: + size_t line_; //!< Current Line + size_t col_; //!< Current Column +}; + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#if defined(__GNUC__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h new file mode 100644 index 000000000..91c4be80f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h @@ -0,0 +1,2659 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_DOCUMENT_H_ +#define CEREAL_RAPIDJSON_DOCUMENT_H_ + +/*! \file document.h */ + +#include "reader.h" +#include "internal/meta.h" +#include "internal/strfunc.h" +#include "memorystream.h" +#include "encodedstream.h" +#include // placement new +#include +#ifdef __cpp_lib_three_way_comparison +#include +#endif + +CEREAL_RAPIDJSON_DIAG_PUSH +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_OFF(padded) +CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +CEREAL_RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif // __GNUC__ + +#ifndef CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS +#include // std::random_access_iterator_tag +#endif + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +// Forward declaration. +template +class GenericValue; + +template +class GenericDocument; + +//! Name-value pair in a JSON object value. +/*! + This class was internal to GenericValue. It used to be a inner struct. + But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. + https://code.google.com/p/rapidjson/issues/detail?id=64 +*/ +template +struct GenericMember { + GenericValue name; //!< name of member (must be a string) + GenericValue value; //!< value of member. + + // swap() for std::sort() and other potential use in STL. + friend inline void swap(GenericMember& a, GenericMember& b) CEREAL_RAPIDJSON_NOEXCEPT { + a.name.Swap(b.name); + a.value.Swap(b.value); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericMemberIterator + +#ifndef CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS + +//! (Constant) member iterator for a JSON object value +/*! + \tparam Const Is this a constant iterator? + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. + + This class implements a Random Access Iterator for GenericMember elements + of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. + + \note This iterator implementation is mainly intended to avoid implicit + conversions from iterator values to \c NULL, + e.g. from GenericValue::FindMember. + + \note Define \c CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a + pointer-based implementation, if your platform doesn't provide + the C++ header. + + \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator + */ +template +class GenericMemberIterator { + + friend class GenericValue; + template friend class GenericMemberIterator; + + typedef GenericMember PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + +public: + //! Iterator type itself + typedef GenericMemberIterator Iterator; + //! Constant iterator type + typedef GenericMemberIterator ConstIterator; + //! Non-constant iterator type + typedef GenericMemberIterator NonConstIterator; + + /** \name std::iterator_traits support */ + //@{ + typedef ValueType value_type; + typedef ValueType * pointer; + typedef ValueType & reference; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; + //@} + + //! Pointer to (const) GenericMember + typedef pointer Pointer; + //! Reference to (const) GenericMember + typedef reference Reference; + //! Signed integer type (e.g. \c ptrdiff_t) + typedef difference_type DifferenceType; + + //! Default constructor (singular value) + /*! Creates an iterator pointing to no element. + \note All operations, except for comparisons, are undefined on such values. + */ + GenericMemberIterator() : ptr_() {} + + //! Iterator conversions to more const + /*! + \param it (Non-const) iterator to copy from + + Allows the creation of an iterator from another GenericMemberIterator + that is "less const". Especially, creating a non-constant iterator + from a constant iterator are disabled: + \li const -> non-const (not ok) + \li const -> const (ok) + \li non-const -> const (ok) + \li non-const -> non-const (ok) + + \note If the \c Const template parameter is already \c false, this + constructor effectively defines a regular copy-constructor. + Otherwise, the copy constructor is implicitly defined. + */ + GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} + Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; } + + //! @name stepping + //@{ + Iterator& operator++(){ ++ptr_; return *this; } + Iterator& operator--(){ --ptr_; return *this; } + Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } + Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } + //@} + + //! @name increment/decrement + //@{ + Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } + Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } + + Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } + Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } + //@} + + //! @name relations + //@{ + template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } + template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } + template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } + template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } + template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } + template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } + +#ifdef __cpp_lib_three_way_comparison + template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } +#endif + //@} + + //! @name dereference + //@{ + Reference operator*() const { return *ptr_; } + Pointer operator->() const { return ptr_; } + Reference operator[](DifferenceType n) const { return ptr_[n]; } + //@} + + //! Distance + DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } + +private: + //! Internal constructor from plain pointer + explicit GenericMemberIterator(Pointer p) : ptr_(p) {} + + Pointer ptr_; //!< raw pointer +}; + +#else // CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS + +// class-based member iterator implementation disabled, use plain pointers + +template +class GenericMemberIterator; + +//! non-const GenericMemberIterator +template +class GenericMemberIterator { + //! use plain pointer as iterator type + typedef GenericMember* Iterator; +}; +//! const GenericMemberIterator +template +class GenericMemberIterator { + //! use plain const pointer as iterator type + typedef const GenericMember* Iterator; +}; + +#endif // CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS + +/////////////////////////////////////////////////////////////////////////////// +// GenericStringRef + +//! Reference to a constant string (not taking a copy) +/*! + \tparam CharType character type of the string + + This helper class is used to automatically infer constant string + references for string literals, especially from \c const \b (!) + character arrays. + + The main use is for creating JSON string values without copying the + source string via an \ref Allocator. This requires that the referenced + string pointers have a sufficient lifetime, which exceeds the lifetime + of the associated GenericValue. + + \b Example + \code + Value v("foo"); // ok, no need to copy & calculate length + const char foo[] = "foo"; + v.SetString(foo); // ok + + const char* bar = foo; + // Value x(bar); // not ok, can't rely on bar's lifetime + Value x(StringRef(bar)); // lifetime explicitly guaranteed by user + Value y(StringRef(bar, 3)); // ok, explicitly pass length + \endcode + + \see StringRef, GenericValue::SetString +*/ +template +struct GenericStringRef { + typedef CharType Ch; //!< character type of the string + + //! Create string reference from \c const character array +#ifndef __clang__ // -Wdocumentation + /*! + This constructor implicitly creates a constant string reference from + a \c const character array. It has better performance than + \ref StringRef(const CharType*) by inferring the string \ref length + from the array length, and also supports strings containing null + characters. + + \tparam N length of the string, automatically inferred + + \param str Constant character array, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note Constant complexity. + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + template + GenericStringRef(const CharType (&str)[N]) CEREAL_RAPIDJSON_NOEXCEPT + : s(str), length(N-1) {} + + //! Explicitly create string reference from \c const character pointer +#ifndef __clang__ // -Wdocumentation + /*! + This constructor can be used to \b explicitly create a reference to + a constant string pointer. + + \see StringRef(const CharType*) + + \param str Constant character pointer, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + explicit GenericStringRef(const CharType* str) + : s(str), length(NotNullStrLen(str)) {} + + //! Create constant string reference from pointer and length +#ifndef __clang__ // -Wdocumentation + /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param len length of the string, excluding the trailing NULL terminator + + \post \ref s == str && \ref length == len + \note Constant complexity. + */ +#endif + GenericStringRef(const CharType* str, SizeType len) + : s(CEREAL_RAPIDJSON_LIKELY(str) ? str : emptyString), length(len) { CEREAL_RAPIDJSON_ASSERT(str != 0 || len == 0u); } + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + + const Ch* const s; //!< plain CharType pointer + const SizeType length; //!< length of the string (excluding the trailing NULL terminator) + +private: + SizeType NotNullStrLen(const CharType* str) { + CEREAL_RAPIDJSON_ASSERT(str != 0); + return internal::StrLen(str); + } + + /// Empty string - used when passing in a NULL pointer + static const Ch emptyString[]; + + //! Disallow construction from non-const array + template + GenericStringRef(CharType (&str)[N]) /* = delete */; + //! Copy assignment operator not permitted - immutable type + GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; +}; + +template +const CharType GenericStringRef::emptyString[] = { CharType() }; + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + \tparam CharType Character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + + \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember +*/ +template +inline GenericStringRef StringRef(const CharType* str) { + return GenericStringRef(str); +} + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + This version has better performance with supplied length, and also + supports string containing null characters. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param length The length of source string. + \return GenericStringRef string reference object + \relatesalso GenericStringRef +*/ +template +inline GenericStringRef StringRef(const CharType* str, size_t length) { + return GenericStringRef(str, SizeType(length)); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +//! Mark a string object as constant string +/*! Mark a string object (e.g. \c std::string) as a "string literal". + This function can be used to avoid copying a string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. +*/ +template +inline GenericStringRef StringRef(const std::basic_string& str) { + return GenericStringRef(str.data(), SizeType(str.size())); +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue type traits +namespace internal { + +template +struct IsGenericValueImpl : FalseType {}; + +// select candidates according to nested encoding and allocator types +template struct IsGenericValueImpl::Type, typename Void::Type> + : IsBaseOf, T>::Type {}; + +// helper to match arbitrary GenericValue instantiations, including derived classes +template struct IsGenericValue : IsGenericValueImpl::Type {}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// TypeHelper + +namespace internal { + +template +struct TypeHelper {}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsBool(); } + static bool Get(const ValueType& v) { return v.GetBool(); } + static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); } + static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt(); } + static int Get(const ValueType& v) { return v.GetInt(); } + static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); } + static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint(); } + static unsigned Get(const ValueType& v) { return v.GetUint(); } + static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); } + static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); } +}; + +#ifdef _MSC_VER +CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int)); +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt(); } + static long Get(const ValueType& v) { return v.GetInt(); } + static ValueType& Set(ValueType& v, long data) { return v.SetInt(data); } + static ValueType& Set(ValueType& v, long data, typename ValueType::AllocatorType&) { return v.SetInt(data); } +}; + +CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned)); +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint(); } + static unsigned long Get(const ValueType& v) { return v.GetUint(); } + static ValueType& Set(ValueType& v, unsigned long data) { return v.SetUint(data); } + static ValueType& Set(ValueType& v, unsigned long data, typename ValueType::AllocatorType&) { return v.SetUint(data); } +}; +#endif + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt64(); } + static int64_t Get(const ValueType& v) { return v.GetInt64(); } + static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); } + static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint64(); } + static uint64_t Get(const ValueType& v) { return v.GetUint64(); } + static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); } + static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsDouble(); } + static double Get(const ValueType& v) { return v.GetDouble(); } + static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); } + static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsFloat(); } + static float Get(const ValueType& v) { return v.GetFloat(); } + static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); } + static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); } +}; + +template +struct TypeHelper { + typedef const typename ValueType::Ch* StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return v.GetString(); } + static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); } + static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +struct TypeHelper > { + typedef std::basic_string StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } + static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; +#endif + +template +struct TypeHelper { + typedef typename ValueType::Array ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(ValueType& v) { return v.GetArray(); } + static ValueType& Set(ValueType& v, ArrayType data) { return v = data; } + static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstArray ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(const ValueType& v) { return v.GetArray(); } +}; + +template +struct TypeHelper { + typedef typename ValueType::Object ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(ValueType& v) { return v.GetObject(); } + static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } + static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstObject ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(const ValueType& v) { return v.GetObject(); } +}; + +} // namespace internal + +// Forward declarations +template class GenericArray; +template class GenericObject; + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue + +//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. +/*! + A JSON value can be one of 7 types. This class is a variant type supporting + these types. + + Use the Value if UTF8 and default allocator + + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. +*/ +template > +class GenericValue { +public: + //! Name-value pair in an object. + typedef GenericMember Member; + typedef Encoding EncodingType; //!< Encoding type from template parameter. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericStringRef StringRefType; //!< Reference to a constant string + typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. + typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. + typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. + typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. + typedef GenericValue ValueType; //!< Value type of itself. + typedef GenericArray Array; + typedef GenericArray ConstArray; + typedef GenericObject Object; + typedef GenericObject ConstObject; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor creates a null value. + GenericValue() CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericValue(GenericValue&& rhs) CEREAL_RAPIDJSON_NOEXCEPT : data_(rhs.data_) { + rhs.data_.f.flags = kNullFlag; // give up contents + } +#endif + +private: + //! Copy constructor is not permitted. + GenericValue(const GenericValue& rhs); + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Moving from a GenericDocument is not permitted. + template + GenericValue(GenericDocument&& rhs); + + //! Move assignment from a GenericDocument is not permitted. + template + GenericValue& operator=(GenericDocument&& rhs); +#endif + +public: + + //! Constructor with JSON value type. + /*! This creates a Value of specified type with default content. + \param type Type of the value. + \note Default content for number is zero. + */ + explicit GenericValue(Type type) CEREAL_RAPIDJSON_NOEXCEPT : data_() { + static const uint16_t defaultFlags[] = { + kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, + kNumberAnyFlag + }; + CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType); + data_.f.flags = defaultFlags[type]; + + // Use ShortString to store empty string. + if (type == kStringType) + data_.ss.SetLength(0); + } + + //! Explicit copy constructor (with allocator) + /*! Creates a copy of a Value by using the given Allocator + \tparam SourceAllocator allocator of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + \see CopyFrom() + */ + template + GenericValue(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + switch (rhs.GetType()) { + case kObjectType: { + SizeType count = rhs.data_.o.size; + Member* lm = reinterpret_cast(allocator.Malloc(count * sizeof(Member))); + const typename GenericValue::Member* rm = rhs.GetMembersPointer(); + for (SizeType i = 0; i < count; i++) { + new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings); + new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings); + } + data_.f.flags = kObjectFlag; + data_.o.size = data_.o.capacity = count; + SetMembersPointer(lm); + } + break; + case kArrayType: { + SizeType count = rhs.data_.a.size; + GenericValue* le = reinterpret_cast(allocator.Malloc(count * sizeof(GenericValue))); + const GenericValue* re = rhs.GetElementsPointer(); + for (SizeType i = 0; i < count; i++) + new (&le[i]) GenericValue(re[i], allocator, copyConstStrings); + data_.f.flags = kArrayFlag; + data_.a.size = data_.a.capacity = count; + SetElementsPointer(le); + } + break; + case kStringType: + if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) { + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + } + else + SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); + break; + default: + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + break; + } + } + + //! Constructor for boolean value. + /*! \param b Boolean value + \note This constructor is limited to \em real boolean values and rejects + implicitly converted types like arbitrary pointers. Use an explicit cast + to \c bool, if you want to construct a boolean JSON value in such cases. + */ +#ifndef CEREAL_RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen + template + explicit GenericValue(T b, CEREAL_RAPIDJSON_ENABLEIF((internal::IsSame))) CEREAL_RAPIDJSON_NOEXCEPT // See #472 +#else + explicit GenericValue(bool b) CEREAL_RAPIDJSON_NOEXCEPT +#endif + : data_() { + // safe-guard against failing SFINAE + CEREAL_RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); + data_.f.flags = b ? kTrueFlag : kFalseFlag; + } + + //! Constructor for int value. + explicit GenericValue(int i) CEREAL_RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i; + data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag; + } + + //! Constructor for unsigned value. + explicit GenericValue(unsigned u) CEREAL_RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u; + data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag); + } + + //! Constructor for int64_t value. + explicit GenericValue(int64_t i64) CEREAL_RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i64; + data_.f.flags = kNumberInt64Flag; + if (i64 >= 0) { + data_.f.flags |= kNumberUint64Flag; + if (!(static_cast(i64) & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(static_cast(i64) & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + else if (i64 >= static_cast(CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for uint64_t value. + explicit GenericValue(uint64_t u64) CEREAL_RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u64; + data_.f.flags = kNumberUint64Flag; + if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) + data_.f.flags |= kInt64Flag; + if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for double value. + explicit GenericValue(double d) CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for float value. + explicit GenericValue(float f) CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast(f); data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for constant string (i.e. do not make a copy of string) + GenericValue(const Ch* s, SizeType length) CEREAL_RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); } + + //! Constructor for constant string (i.e. do not make a copy of string) + explicit GenericValue(StringRefType s) CEREAL_RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Constructor for copy-string from a string object (i.e. do make a copy of string) + /*! \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. + */ + GenericValue(const std::basic_string& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } +#endif + + //! Constructor for Array. + /*! + \param a An array obtained by \c GetArray(). + \note \c Array is always pass-by-value. + \note the source array is moved into this value and the sourec array becomes empty. + */ + GenericValue(Array a) CEREAL_RAPIDJSON_NOEXCEPT : data_(a.value_.data_) { + a.value_.data_ = Data(); + a.value_.data_.f.flags = kArrayFlag; + } + + //! Constructor for Object. + /*! + \param o An object obtained by \c GetObject(). + \note \c Object is always pass-by-value. + \note the source object is moved into this value and the sourec object becomes empty. + */ + GenericValue(Object o) CEREAL_RAPIDJSON_NOEXCEPT : data_(o.value_.data_) { + o.value_.data_ = Data(); + o.value_.data_.f.flags = kObjectFlag; + } + + //! Destructor. + /*! Need to destruct elements of array, members of object, or copy-string. + */ + ~GenericValue() { + if (Allocator::kNeedFree) { // Shortcut by Allocator's trait + switch(data_.f.flags) { + case kArrayFlag: + { + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + Allocator::Free(e); + } + break; + + case kObjectFlag: + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + Allocator::Free(GetMembersPointer()); + break; + + case kCopyStringFlag: + Allocator::Free(const_cast(GetStringPointer())); + break; + + default: + break; // Do nothing for other types. + } + } + } + + //@} + + //!@name Assignment operators + //@{ + + //! Assignment with move semantics. + /*! \param rhs Source of the assignment. It will become a null value after assignment. + */ + GenericValue& operator=(GenericValue& rhs) CEREAL_RAPIDJSON_NOEXCEPT { + if (CEREAL_RAPIDJSON_LIKELY(this != &rhs)) { + this->~GenericValue(); + RawAssign(rhs); + } + return *this; + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericValue& operator=(GenericValue&& rhs) CEREAL_RAPIDJSON_NOEXCEPT { + return *this = rhs.Move(); + } +#endif + + //! Assignment of constant string reference (no copy) + /*! \param str Constant string reference to be assigned + \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. + \see GenericStringRef, operator=(T) + */ + GenericValue& operator=(StringRefType str) CEREAL_RAPIDJSON_NOEXCEPT { + GenericValue s(str); + return *this = s; + } + + //! Assignment with primitive types. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value The value to be assigned. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref SetString(const Ch*, Allocator&) (for copying) or + \ref StringRef() (to explicitly mark the pointer as constant) instead. + All other pointer types would implicitly convert to \c bool, + use \ref SetBool() instead. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) + operator=(T value) { + GenericValue v(value); + return *this = v; + } + + //! Deep-copy assignment from Value + /*! Assigns a \b copy of the Value to the current Value object + \tparam SourceAllocator Allocator type of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator to use for copying + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + */ + template + GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + CEREAL_RAPIDJSON_ASSERT(static_cast(this) != static_cast(&rhs)); + this->~GenericValue(); + new (this) GenericValue(rhs, allocator, copyConstStrings); + return *this; + } + + //! Exchange the contents of this value with those of other. + /*! + \param other Another value. + \note Constant complexity. + */ + GenericValue& Swap(GenericValue& other) CEREAL_RAPIDJSON_NOEXCEPT { + GenericValue temp; + temp.RawAssign(*this); + RawAssign(other); + other.RawAssign(temp); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.value, b.value); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericValue& a, GenericValue& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Prepare Value for move semantics + /*! \return *this */ + GenericValue& Move() CEREAL_RAPIDJSON_NOEXCEPT { return *this; } + //@} + + //!@name Equal-to and not-equal-to operators + //@{ + //! Equal-to operator + /*! + \note If an object contains duplicated named member, comparing equality with any object is always \c false. + \note Complexity is quadratic in Object's member number and linear for the rest (number of all values in the subtree and total lengths of all strings). + */ + template + bool operator==(const GenericValue& rhs) const { + typedef GenericValue RhsType; + if (GetType() != rhs.GetType()) + return false; + + switch (GetType()) { + case kObjectType: // Warning: O(n^2) inner-loop + if (data_.o.size != rhs.data_.o.size) + return false; + for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { + typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); + if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) + return false; + } + return true; + + case kArrayType: + if (data_.a.size != rhs.data_.a.size) + return false; + for (SizeType i = 0; i < data_.a.size; i++) + if ((*this)[i] != rhs[i]) + return false; + return true; + + case kStringType: + return StringEqual(rhs); + + case kNumberType: + if (IsDouble() || rhs.IsDouble()) { + double a = GetDouble(); // May convert from integer to double. + double b = rhs.GetDouble(); // Ditto + return a >= b && a <= b; // Prevent -Wfloat-equal + } + else + return data_.n.u64 == rhs.data_.n.u64; + + default: + return true; + } + } + + //! Equal-to operator with const C-string pointer + bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Equal-to operator with string object + /*! \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. + */ + bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } +#endif + + //! Equal-to operator with primitive types + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false + */ + template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } + + //! Not-equal-to operator + /*! \return !(*this == rhs) + */ + template + bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with const C-string pointer + bool operator!=(const Ch* rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with arbitrary types + /*! \return !(*this == rhs) + */ + template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ + template friend CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } + + //! Not-Equal-to operator with arbitrary types (symmetric version) + /*! \return !(rhs == lhs) + */ + template friend CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } + //@} + + //!@name Type + //@{ + + Type GetType() const { return static_cast(data_.f.flags & kTypeMask); } + bool IsNull() const { return data_.f.flags == kNullFlag; } + bool IsFalse() const { return data_.f.flags == kFalseFlag; } + bool IsTrue() const { return data_.f.flags == kTrueFlag; } + bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; } + bool IsObject() const { return data_.f.flags == kObjectFlag; } + bool IsArray() const { return data_.f.flags == kArrayFlag; } + bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; } + bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; } + bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; } + bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; } + bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; } + bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; } + bool IsString() const { return (data_.f.flags & kStringFlag) != 0; } + + // Checks whether a number can be losslessly converted to a double. + bool IsLosslessDouble() const { + if (!IsNumber()) return false; + if (IsUint64()) { + uint64_t u = GetUint64(); + volatile double d = static_cast(u); + return (d >= 0.0) + && (d < static_cast((std::numeric_limits::max)())) + && (u == static_cast(d)); + } + if (IsInt64()) { + int64_t i = GetInt64(); + volatile double d = static_cast(i); + return (d >= static_cast((std::numeric_limits::min)())) + && (d < static_cast((std::numeric_limits::max)())) + && (i == static_cast(d)); + } + return true; // double, int, uint are always lossless + } + + // Checks whether a number is a float (possible lossy). + bool IsFloat() const { + if ((data_.f.flags & kDoubleFlag) == 0) + return false; + double d = GetDouble(); + return d >= -3.4028234e38 && d <= 3.4028234e38; + } + // Checks whether a number can be losslessly converted to a float. + bool IsLosslessFloat() const { + if (!IsNumber()) return false; + double a = GetDouble(); + if (a < static_cast(-(std::numeric_limits::max)()) + || a > static_cast((std::numeric_limits::max)())) + return false; + double b = static_cast(static_cast(a)); + return a >= b && a <= b; // Prevent -Wfloat-equal + } + + //@} + + //!@name Null + //@{ + + GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } + + //@} + + //!@name Bool + //@{ + + bool GetBool() const { CEREAL_RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; } + //!< Set boolean value + /*! \post IsBool() == true */ + GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } + + //@} + + //!@name Object + //@{ + + //! Set this value as an empty object. + /*! \post IsObject() == true */ + GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } + + //! Get the number of members in the object. + SizeType MemberCount() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } + + //! Get the capacity of object. + SizeType MemberCapacity() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.capacity; } + + //! Check whether the object is empty. + bool ObjectEmpty() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) + \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. + Since 0.2, if the name is not correct, it will assert. + If user is unsure whether a member exists, user should use HasMember() first. + A better approach is to use FindMember(). + \note Linear time complexity. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { + GenericValue n(StringRef(name)); + return (*this)[n]; + } + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam SourceAllocator Allocator of the \c name value + + \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). + And it can also handle strings with embedded null characters. + + \note Linear time complexity. + */ + template + GenericValue& operator[](const GenericValue& name) { + MemberIterator member = FindMember(name); + if (member != MemberEnd()) + return member->value; + else { + CEREAL_RAPIDJSON_ASSERT(false); // see above note + + // This will generate -Wexit-time-destructors in clang + // static GenericValue NullValue; + // return NullValue; + + // Use static buffer and placement-new to prevent destruction + static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); + } + } + template + const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Get a value from an object associated with name (string object). + GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } + const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } +#endif + + //! Const member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberBegin() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); } + //! Const \em past-the-end member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberEnd() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); } + //! Member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberBegin() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); } + //! \em Past-the-end member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberEnd() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); } + + //! Request the object to have enough capacity to store members. + /*! \param newCapacity The capacity that the object at least need to have. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note Linear time complexity. + */ + GenericValue& MemberReserve(SizeType newCapacity, Allocator &allocator) { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + if (newCapacity > data_.o.capacity) { + SetMembersPointer(reinterpret_cast(allocator.Realloc(GetMembersPointer(), data_.o.capacity * sizeof(Member), newCapacity * sizeof(Member)))); + data_.o.capacity = newCapacity; + } + return *this; + } + + //! Check whether a member exists in the object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Check whether a member exists in the object with string object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } +#endif + + //! Check whether a member exists in the object with GenericValue name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + template + bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } + + //! Find member by name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + MemberIterator FindMember(const Ch* name) { + GenericValue n(StringRef(name)); + return FindMember(n); + } + + ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } + + //! Find member by name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + template + MemberIterator FindMember(const GenericValue& name) { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + CEREAL_RAPIDJSON_ASSERT(name.IsString()); + MemberIterator member = MemberBegin(); + for ( ; member != MemberEnd(); ++member) + if (name.StringEqual(member->name)) + break; + return member; + } + template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Find member by string object name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + */ + MemberIterator FindMember(const std::basic_string& name) { return FindMember(GenericValue(StringRef(name))); } + ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(GenericValue(StringRef(name))); } +#endif + + //! Add a member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c name and \c value will be transferred to this object on success. + \pre IsObject() && name.IsString() + \post name.IsNull() && value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + CEREAL_RAPIDJSON_ASSERT(name.IsString()); + + ObjectData& o = data_.o; + if (o.size >= o.capacity) + MemberReserve(o.capacity == 0 ? kDefaultObjectCapacity : (o.capacity + (o.capacity + 1) / 2), allocator); + Member* members = GetMembersPointer(); + members[o.size].name.RawAssign(name); + members[o.size].value.RawAssign(value); + o.size++; + return *this; + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Add a string object as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { + GenericValue v(value, allocator); + return AddMember(name, v, allocator); + } +#endif + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A string value as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(GenericValue& name, T value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + + + //! Add a member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this object on success. + \pre IsObject() + \post value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A constant string reference as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(StringRefType name, T value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Remove all members in the object. + /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void RemoveAllMembers() { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + data_.o.size = 0; + } + + //! Remove a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Linear time complexity. + */ + bool RemoveMember(const Ch* name) { + GenericValue n(StringRef(name)); + return RemoveMember(n); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } +#endif + + template + bool RemoveMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + RemoveMember(m); + return true; + } + else + return false; + } + + //! Remove a member in object by iterator. + /*! \param m member iterator (obtained by FindMember() or MemberBegin()). + \return the new iterator after removal. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Constant time complexity. + */ + MemberIterator RemoveMember(MemberIterator m) { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + CEREAL_RAPIDJSON_ASSERT(data_.o.size > 0); + CEREAL_RAPIDJSON_ASSERT(GetMembersPointer() != 0); + CEREAL_RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); + + MemberIterator last(GetMembersPointer() + (data_.o.size - 1)); + if (data_.o.size > 1 && m != last) + *m = *last; // Move the last one to this place + else + m->~Member(); // Only one left, just destroy + --data_.o.size; + return m; + } + + //! Remove a member from an object by iterator. + /*! \param pos iterator to the member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() + \return Iterator following the removed element. + If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. + \note This function preserves the relative order of the remaining object + members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator pos) { + return EraseMember(pos, pos +1); + } + + //! Remove members in the range [first, last) from an object. + /*! \param first iterator to the first member to remove + \param last iterator following the last member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() + \return Iterator following the last removed element. + \note This function preserves the relative order of the remaining object + members. + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { + CEREAL_RAPIDJSON_ASSERT(IsObject()); + CEREAL_RAPIDJSON_ASSERT(data_.o.size > 0); + CEREAL_RAPIDJSON_ASSERT(GetMembersPointer() != 0); + CEREAL_RAPIDJSON_ASSERT(first >= MemberBegin()); + CEREAL_RAPIDJSON_ASSERT(first <= last); + CEREAL_RAPIDJSON_ASSERT(last <= MemberEnd()); + + MemberIterator pos = MemberBegin() + (first - MemberBegin()); + for (MemberIterator itr = pos; itr != last; ++itr) + itr->~Member(); + std::memmove(static_cast(&*pos), &*last, static_cast(MemberEnd() - last) * sizeof(Member)); + data_.o.size -= static_cast(last - first); + return pos; + } + + //! Erase a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note Linear time complexity. + */ + bool EraseMember(const Ch* name) { + GenericValue n(StringRef(name)); + return EraseMember(n); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) { return EraseMember(GenericValue(StringRef(name))); } +#endif + + template + bool EraseMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + EraseMember(m); + return true; + } + else + return false; + } + + Object GetObject() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return Object(*this); } + ConstObject GetObject() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } + + //@} + + //!@name Array + //@{ + + //! Set this value as an empty array. + /*! \post IsArray == true */ + GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } + + //! Get the number of elements in array. + SizeType Size() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } + + //! Get the capacity of array. + SizeType Capacity() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } + + //! Check whether the array is empty. + bool Empty() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } + + //! Remove all elements in the array. + /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void Clear() { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + data_.a.size = 0; + } + + //! Get an element from array by index. + /*! \pre IsArray() == true + \param index Zero-based index of element. + \see operator[](T*) + */ + GenericValue& operator[](SizeType index) { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + CEREAL_RAPIDJSON_ASSERT(index < data_.a.size); + return GetElementsPointer()[index]; + } + const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } + + //! Element iterator + /*! \pre IsArray() == true */ + ValueIterator Begin() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); } + //! \em Past-the-end element iterator + /*! \pre IsArray() == true */ + ValueIterator End() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; } + //! Constant element iterator + /*! \pre IsArray() == true */ + ConstValueIterator Begin() const { return const_cast(*this).Begin(); } + //! Constant \em past-the-end element iterator + /*! \pre IsArray() == true */ + ConstValueIterator End() const { return const_cast(*this).End(); } + + //! Request the array to have enough capacity to store elements. + /*! \param newCapacity The capacity that the array at least need to have. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note Linear time complexity. + */ + GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + if (newCapacity > data_.a.capacity) { + SetElementsPointer(reinterpret_cast(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)))); + data_.a.capacity = newCapacity; + } + return *this; + } + + //! Append a GenericValue at the end of the array. + /*! \param value Value to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \post value.IsNull() == true + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this array on success. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + */ + GenericValue& PushBack(GenericValue& value, Allocator& allocator) { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + if (data_.a.size >= data_.a.capacity) + Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); + GetElementsPointer()[data_.a.size++].RawAssign(value); + return *this; + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { + return PushBack(value, allocator); + } +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + + //! Append a constant string reference at the end of the array. + /*! \param value Constant string reference to be appended. + \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + \see GenericStringRef + */ + GenericValue& PushBack(StringRefType value, Allocator& allocator) { + return (*this).template PushBack(value, allocator); + } + + //! Append a primitive value at the end of the array. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value Value of primitive type T to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref PushBack(GenericValue&, Allocator&) or \ref + PushBack(StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized constant time complexity. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + PushBack(T value, Allocator& allocator) { + GenericValue v(value); + return PushBack(v, allocator); + } + + //! Remove the last element in the array. + /*! + \note Constant time complexity. + */ + GenericValue& PopBack() { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + CEREAL_RAPIDJSON_ASSERT(!Empty()); + GetElementsPointer()[--data_.a.size].~GenericValue(); + return *this; + } + + //! Remove an element of array by iterator. + /*! + \param pos iterator to the element to remove + \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() + \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator pos) { + return Erase(pos, pos + 1); + } + + //! Remove elements in the range [first, last) of the array. + /*! + \param first iterator to the first element to remove + \param last iterator following the last element to remove + \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() + \return Iterator following the last removed element. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { + CEREAL_RAPIDJSON_ASSERT(IsArray()); + CEREAL_RAPIDJSON_ASSERT(data_.a.size > 0); + CEREAL_RAPIDJSON_ASSERT(GetElementsPointer() != 0); + CEREAL_RAPIDJSON_ASSERT(first >= Begin()); + CEREAL_RAPIDJSON_ASSERT(first <= last); + CEREAL_RAPIDJSON_ASSERT(last <= End()); + ValueIterator pos = Begin() + (first - Begin()); + for (ValueIterator itr = pos; itr != last; ++itr) + itr->~GenericValue(); + std::memmove(static_cast(pos), last, static_cast(End() - last) * sizeof(GenericValue)); + data_.a.size -= static_cast(last - first); + return pos; + } + + Array GetArray() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return Array(*this); } + ConstArray GetArray() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); } + + //@} + + //!@name Number + //@{ + + int GetInt() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; } + unsigned GetUint() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; } + int64_t GetInt64() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; } + uint64_t GetUint64() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; } + + //! Get the value as double type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless. + */ + double GetDouble() const { + CEREAL_RAPIDJSON_ASSERT(IsNumber()); + if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. + if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double + if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double + if ((data_.f.flags & kInt64Flag) != 0) return static_cast(data_.n.i64); // int64_t -> double (may lose precision) + CEREAL_RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast(data_.n.u64); // uint64_t -> double (may lose precision) + } + + //! Get the value as float type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless. + */ + float GetFloat() const { + return static_cast(GetDouble()); + } + + GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } + GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } + GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } + GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } + GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } + GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast(f)); return *this; } + + //@} + + //!@name String + //@{ + + const Ch* GetString() const { CEREAL_RAPIDJSON_ASSERT(IsString()); return (data_.f.flags & kInlineStrFlag) ? data_.ss.str : GetStringPointer(); } + + //! Get the length of string. + /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). + */ + SizeType GetStringLength() const { CEREAL_RAPIDJSON_ASSERT(IsString()); return ((data_.f.flags & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); } + + //! Set this value as a string without copying source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string pointer. + \param length The length of source string, excluding the trailing null terminator. + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == length + \see SetString(StringRefType) + */ + GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } + + //! Set this value as a string without copying source string. + /*! \param s source string reference + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == s.length + */ + GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } + + //! Set this value as a string by copying from source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string. + \param length The length of source string, excluding the trailing null terminator. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); } + + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(StringRef(s), allocator); } + + //! Set this value as a string by copying from source string. + /*! \param s source string reference + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s.s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(StringRefType s, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, allocator); return *this; } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() + \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. + */ + GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(StringRef(s), allocator); } +#endif + + //@} + + //!@name Array + //@{ + + //! Templated version for checking whether this value is type T. + /*! + \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string + */ + template + bool Is() const { return internal::TypeHelper::Is(*this); } + + template + T Get() const { return internal::TypeHelper::Get(*this); } + + template + T Get() { return internal::TypeHelper::Get(*this); } + + template + ValueType& Set(const T& data) { return internal::TypeHelper::Set(*this, data); } + + template + ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper::Set(*this, data, allocator); } + + //@} + + //! Generate events of this value to a Handler. + /*! This function adopts the GoF visitor pattern. + Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. + It can also be used to deep clone this value via GenericDocument, which is also a Handler. + \tparam Handler type of handler. + \param handler An object implementing concept Handler. + */ + template + bool Accept(Handler& handler) const { + switch(GetType()) { + case kNullType: return handler.Null(); + case kFalseType: return handler.Bool(false); + case kTrueType: return handler.Bool(true); + + case kObjectType: + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartObject())) + return false; + for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { + CEREAL_RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0))) + return false; + if (CEREAL_RAPIDJSON_UNLIKELY(!m->value.Accept(handler))) + return false; + } + return handler.EndObject(data_.o.size); + + case kArrayType: + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartArray())) + return false; + for (const GenericValue* v = Begin(); v != End(); ++v) + if (CEREAL_RAPIDJSON_UNLIKELY(!v->Accept(handler))) + return false; + return handler.EndArray(data_.a.size); + + case kStringType: + return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0); + + default: + CEREAL_RAPIDJSON_ASSERT(GetType() == kNumberType); + if (IsDouble()) return handler.Double(data_.n.d); + else if (IsInt()) return handler.Int(data_.n.i.i); + else if (IsUint()) return handler.Uint(data_.n.u.u); + else if (IsInt64()) return handler.Int64(data_.n.i64); + else return handler.Uint64(data_.n.u64); + } + } + +private: + template friend class GenericValue; + template friend class GenericDocument; + + enum { + kBoolFlag = 0x0008, + kNumberFlag = 0x0010, + kIntFlag = 0x0020, + kUintFlag = 0x0040, + kInt64Flag = 0x0080, + kUint64Flag = 0x0100, + kDoubleFlag = 0x0200, + kStringFlag = 0x0400, + kCopyFlag = 0x0800, + kInlineStrFlag = 0x1000, + + // Initial flags of different types. + kNullFlag = kNullType, + kTrueFlag = kTrueType | kBoolFlag, + kFalseFlag = kFalseType | kBoolFlag, + kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, + kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, + kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag, + kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, + kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, + kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, + kConstStringFlag = kStringType | kStringFlag, + kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, + kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, + kObjectFlag = kObjectType, + kArrayFlag = kArrayType, + + kTypeMask = 0x07 + }; + + static const SizeType kDefaultArrayCapacity = 16; + static const SizeType kDefaultObjectCapacity = 16; + + struct Flag { +#if CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION + char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer +#elif CEREAL_RAPIDJSON_64BIT + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes +#else + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes +#endif + uint16_t flags; + }; + + struct String { + SizeType length; + SizeType hashcode; //!< reserved + const Ch* str; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars + // (excluding the terminating zero) and store a value to determine the length of the contained + // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string + // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as + // the string terminator as well. For getting the string length back from that value just use + // "MaxSize - str[LenPos]". + // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, + // 13-chars strings for CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). + struct ShortString { + enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; + Ch str[MaxChars]; + + inline static bool Usable(SizeType len) { return (MaxSize >= len); } + inline void SetLength(SizeType len) { str[LenPos] = static_cast(MaxSize - len); } + inline SizeType GetLength() const { return static_cast(MaxSize - str[LenPos]); } + }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // By using proper binary layout, retrieval of different integer types do not need conversions. + union Number { +#if CEREAL_RAPIDJSON_ENDIAN == CEREAL_RAPIDJSON_LITTLEENDIAN + struct I { + int i; + char padding[4]; + }i; + struct U { + unsigned u; + char padding2[4]; + }u; +#else + struct I { + char padding[4]; + int i; + }i; + struct U { + char padding2[4]; + unsigned u; + }u; +#endif + int64_t i64; + uint64_t u64; + double d; + }; // 8 bytes + + struct ObjectData { + SizeType size; + SizeType capacity; + Member* members; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + struct ArrayData { + SizeType size; + SizeType capacity; + GenericValue* elements; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + union Data { + String s; + ShortString ss; + Number n; + ObjectData o; + ArrayData a; + Flag f; + }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION + + CEREAL_RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(Ch, data_.s.str); } + CEREAL_RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return CEREAL_RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); } + CEREAL_RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); } + CEREAL_RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return CEREAL_RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); } + CEREAL_RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(Member, data_.o.members); } + CEREAL_RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return CEREAL_RAPIDJSON_SETPOINTER(Member, data_.o.members, members); } + + // Initialize this value as array with initial data, without calling destructor. + void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { + data_.f.flags = kArrayFlag; + if (count) { + GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); + SetElementsPointer(e); + std::memcpy(static_cast(e), values, count * sizeof(GenericValue)); + } + else + SetElementsPointer(0); + data_.a.size = data_.a.capacity = count; + } + + //! Initialize this value as object with initial data, without calling destructor. + void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { + data_.f.flags = kObjectFlag; + if (count) { + Member* m = static_cast(allocator.Malloc(count * sizeof(Member))); + SetMembersPointer(m); + std::memcpy(static_cast(m), members, count * sizeof(Member)); + } + else + SetMembersPointer(0); + data_.o.size = data_.o.capacity = count; + } + + //! Initialize this value as constant string, without calling destructor. + void SetStringRaw(StringRefType s) CEREAL_RAPIDJSON_NOEXCEPT { + data_.f.flags = kConstStringFlag; + SetStringPointer(s); + data_.s.length = s.length; + } + + //! Initialize this value as copy string with initial data, without calling destructor. + void SetStringRaw(StringRefType s, Allocator& allocator) { + Ch* str = 0; + if (ShortString::Usable(s.length)) { + data_.f.flags = kShortStringFlag; + data_.ss.SetLength(s.length); + str = data_.ss.str; + } else { + data_.f.flags = kCopyStringFlag; + data_.s.length = s.length; + str = static_cast(allocator.Malloc((s.length + 1) * sizeof(Ch))); + SetStringPointer(str); + } + std::memcpy(str, s, s.length * sizeof(Ch)); + str[s.length] = '\0'; + } + + //! Assignment without calling destructor + void RawAssign(GenericValue& rhs) CEREAL_RAPIDJSON_NOEXCEPT { + data_ = rhs.data_; + // data_.f.flags = rhs.data_.f.flags; + rhs.data_.f.flags = kNullFlag; + } + + template + bool StringEqual(const GenericValue& rhs) const { + CEREAL_RAPIDJSON_ASSERT(IsString()); + CEREAL_RAPIDJSON_ASSERT(rhs.IsString()); + + const SizeType len1 = GetStringLength(); + const SizeType len2 = rhs.GetStringLength(); + if(len1 != len2) { return false; } + + const Ch* const str1 = GetString(); + const Ch* const str2 = rhs.GetString(); + if(str1 == str2) { return true; } // fast path for constant string + + return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); + } + + Data data_; +}; + +//! GenericValue with UTF8 encoding +typedef GenericValue > Value; + +/////////////////////////////////////////////////////////////////////////////// +// GenericDocument + +//! A document for parsing JSON text as DOM. +/*! + \note implements Handler concept + \tparam Encoding Encoding for both parsing and string storage. + \tparam Allocator Allocator for allocating memory for the DOM + \tparam StackAllocator Allocator for allocating memory for stack during parsing. + \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. +*/ +template , typename StackAllocator = CrtAllocator> +class GenericDocument : public GenericValue { +public: + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericValue ValueType; //!< Value type of the document. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + + //! Constructor + /*! Creates an empty document of specified type. + \param type Mandatory type of object to create. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + } + + //! Constructor + /*! Creates an empty document which type is Null. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericDocument(GenericDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT + : ValueType(std::forward(rhs)), // explicit cast to avoid prohibited move from Document + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(std::move(rhs.stack_)), + parseResult_(rhs.parseResult_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + } +#endif + + ~GenericDocument() { + Destroy(); + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericDocument& operator=(GenericDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT + { + // The cast to ValueType is necessary here, because otherwise it would + // attempt to call GenericValue's templated assignment operator. + ValueType::operator=(std::forward(rhs)); + + // Calling the destructor here would prematurely call stack_'s destructor + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = std::move(rhs.stack_); + parseResult_ = rhs.parseResult_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + + return *this; + } +#endif + + //! Exchange the contents of this document with those of another. + /*! + \param rhs Another document. + \note Constant complexity. + \see GenericValue::Swap + */ + GenericDocument& Swap(GenericDocument& rhs) CEREAL_RAPIDJSON_NOEXCEPT { + ValueType::Swap(rhs); + stack_.Swap(rhs.stack_); + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(parseResult_, rhs.parseResult_); + return *this; + } + + // Allow Swap with ValueType. + // Refer to Effective C++ 3rd Edition/Item 33: Avoid hiding inherited names. + using ValueType::Swap; + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.doc, b.doc); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericDocument& a, GenericDocument& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Populate this document by a generator which produces SAX events. + /*! \tparam Generator A functor with bool f(Handler) prototype. + \param g Generator functor which sends SAX events to the parameter. + \return The document itself for fluent API. + */ + template + GenericDocument& Populate(Generator& g) { + ClearStackOnExit scope(*this); + if (g(*this)) { + CEREAL_RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //!@name Parse from stream + //!@{ + + //! Parse JSON text from an input stream (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam SourceEncoding Encoding of input stream + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + GenericReader reader( + stack_.HasAllocator() ? &stack_.GetAllocator() : 0); + ClearStackOnExit scope(*this); + parseResult_ = reader.template Parse(is, *this); + if (parseResult_) { + CEREAL_RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //! Parse JSON text from an input stream + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + + //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + //!@} + + //!@name Parse in-place from mutable string + //!@{ + + //! Parse JSON text from a mutable string + /*! \tparam parseFlags Combination of \ref ParseFlag. + \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseInsitu(Ch* str) { + GenericInsituStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) + /*! \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + GenericDocument& ParseInsitu(Ch* str) { + return ParseInsitu(str); + } + //!@} + + //!@name Parse from read-only string + //!@{ + + //! Parse JSON text from a read-only string (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \tparam SourceEncoding Transcoding from input Encoding + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str) { + CEREAL_RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + GenericStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a read-only string + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) + /*! \param str Read-only zero-terminated string to be parsed. + */ + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) { + CEREAL_RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + MemoryStream ms(reinterpret_cast(str), length * sizeof(typename SourceEncoding::Ch)); + EncodedInputStream is(ms); + ParseStream(is); + return *this; + } + + template + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + template + GenericDocument& Parse(const std::basic_string& str) { + // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t) + return Parse(str.c_str()); + } + + template + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str.c_str()); + } + + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str); + } +#endif // CEREAL_RAPIDJSON_HAS_STDSTRING + + //!@} + + //!@name Handling parse errors + //!@{ + + //! Whether a parse error has occurred in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseError() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + + //! Implicit conversion to get the last parse result +#ifndef __clang // -Wdocumentation + /*! \return \ref ParseResult of the last parse operation + + \code + Document doc; + ParseResult ok = doc.Parse(json); + if (!ok) + printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset()); + \endcode + */ +#endif + operator ParseResult() const { return parseResult_; } + //!@} + + //! Get the allocator of this document. + Allocator& GetAllocator() { + CEREAL_RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + //! Get the capacity of stack in bytes. + size_t GetStackCapacity() const { return stack_.GetCapacity(); } + +private: + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} + ~ClearStackOnExit() { d_.ClearStack(); } + private: + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + GenericDocument& d_; + }; + + // callers of the following private Handler functions + // template friend class GenericReader; // for parsing + template friend class GenericValue; // for deep copying + +public: + // Implementation of Handler + bool Null() { new (stack_.template Push()) ValueType(); return true; } + bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } + bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } + bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } + + bool RawNumber(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool String(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } + + bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } + + bool EndObject(SizeType memberCount) { + typename ValueType::Member* members = stack_.template Pop(memberCount); + stack_.template Top()->SetObjectRaw(members, memberCount, GetAllocator()); + return true; + } + + bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } + + bool EndArray(SizeType elementCount) { + ValueType* elements = stack_.template Pop(elementCount); + stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); + return true; + } + +private: + //! Prohibit copying + GenericDocument(const GenericDocument&); + //! Prohibit assignment + GenericDocument& operator=(const GenericDocument&); + + void ClearStack() { + if (Allocator::kNeedFree) + while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) + (stack_.template Pop(1))->~ValueType(); + else + stack_.Clear(); + stack_.ShrinkToFit(); + } + + void Destroy() { + CEREAL_RAPIDJSON_DELETE(ownAllocator_); + } + + static const size_t kDefaultStackCapacity = 1024; + Allocator* allocator_; + Allocator* ownAllocator_; + internal::Stack stack_; + ParseResult parseResult_; +}; + +//! GenericDocument with UTF8 encoding +typedef GenericDocument > Document; + +//! Helper class for accessing Value of array type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetArray(). + In addition to all APIs for array type, it provides range-based for loop if \c CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericArray { +public: + typedef GenericArray ConstArray; + typedef GenericArray Array; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef ValueType* ValueIterator; // This may be const or non-const iterator + typedef const ValueT* ConstValueIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + + template + friend class GenericValue; + + GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} + GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } + ~GenericArray() {} + + SizeType Size() const { return value_.Size(); } + SizeType Capacity() const { return value_.Capacity(); } + bool Empty() const { return value_.Empty(); } + void Clear() const { value_.Clear(); } + ValueType& operator[](SizeType index) const { return value_[index]; } + ValueIterator Begin() const { return value_.Begin(); } + ValueIterator End() const { return value_.End(); } + GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; } + GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + GenericArray PopBack() const { value_.PopBack(); return *this; } + ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); } + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR + ValueIterator begin() const { return value_.Begin(); } + ValueIterator end() const { return value_.End(); } +#endif + +private: + GenericArray(); + GenericArray(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +//! Helper class for accessing Value of object type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetObject(). + In addition to all APIs for array type, it provides range-based for loop if \c CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericObject { +public: + typedef GenericObject ConstObject; + typedef GenericObject Object; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef GenericMemberIterator MemberIterator; // This may be const or non-const iterator + typedef GenericMemberIterator ConstMemberIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename ValueType::Ch Ch; + + template + friend class GenericValue; + + GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} + GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } + ~GenericObject() {} + + SizeType MemberCount() const { return value_.MemberCount(); } + SizeType MemberCapacity() const { return value_.MemberCapacity(); } + bool ObjectEmpty() const { return value_.ObjectEmpty(); } + template ValueType& operator[](T* name) const { return value_[name]; } + template ValueType& operator[](const GenericValue& name) const { return value_[name]; } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + ValueType& operator[](const std::basic_string& name) const { return value_[name]; } +#endif + MemberIterator MemberBegin() const { return value_.MemberBegin(); } + MemberIterator MemberEnd() const { return value_.MemberEnd(); } + GenericObject MemberReserve(SizeType newCapacity, AllocatorType &allocator) const { value_.MemberReserve(newCapacity, allocator); return *this; } + bool HasMember(const Ch* name) const { return value_.HasMember(name); } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool HasMember(const std::basic_string& name) const { return value_.HasMember(name); } +#endif + template bool HasMember(const GenericValue& name) const { return value_.HasMember(name); } + MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); } + template MemberIterator FindMember(const GenericValue& name) const { return value_.FindMember(name); } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + MemberIterator FindMember(const std::basic_string& name) const { return value_.FindMember(name); } +#endif + GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + GenericObject AddMember(ValueType& name, std::basic_string& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif + template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + void RemoveAllMembers() { value_.RemoveAllMembers(); } + bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) const { return value_.RemoveMember(name); } +#endif + template bool RemoveMember(const GenericValue& name) const { return value_.RemoveMember(name); } + MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); } + MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); } + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); } + bool EraseMember(const Ch* name) const { return value_.EraseMember(name); } +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) const { return EraseMember(ValueType(StringRef(name))); } +#endif + template bool EraseMember(const GenericValue& name) const { return value_.EraseMember(name); } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR + MemberIterator begin() const { return value_.MemberBegin(); } + MemberIterator end() const { return value_.MemberEnd(); } +#endif + +private: + GenericObject(); + GenericObject(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +CEREAL_RAPIDJSON_NAMESPACE_END +CEREAL_RAPIDJSON_DIAG_POP + +#endif // CEREAL_RAPIDJSON_DOCUMENT_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h new file mode 100644 index 000000000..b04774be3 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h @@ -0,0 +1,299 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ENCODEDSTREAM_H_ +#define CEREAL_RAPIDJSON_ENCODEDSTREAM_H_ + +#include "stream.h" +#include "memorystream.h" + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Input byte stream wrapper with a statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam InputByteStream Type of input byte stream. For example, FileReadStream. +*/ +template +class EncodedInputStream { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedInputStream(InputByteStream& is) : is_(is) { + current_ = Encoding::TakeBOM(is_); + } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); + + InputByteStream& is_; + Ch current_; +}; + +//! Specialized for UTF8 MemoryStream. +template <> +class EncodedInputStream, MemoryStream> { +public: + typedef UTF8<>::Ch Ch; + + EncodedInputStream(MemoryStream& is) : is_(is) { + if (static_cast(is_.Peek()) == 0xEFu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBBu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBFu) is_.Take(); + } + Ch Peek() const { return is_.Peek(); } + Ch Take() { return is_.Take(); } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) {} + void Flush() {} + Ch* PutBegin() { return 0; } + size_t PutEnd(Ch*) { return 0; } + + MemoryStream& is_; + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); +}; + +//! Output byte stream wrapper with statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream. +*/ +template +class EncodedOutputStream { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { + if (putBOM) + Encoding::PutBOM(os_); + } + + void Put(Ch c) { Encoding::Put(os_, c); } + void Flush() { os_.Flush(); } + + // Not implemented + Ch Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedOutputStream(const EncodedOutputStream&); + EncodedOutputStream& operator=(const EncodedOutputStream&); + + OutputByteStream& os_; +}; + +#define CEREAL_RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + +//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for reading. + \tparam InputByteStream type of input byte stream to be wrapped. +*/ +template +class AutoUTFInputStream { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param is input stream to be wrapped. + \param type UTF encoding type if it is not detected from the stream. + */ + AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { + CEREAL_RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + DetectType(); + static const TakeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Take) }; + takeFunc_ = f[type_]; + current_ = takeFunc_(*is_); + } + + UTFType GetType() const { return type_; } + bool HasBOM() const { return hasBOM_; } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } + size_t Tell() const { return is_->Tell(); } + + // Not implemented + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFInputStream(const AutoUTFInputStream&); + AutoUTFInputStream& operator=(const AutoUTFInputStream&); + + // Detect encoding type with BOM or RFC 4627 + void DetectType() { + // BOM (Byte Order Mark): + // 00 00 FE FF UTF-32BE + // FF FE 00 00 UTF-32LE + // FE FF UTF-16BE + // FF FE UTF-16LE + // EF BB BF UTF-8 + + const unsigned char* c = reinterpret_cast(is_->Peek4()); + if (!c) + return; + + unsigned bom = static_cast(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); + hasBOM_ = false; + if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } + + // RFC 4627: Section 3 + // "Since the first two characters of a JSON text will always be ASCII + // characters [RFC0020], it is possible to determine whether an octet + // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking + // at the pattern of nulls in the first four octets." + // 00 00 00 xx UTF-32BE + // 00 xx 00 xx UTF-16BE + // xx 00 00 00 UTF-32LE + // xx 00 xx 00 UTF-16LE + // xx xx xx xx UTF-8 + + if (!hasBOM_) { + int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); + switch (pattern) { + case 0x08: type_ = kUTF32BE; break; + case 0x0A: type_ = kUTF16BE; break; + case 0x01: type_ = kUTF32LE; break; + case 0x05: type_ = kUTF16LE; break; + case 0x0F: type_ = kUTF8; break; + default: break; // Use type defined by user. + } + } + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + } + + typedef Ch (*TakeFunc)(InputByteStream& is); + InputByteStream* is_; + UTFType type_; + Ch current_; + TakeFunc takeFunc_; + bool hasBOM_; +}; + +//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for writing. + \tparam OutputByteStream type of output byte stream to be wrapped. +*/ +template +class AutoUTFOutputStream { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param os output stream to be wrapped. + \param type UTF encoding type. + \param putBOM Whether to write BOM at the beginning of the stream. + */ + AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { + CEREAL_RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + + static const PutFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Put) }; + putFunc_ = f[type_]; + + if (putBOM) + PutBOM(); + } + + UTFType GetType() const { return type_; } + + void Put(Ch c) { putFunc_(*os_, c); } + void Flush() { os_->Flush(); } + + // Not implemented + Ch Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFOutputStream(const AutoUTFOutputStream&); + AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); + + void PutBOM() { + typedef void (*PutBOMFunc)(OutputByteStream&); + static const PutBOMFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; + f[type_](*os_); + } + + typedef void (*PutFunc)(OutputByteStream&, Ch); + + OutputByteStream* os_; + UTFType type_; + PutFunc putFunc_; +}; + +#undef CEREAL_RAPIDJSON_ENCODINGS_FUNC + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h new file mode 100644 index 000000000..a1c27ecf8 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h @@ -0,0 +1,716 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ENCODINGS_H_ +#define CEREAL_RAPIDJSON_ENCODINGS_H_ + +#include "rapidjson.h" + +#if defined(_MSC_VER) && !defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data +CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code +#elif defined(__GNUC__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +CEREAL_RAPIDJSON_DIAG_OFF(overflow) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Encoding + +/*! \class rapidjson::Encoding + \brief Concept for encoding of Unicode characters. + +\code +concept Encoding { + typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. + + enum { supportUnicode = 1 }; // or 0 if not supporting unicode + + //! \brief Encode a Unicode codepoint to an output stream. + //! \param os Output stream. + //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. + template + static void Encode(OutputStream& os, unsigned codepoint); + + //! \brief Decode a Unicode codepoint from an input stream. + //! \param is Input stream. + //! \param codepoint Output of the unicode codepoint. + //! \return true if a valid codepoint can be decoded from the stream. + template + static bool Decode(InputStream& is, unsigned* codepoint); + + //! \brief Validate one Unicode codepoint from an encoded stream. + //! \param is Input stream to obtain codepoint. + //! \param os Output for copying one codepoint. + //! \return true if it is valid. + //! \note This function just validating and copying the codepoint without actually decode it. + template + static bool Validate(InputStream& is, OutputStream& os); + + // The following functions are deal with byte streams. + + //! Take a character from input byte stream, skip BOM if exist. + template + static CharType TakeBOM(InputByteStream& is); + + //! Take a character from input byte stream. + template + static Ch Take(InputByteStream& is); + + //! Put BOM to output byte stream. + template + static void PutBOM(OutputByteStream& os); + + //! Put a character to output byte stream. + template + static void Put(OutputByteStream& os, Ch c); +}; +\endcode +*/ + +/////////////////////////////////////////////////////////////////////////////// +// UTF8 + +//! UTF-8 encoding. +/*! http://en.wikipedia.org/wiki/UTF-8 + http://tools.ietf.org/html/rfc3629 + \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. + \note implements Encoding concept +*/ +template +struct UTF8 { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + os.Put(static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + else { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + PutUnsafe(os, static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + PutUnsafe(os, static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + PutUnsafe(os, static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + else { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { +#define CEREAL_RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast(c) & 0x3Fu) +#define CEREAL_RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define CEREAL_RAPIDJSON_TAIL() CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x70) + typename InputStream::Ch c = is.Take(); + if (!(c & 0x80)) { + *codepoint = static_cast(c); + return true; + } + + unsigned char type = GetRange(static_cast(c)); + if (type >= 32) { + *codepoint = 0; + } else { + *codepoint = (0xFFu >> type) & static_cast(c); + } + bool result = true; + switch (type) { + case 2: CEREAL_RAPIDJSON_TAIL(); return result; + case 3: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 4: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x50); CEREAL_RAPIDJSON_TAIL(); return result; + case 5: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x10); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 6: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 10: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x20); CEREAL_RAPIDJSON_TAIL(); return result; + case 11: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x60); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + default: return false; + } +#undef CEREAL_RAPIDJSON_COPY +#undef CEREAL_RAPIDJSON_TRANS +#undef CEREAL_RAPIDJSON_TAIL + } + + template + static bool Validate(InputStream& is, OutputStream& os) { +#define CEREAL_RAPIDJSON_COPY() os.Put(c = is.Take()) +#define CEREAL_RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define CEREAL_RAPIDJSON_TAIL() CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x70) + Ch c; + CEREAL_RAPIDJSON_COPY(); + if (!(c & 0x80)) + return true; + + bool result = true; + switch (GetRange(static_cast(c))) { + case 2: CEREAL_RAPIDJSON_TAIL(); return result; + case 3: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 4: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x50); CEREAL_RAPIDJSON_TAIL(); return result; + case 5: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x10); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 6: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + case 10: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x20); CEREAL_RAPIDJSON_TAIL(); return result; + case 11: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x60); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; + default: return false; + } +#undef CEREAL_RAPIDJSON_COPY +#undef CEREAL_RAPIDJSON_TRANS +#undef CEREAL_RAPIDJSON_TAIL + } + + static unsigned char GetRange(unsigned char c) { + // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. + static const unsigned char type[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, + }; + return type[c]; + } + + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + typename InputByteStream::Ch c = Take(is); + if (static_cast(c) != 0xEFu) return c; + c = is.Take(); + if (static_cast(c) != 0xBBu) return c; + c = is.Take(); + if (static_cast(c) != 0xBFu) return c; + c = is.Take(); + return c; + } + + template + static Ch Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xEFu)); + os.Put(static_cast(0xBBu)); + os.Put(static_cast(0xBFu)); + } + + template + static void Put(OutputByteStream& os, Ch c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF16 + +//! UTF-16 encoding. +/*! http://en.wikipedia.org/wiki/UTF-16 + http://tools.ietf.org/html/rfc2781 + \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF16LE and UTF16BE, which handle endianness. +*/ +template +struct UTF16 { + typedef CharType Ch; + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + CEREAL_RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + os.Put(static_cast(codepoint)); + } + else { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + os.Put(static_cast((v >> 10) | 0xD800)); + os.Put(static_cast((v & 0x3FF) | 0xDC00)); + } + } + + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + CEREAL_RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + PutUnsafe(os, static_cast(codepoint)); + } + else { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + PutUnsafe(os, static_cast((v >> 10) | 0xD800)); + PutUnsafe(os, static_cast((v & 0x3FF) | 0xDC00)); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + typename InputStream::Ch c = is.Take(); + if (c < 0xD800 || c > 0xDFFF) { + *codepoint = static_cast(c); + return true; + } + else if (c <= 0xDBFF) { + *codepoint = (static_cast(c) & 0x3FF) << 10; + c = is.Take(); + *codepoint |= (static_cast(c) & 0x3FF); + *codepoint += 0x10000; + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + typename InputStream::Ch c; + os.Put(static_cast(c = is.Take())); + if (c < 0xD800 || c > 0xDFFF) + return true; + else if (c <= 0xDBFF) { + os.Put(c = is.Take()); + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } +}; + +//! UTF-16 little endian encoding. +template +struct UTF16LE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(static_cast(c) & 0xFFu)); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + } +}; + +//! UTF-16 big endian encoding. +template +struct UTF16BE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + os.Put(static_cast(static_cast(c) & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF32 + +//! UTF-32 encoding. +/*! http://en.wikipedia.org/wiki/UTF-32 + \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF32LE and UTF32BE, which handle endianness. +*/ +template +struct UTF32 { + typedef CharType Ch; + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(codepoint); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, codepoint); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c = is.Take(); + *codepoint = c; + return c <= 0x10FFFF; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c; + os.Put(c = is.Take()); + return c <= 0x10FFFF; + } +}; + +//! UTF-32 little endian enocoding. +template +struct UTF32LE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 24; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 24) & 0xFFu)); + } +}; + +//! UTF-32 big endian encoding. +template +struct UTF32BE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 24; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((c >> 24) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast(c & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// ASCII + +//! ASCII encoding. +/*! http://en.wikipedia.org/wiki/ASCII + \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. + \note implements Encoding concept +*/ +template +struct ASCII { + typedef CharType Ch; + + enum { supportUnicode = 0 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x7F); + os.Put(static_cast(codepoint & 0xFF)); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x7F); + PutUnsafe(os, static_cast(codepoint & 0xFF)); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + uint8_t c = static_cast(is.Take()); + *codepoint = c; + return c <= 0X7F; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + uint8_t c = static_cast(is.Take()); + os.Put(static_cast(c)); + return c <= 0x7F; + } + + template + static CharType TakeBOM(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + uint8_t c = static_cast(Take(is)); + return static_cast(c); + } + + template + static Ch Take(InputByteStream& is) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + (void)os; + } + + template + static void Put(OutputByteStream& os, Ch c) { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// AutoUTF + +//! Runtime-specified UTF encoding type of a stream. +enum UTFType { + kUTF8 = 0, //!< UTF-8. + kUTF16LE = 1, //!< UTF-16 little endian. + kUTF16BE = 2, //!< UTF-16 big endian. + kUTF32LE = 3, //!< UTF-32 little endian. + kUTF32BE = 4 //!< UTF-32 big endian. +}; + +//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. +/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType(). +*/ +template +struct AutoUTF { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + +#define CEREAL_RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + + template + static CEREAL_RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Encode) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { + typedef bool (*DecodeFunc)(InputStream&, unsigned*); + static const DecodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Decode) }; + return (*f[is.GetType()])(is, codepoint); + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + typedef bool (*ValidateFunc)(InputStream&, OutputStream&); + static const ValidateFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Validate) }; + return (*f[is.GetType()])(is, os); + } + +#undef CEREAL_RAPIDJSON_ENCODINGS_FUNC +}; + +/////////////////////////////////////////////////////////////////////////////// +// Transcoder + +//! Encoding conversion. +template +struct Transcoder { + //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::Encode(os, codepoint); + return true; + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::EncodeUnsafe(os, codepoint); + return true; + } + + //! Validate one Unicode codepoint from an encoded stream. + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Transcode(is, os); // Since source/target encoding is different, must transcode. + } +}; + +// Forward declaration. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c); + +//! Specialization of Transcoder with same source and target encoding. +template +struct Transcoder { + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Encoding::Validate(is, os); // source/target encoding are the same + } +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) || (defined(_MSC_VER) && !defined(__clang__)) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_ENCODINGS_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h new file mode 100644 index 000000000..ea93bf85e --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h @@ -0,0 +1,74 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ERROR_EN_H_ +#define CEREAL_RAPIDJSON_ERROR_EN_H_ + +#include "error.h" + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) +CEREAL_RAPIDJSON_DIAG_OFF(covered-switch-default) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Maps error code of parsing into error message. +/*! + \ingroup CEREAL_RAPIDJSON_ERRORS + \param parseErrorCode Error code obtained in parsing. + \return the error message. + \note User can make a copy of this function for localization. + Using switch-case is safer for future modification of error codes. +*/ +inline const CEREAL_RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { + switch (parseErrorCode) { + case kParseErrorNone: return CEREAL_RAPIDJSON_ERROR_STRING("No error."); + + case kParseErrorDocumentEmpty: return CEREAL_RAPIDJSON_ERROR_STRING("The document is empty."); + case kParseErrorDocumentRootNotSingular: return CEREAL_RAPIDJSON_ERROR_STRING("The document root must not be followed by other values."); + + case kParseErrorValueInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid value."); + + case kParseErrorObjectMissName: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a name for object member."); + case kParseErrorObjectMissColon: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); + case kParseErrorObjectMissCommaOrCurlyBracket: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); + + case kParseErrorArrayMissCommaOrSquareBracket: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); + + case kParseErrorStringUnicodeEscapeInvalidHex: return CEREAL_RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); + case kParseErrorStringUnicodeSurrogateInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); + case kParseErrorStringEscapeInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid escape character in string."); + case kParseErrorStringMissQuotationMark: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); + case kParseErrorStringInvalidEncoding: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid encoding in string."); + + case kParseErrorNumberTooBig: return CEREAL_RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); + case kParseErrorNumberMissFraction: return CEREAL_RAPIDJSON_ERROR_STRING("Miss fraction part in number."); + case kParseErrorNumberMissExponent: return CEREAL_RAPIDJSON_ERROR_STRING("Miss exponent in number."); + + case kParseErrorTermination: return CEREAL_RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); + case kParseErrorUnspecificSyntaxError: return CEREAL_RAPIDJSON_ERROR_STRING("Unspecific syntax error."); + + default: return CEREAL_RAPIDJSON_ERROR_STRING("Unknown error."); + } +} + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_ERROR_EN_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h new file mode 100644 index 000000000..7e7cc2432 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h @@ -0,0 +1,161 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ERROR_ERROR_H_ +#define CEREAL_RAPIDJSON_ERROR_ERROR_H_ + +#include "../rapidjson.h" + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#endif + +/*! \file error.h */ + +/*! \defgroup CEREAL_RAPIDJSON_ERRORS RapidJSON error handling */ + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_ERROR_CHARTYPE + +//! Character type of error messages. +/*! \ingroup CEREAL_RAPIDJSON_ERRORS + The default character type is \c char. + On Windows, user can define this macro as \c TCHAR for supporting both + unicode/non-unicode settings. +*/ +#ifndef CEREAL_RAPIDJSON_ERROR_CHARTYPE +#define CEREAL_RAPIDJSON_ERROR_CHARTYPE char +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_ERROR_STRING + +//! Macro for converting string literial to \ref CEREAL_RAPIDJSON_ERROR_CHARTYPE[]. +/*! \ingroup CEREAL_RAPIDJSON_ERRORS + By default this conversion macro does nothing. + On Windows, user can define this macro as \c _T(x) for supporting both + unicode/non-unicode settings. +*/ +#ifndef CEREAL_RAPIDJSON_ERROR_STRING +#define CEREAL_RAPIDJSON_ERROR_STRING(x) x +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseErrorCode + +//! Error code of parsing. +/*! \ingroup CEREAL_RAPIDJSON_ERRORS + \see GenericReader::Parse, GenericReader::GetParseErrorCode +*/ +enum ParseErrorCode { + kParseErrorNone = 0, //!< No error. + + kParseErrorDocumentEmpty, //!< The document is empty. + kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. + + kParseErrorValueInvalid, //!< Invalid value. + + kParseErrorObjectMissName, //!< Missing a name for object member. + kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. + kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. + + kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. + + kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. + kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. + kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. + kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. + kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. + + kParseErrorNumberTooBig, //!< Number too big to be stored in double. + kParseErrorNumberMissFraction, //!< Miss fraction part in number. + kParseErrorNumberMissExponent, //!< Miss exponent in number. + + kParseErrorTermination, //!< Parsing was terminated. + kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. +}; + +//! Result of parsing (wraps ParseErrorCode) +/*! + \ingroup CEREAL_RAPIDJSON_ERRORS + \code + Document doc; + ParseResult ok = doc.Parse("[42]"); + if (!ok) { + fprintf(stderr, "JSON parse error: %s (%u)", + GetParseError_En(ok.Code()), ok.Offset()); + exit(EXIT_FAILURE); + } + \endcode + \see GenericReader::Parse, GenericDocument::Parse +*/ +struct ParseResult { + //!! Unspecified boolean type + typedef bool (ParseResult::*BooleanType)() const; +public: + //! Default constructor, no error. + ParseResult() : code_(kParseErrorNone), offset_(0) {} + //! Constructor to set an error. + ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} + + //! Get the error code. + ParseErrorCode Code() const { return code_; } + //! Get the error offset, if \ref IsError(), 0 otherwise. + size_t Offset() const { return offset_; } + + //! Explicit conversion to \c bool, returns \c true, iff !\ref IsError(). + operator BooleanType() const { return !IsError() ? &ParseResult::IsError : NULL; } + //! Whether the result is an error. + bool IsError() const { return code_ != kParseErrorNone; } + + bool operator==(const ParseResult& that) const { return code_ == that.code_; } + bool operator==(ParseErrorCode code) const { return code_ == code; } + friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } + + bool operator!=(const ParseResult& that) const { return !(*this == that); } + bool operator!=(ParseErrorCode code) const { return !(*this == code); } + friend bool operator!=(ParseErrorCode code, const ParseResult & err) { return err != code; } + + //! Reset error code. + void Clear() { Set(kParseErrorNone); } + //! Update error code and offset. + void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } + +private: + ParseErrorCode code_; + size_t offset_; +}; + +//! Function pointer type of GetParseError(). +/*! \ingroup CEREAL_RAPIDJSON_ERRORS + + This is the prototype for \c GetParseError_X(), where \c X is a locale. + User can dynamically change locale in runtime, e.g.: +\code + GetParseErrorFunc GetParseError = GetParseError_En; // or whatever + const CEREAL_RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); +\endcode +*/ +typedef const CEREAL_RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_ERROR_ERROR_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h new file mode 100644 index 000000000..253a7f9a1 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h @@ -0,0 +1,99 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_FILEREADSTREAM_H_ +#define CEREAL_RAPIDJSON_FILEREADSTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) +CEREAL_RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! File byte stream for input using fread(). +/*! + \note implements Stream concept +*/ +class FileReadStream { +public: + typedef char Ch; //!< Character type (byte). + + //! Constructor. + /*! + \param fp File pointer opened for read. + \param buffer user-supplied buffer. + \param bufferSize size of buffer in bytes. Must >=4 bytes. + */ + FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + CEREAL_RAPIDJSON_ASSERT(fp_ != 0); + CEREAL_RAPIDJSON_ASSERT(bufferSize >= 4); + Read(); + } + + Ch Peek() const { return *current_; } + Ch Take() { Ch c = *current_; Read(); return c; } + size_t Tell() const { return count_ + static_cast(current_ - buffer_); } + + // Not implemented + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; + } + +private: + void Read() { + if (current_ < bufferLast_) + ++current_; + else if (!eof_) { + count_ += readCount_; + readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); + bufferLast_ = buffer_ + readCount_ - 1; + current_ = buffer_; + + if (readCount_ < bufferSize_) { + buffer_[readCount_] = '\0'; + ++bufferLast_; + eof_ = true; + } + } + } + + std::FILE* fp_; + Ch *buffer_; + size_t bufferSize_; + Ch *bufferLast_; + Ch *current_; + size_t readCount_; + size_t count_; //!< Number of characters read + bool eof_; +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h new file mode 100644 index 000000000..44ae12792 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h @@ -0,0 +1,104 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_FILEWRITESTREAM_H_ +#define CEREAL_RAPIDJSON_FILEWRITESTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of C file stream for output using fwrite(). +/*! + \note implements Stream concept +*/ +class FileWriteStream { +public: + typedef char Ch; //!< Character type. Only support char. + + FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { + CEREAL_RAPIDJSON_ASSERT(fp_ != 0); + } + + void Put(char c) { + if (current_ >= bufferEnd_) + Flush(); + + *current_++ = c; + } + + void PutN(char c, size_t n) { + size_t avail = static_cast(bufferEnd_ - current_); + while (n > avail) { + std::memset(current_, c, avail); + current_ += avail; + Flush(); + n -= avail; + avail = static_cast(bufferEnd_ - current_); + } + + if (n > 0) { + std::memset(current_, c, n); + current_ += n; + } + } + + void Flush() { + if (current_ != buffer_) { + size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); + if (result < static_cast(current_ - buffer_)) { + // failure deliberately ignored at this time + // added to avoid warn_unused_result build errors + } + current_ = buffer_; + } + } + + // Not implemented + char Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + char Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + // Prohibit copy constructor & assignment operator. + FileWriteStream(const FileWriteStream&); + FileWriteStream& operator=(const FileWriteStream&); + + std::FILE* fp_; + char *buffer_; + char *bufferEnd_; + char *current_; +}; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(FileWriteStream& stream, char c, size_t n) { + stream.PutN(c, n); +} + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h new file mode 100644 index 000000000..1b15c6668 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h @@ -0,0 +1,151 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_FWD_H_ +#define CEREAL_RAPIDJSON_FWD_H_ + +#include "rapidjson.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +// encodings.h + +template struct UTF8; +template struct UTF16; +template struct UTF16BE; +template struct UTF16LE; +template struct UTF32; +template struct UTF32BE; +template struct UTF32LE; +template struct ASCII; +template struct AutoUTF; + +template +struct Transcoder; + +// allocators.h + +class CrtAllocator; + +template +class MemoryPoolAllocator; + +// stream.h + +template +struct GenericStringStream; + +typedef GenericStringStream > StringStream; + +template +struct GenericInsituStringStream; + +typedef GenericInsituStringStream > InsituStringStream; + +// stringbuffer.h + +template +class GenericStringBuffer; + +typedef GenericStringBuffer, CrtAllocator> StringBuffer; + +// filereadstream.h + +class FileReadStream; + +// filewritestream.h + +class FileWriteStream; + +// memorybuffer.h + +template +struct GenericMemoryBuffer; + +typedef GenericMemoryBuffer MemoryBuffer; + +// memorystream.h + +struct MemoryStream; + +// reader.h + +template +struct BaseReaderHandler; + +template +class GenericReader; + +typedef GenericReader, UTF8, CrtAllocator> Reader; + +// writer.h + +template +class Writer; + +// prettywriter.h + +template +class PrettyWriter; + +// document.h + +template +struct GenericMember; + +template +class GenericMemberIterator; + +template +struct GenericStringRef; + +template +class GenericValue; + +typedef GenericValue, MemoryPoolAllocator > Value; + +template +class GenericDocument; + +typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; + +// pointer.h + +template +class GenericPointer; + +typedef GenericPointer Pointer; + +// schema.h + +template +class IGenericRemoteSchemaDocumentProvider; + +template +class GenericSchemaDocument; + +typedef GenericSchemaDocument SchemaDocument; +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +template < + typename SchemaDocumentType, + typename OutputHandler, + typename StateAllocator> +class GenericSchemaValidator; + +typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_RAPIDJSONFWD_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h new file mode 100644 index 000000000..77a6519df --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h @@ -0,0 +1,290 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_BIGINTEGER_H_ +#define CEREAL_RAPIDJSON_BIGINTEGER_H_ + +#include "../rapidjson.h" + +#if defined(_MSC_VER) && !__INTEL_COMPILER && defined(_M_AMD64) +#include // for _umul128 +#pragma intrinsic(_umul128) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class BigInteger { +public: + typedef uint64_t Type; + + BigInteger(const BigInteger& rhs) : count_(rhs.count_) { + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + + explicit BigInteger(uint64_t u) : count_(1) { + digits_[0] = u; + } + + BigInteger(const char* decimals, size_t length) : count_(1) { + CEREAL_RAPIDJSON_ASSERT(length > 0); + digits_[0] = 0; + size_t i = 0; + const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 + while (length >= kMaxDigitPerIteration) { + AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); + length -= kMaxDigitPerIteration; + i += kMaxDigitPerIteration; + } + + if (length > 0) + AppendDecimal64(decimals + i, decimals + i + length); + } + + BigInteger& operator=(const BigInteger &rhs) + { + if (this != &rhs) { + count_ = rhs.count_; + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + return *this; + } + + BigInteger& operator=(uint64_t u) { + digits_[0] = u; + count_ = 1; + return *this; + } + + BigInteger& operator+=(uint64_t u) { + Type backup = digits_[0]; + digits_[0] += u; + for (size_t i = 0; i < count_ - 1; i++) { + if (digits_[i] >= backup) + return *this; // no carry + backup = digits_[i + 1]; + digits_[i + 1] += 1; + } + + // Last carry + if (digits_[count_ - 1] < backup) + PushBack(1); + + return *this; + } + + BigInteger& operator*=(uint64_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + uint64_t hi; + digits_[i] = MulAdd64(digits_[i], u, k, &hi); + k = hi; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator*=(uint32_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + const uint64_t c = digits_[i] >> 32; + const uint64_t d = digits_[i] & 0xFFFFFFFF; + const uint64_t uc = u * c; + const uint64_t ud = u * d; + const uint64_t p0 = ud + k; + const uint64_t p1 = uc + (p0 >> 32); + digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); + k = p1 >> 32; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator<<=(size_t shift) { + if (IsZero() || shift == 0) return *this; + + size_t offset = shift / kTypeBit; + size_t interShift = shift % kTypeBit; + CEREAL_RAPIDJSON_ASSERT(count_ + offset <= kCapacity); + + if (interShift == 0) { + std::memmove(digits_ + offset, digits_, count_ * sizeof(Type)); + count_ += offset; + } + else { + digits_[count_] = 0; + for (size_t i = count_; i > 0; i--) + digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); + digits_[offset] = digits_[0] << interShift; + count_ += offset; + if (digits_[count_]) + count_++; + } + + std::memset(digits_, 0, offset * sizeof(Type)); + + return *this; + } + + bool operator==(const BigInteger& rhs) const { + return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; + } + + bool operator==(const Type rhs) const { + return count_ == 1 && digits_[0] == rhs; + } + + BigInteger& MultiplyPow5(unsigned exp) { + static const uint32_t kPow5[12] = { + 5, + 5 * 5, + 5 * 5 * 5, + 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 + }; + if (exp == 0) return *this; + for (; exp >= 27; exp -= 27) *this *= CEREAL_RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 + for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 + if (exp > 0) *this *= kPow5[exp - 1]; + return *this; + } + + // Compute absolute difference of this and rhs. + // Assume this != rhs + bool Difference(const BigInteger& rhs, BigInteger* out) const { + int cmp = Compare(rhs); + CEREAL_RAPIDJSON_ASSERT(cmp != 0); + const BigInteger *a, *b; // Makes a > b + bool ret; + if (cmp < 0) { a = &rhs; b = this; ret = true; } + else { a = this; b = &rhs; ret = false; } + + Type borrow = 0; + for (size_t i = 0; i < a->count_; i++) { + Type d = a->digits_[i] - borrow; + if (i < b->count_) + d -= b->digits_[i]; + borrow = (d > a->digits_[i]) ? 1 : 0; + out->digits_[i] = d; + if (d != 0) + out->count_ = i + 1; + } + + return ret; + } + + int Compare(const BigInteger& rhs) const { + if (count_ != rhs.count_) + return count_ < rhs.count_ ? -1 : 1; + + for (size_t i = count_; i-- > 0;) + if (digits_[i] != rhs.digits_[i]) + return digits_[i] < rhs.digits_[i] ? -1 : 1; + + return 0; + } + + size_t GetCount() const { return count_; } + Type GetDigit(size_t index) const { CEREAL_RAPIDJSON_ASSERT(index < count_); return digits_[index]; } + bool IsZero() const { return count_ == 1 && digits_[0] == 0; } + +private: + void AppendDecimal64(const char* begin, const char* end) { + uint64_t u = ParseUint64(begin, end); + if (IsZero()) + *this = u; + else { + unsigned exp = static_cast(end - begin); + (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u + } + } + + void PushBack(Type digit) { + CEREAL_RAPIDJSON_ASSERT(count_ < kCapacity); + digits_[count_++] = digit; + } + + static uint64_t ParseUint64(const char* begin, const char* end) { + uint64_t r = 0; + for (const char* p = begin; p != end; ++p) { + CEREAL_RAPIDJSON_ASSERT(*p >= '0' && *p <= '9'); + r = r * 10u + static_cast(*p - '0'); + } + return r; + } + + // Assume a * b + k < 2^128 + static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t low = _umul128(a, b, outHigh) + k; + if (low < k) + (*outHigh)++; + return low; +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(a) * static_cast(b); + p += k; + *outHigh = static_cast(p >> 64); + return static_cast(p); +#else + const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; + uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; + x1 += (x0 >> 32); // can't give carry + x1 += x2; + if (x1 < x2) + x3 += (static_cast(1) << 32); + uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); + uint64_t hi = x3 + (x1 >> 32); + + lo += k; + if (lo < k) + hi++; + *outHigh = hi; + return lo; +#endif + } + + static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 + static const size_t kCapacity = kBitCount / sizeof(Type); + static const size_t kTypeBit = sizeof(Type) * 8; + + Type digits_[kCapacity]; + size_t count_; +}; + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_BIGINTEGER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h new file mode 100644 index 000000000..3f92a0783 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h @@ -0,0 +1,271 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef CEREAL_RAPIDJSON_DIYFP_H_ +#define CEREAL_RAPIDJSON_DIYFP_H_ + +#include "../rapidjson.h" +#include + +#if defined(_MSC_VER) && defined(_M_AMD64) && !defined(__INTEL_COMPILER) +#include +#pragma intrinsic(_BitScanReverse64) +#pragma intrinsic(_umul128) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#endif + +struct DiyFp { + DiyFp() : f(), e() {} + + DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} + + explicit DiyFp(double d) { + union { + double d; + uint64_t u64; + } u = { d }; + + int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); + uint64_t significand = (u.u64 & kDpSignificandMask); + if (biased_e != 0) { + f = significand + kDpHiddenBit; + e = biased_e - kDpExponentBias; + } + else { + f = significand; + e = kDpMinExponent + 1; + } + } + + DiyFp operator-(const DiyFp& rhs) const { + return DiyFp(f - rhs.f, e); + } + + DiyFp operator*(const DiyFp& rhs) const { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t h; + uint64_t l = _umul128(f, rhs.f, &h); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(f) * static_cast(rhs.f); + uint64_t h = static_cast(p >> 64); + uint64_t l = static_cast(p); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#else + const uint64_t M32 = 0xFFFFFFFF; + const uint64_t a = f >> 32; + const uint64_t b = f & M32; + const uint64_t c = rhs.f >> 32; + const uint64_t d = rhs.f & M32; + const uint64_t ac = a * c; + const uint64_t bc = b * c; + const uint64_t ad = a * d; + const uint64_t bd = b * d; + uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); + tmp += 1U << 31; /// mult_round + return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); +#endif + } + + DiyFp Normalize() const { + CEREAL_RAPIDJSON_ASSERT(f != 0); // https://stackoverflow.com/a/26809183/291737 +#if defined(_MSC_VER) && defined(_M_AMD64) + unsigned long index; + _BitScanReverse64(&index, f); + return DiyFp(f << (63 - index), e - (63 - index)); +#elif defined(__GNUC__) && __GNUC__ >= 4 + int s = __builtin_clzll(f); + return DiyFp(f << s, e - s); +#else + DiyFp res = *this; + while (!(res.f & (static_cast(1) << 63))) { + res.f <<= 1; + res.e--; + } + return res; +#endif + } + + DiyFp NormalizeBoundary() const { + DiyFp res = *this; + while (!(res.f & (kDpHiddenBit << 1))) { + res.f <<= 1; + res.e--; + } + res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); + res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); + return res; + } + + void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { + DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); + DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); + mi.f <<= mi.e - pl.e; + mi.e = pl.e; + *plus = pl; + *minus = mi; + } + + double ToDouble() const { + union { + double d; + uint64_t u64; + }u; + CEREAL_RAPIDJSON_ASSERT(f <= kDpHiddenBit + kDpSignificandMask); + if (e < kDpDenormalExponent) { + // Underflow. + return 0.0; + } + if (e >= kDpMaxExponent) { + // Overflow. + return std::numeric_limits::infinity(); + } + const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : + static_cast(e + kDpExponentBias); + u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); + return u.d; + } + + static const int kDiySignificandSize = 64; + static const int kDpSignificandSize = 52; + static const int kDpExponentBias = 0x3FF + kDpSignificandSize; + static const int kDpMaxExponent = 0x7FF - kDpExponentBias; + static const int kDpMinExponent = -kDpExponentBias; + static const int kDpDenormalExponent = -kDpExponentBias + 1; + static const uint64_t kDpExponentMask = CEREAL_RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kDpSignificandMask = CEREAL_RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kDpHiddenBit = CEREAL_RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + uint64_t f; + int e; +}; + +inline DiyFp GetCachedPowerByIndex(size_t index) { + // 10^-348, 10^-340, ..., 10^340 + static const uint64_t kCachedPowers_F[] = { + CEREAL_RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), CEREAL_RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), + CEREAL_RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), CEREAL_RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), + CEREAL_RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), CEREAL_RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), + CEREAL_RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), CEREAL_RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), + CEREAL_RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), CEREAL_RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), + CEREAL_RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), CEREAL_RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), + CEREAL_RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), CEREAL_RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), + CEREAL_RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), CEREAL_RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), + CEREAL_RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), CEREAL_RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), + CEREAL_RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), CEREAL_RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), + CEREAL_RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), CEREAL_RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), + CEREAL_RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), CEREAL_RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), + CEREAL_RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), CEREAL_RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), + CEREAL_RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), CEREAL_RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), + CEREAL_RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), CEREAL_RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), + CEREAL_RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), CEREAL_RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), + CEREAL_RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), CEREAL_RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), + CEREAL_RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), CEREAL_RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), + CEREAL_RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), CEREAL_RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), + CEREAL_RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), CEREAL_RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), + CEREAL_RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), CEREAL_RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), + CEREAL_RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), CEREAL_RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), + CEREAL_RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), CEREAL_RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), + CEREAL_RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), CEREAL_RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), + CEREAL_RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), CEREAL_RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), + CEREAL_RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), CEREAL_RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), + CEREAL_RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), CEREAL_RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), + CEREAL_RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), CEREAL_RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), + CEREAL_RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), CEREAL_RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), + CEREAL_RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), CEREAL_RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), + CEREAL_RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), CEREAL_RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), + CEREAL_RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), CEREAL_RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), + CEREAL_RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), CEREAL_RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), + CEREAL_RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), CEREAL_RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), + CEREAL_RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), CEREAL_RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), + CEREAL_RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), CEREAL_RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), + CEREAL_RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), CEREAL_RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), + CEREAL_RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), CEREAL_RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), + CEREAL_RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), CEREAL_RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), + CEREAL_RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), CEREAL_RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), + CEREAL_RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), CEREAL_RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), + CEREAL_RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), CEREAL_RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), + CEREAL_RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), CEREAL_RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), + CEREAL_RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) + }; + static const int16_t kCachedPowers_E[] = { + -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, + -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, + -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, + -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, + -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, + 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, + 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, + 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, + 907, 933, 960, 986, 1013, 1039, 1066 + }; + CEREAL_RAPIDJSON_ASSERT(index < 87); + return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); +} + +inline DiyFp GetCachedPower(int e, int* K) { + + //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; + double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive + int k = static_cast(dk); + if (dk - k > 0.0) + k++; + + unsigned index = static_cast((k >> 3) + 1); + *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table + + return GetCachedPowerByIndex(index); +} + +inline DiyFp GetCachedPower10(int exp, int *outExp) { + CEREAL_RAPIDJSON_ASSERT(exp >= -348); + unsigned index = static_cast(exp + 348) / 8u; + *outExp = -348 + static_cast(index) * 8; + return GetCachedPowerByIndex(index); +} + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#endif + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_DIYFP_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h new file mode 100644 index 000000000..ea62b349c --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h @@ -0,0 +1,245 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef CEREAL_RAPIDJSON_DTOA_ +#define CEREAL_RAPIDJSON_DTOA_ + +#include "itoa.h" // GetDigitsLut() +#include "diyfp.h" +#include "ieee754.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +CEREAL_RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 +#endif + +inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { + while (rest < wp_w && delta - rest >= ten_kappa && + (rest + ten_kappa < wp_w || /// closer + wp_w - rest > rest + ten_kappa - wp_w)) { + buffer[len - 1]--; + rest += ten_kappa; + } +} + +inline int CountDecimalDigit32(uint32_t n) { + // Simple pure C++ implementation was faster than __builtin_clz version in this situation. + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + if (n < 100000) return 5; + if (n < 1000000) return 6; + if (n < 10000000) return 7; + if (n < 100000000) return 8; + // Will not reach 10 digits in DigitGen() + //if (n < 1000000000) return 9; + //return 10; + return 9; +} + +inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { + static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; + const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); + const DiyFp wp_w = Mp - W; + uint32_t p1 = static_cast(Mp.f >> -one.e); + uint64_t p2 = Mp.f & (one.f - 1); + int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] + *len = 0; + + while (kappa > 0) { + uint32_t d = 0; + switch (kappa) { + case 9: d = p1 / 100000000; p1 %= 100000000; break; + case 8: d = p1 / 10000000; p1 %= 10000000; break; + case 7: d = p1 / 1000000; p1 %= 1000000; break; + case 6: d = p1 / 100000; p1 %= 100000; break; + case 5: d = p1 / 10000; p1 %= 10000; break; + case 4: d = p1 / 1000; p1 %= 1000; break; + case 3: d = p1 / 100; p1 %= 100; break; + case 2: d = p1 / 10; p1 %= 10; break; + case 1: d = p1; p1 = 0; break; + default:; + } + if (d || *len) + buffer[(*len)++] = static_cast('0' + static_cast(d)); + kappa--; + uint64_t tmp = (static_cast(p1) << -one.e) + p2; + if (tmp <= delta) { + *K += kappa; + GrisuRound(buffer, *len, delta, tmp, static_cast(kPow10[kappa]) << -one.e, wp_w.f); + return; + } + } + + // kappa = 0 + for (;;) { + p2 *= 10; + delta *= 10; + char d = static_cast(p2 >> -one.e); + if (d || *len) + buffer[(*len)++] = static_cast('0' + d); + p2 &= one.f - 1; + kappa--; + if (p2 < delta) { + *K += kappa; + int index = -kappa; + GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? kPow10[index] : 0)); + return; + } + } +} + +inline void Grisu2(double value, char* buffer, int* length, int* K) { + const DiyFp v(value); + DiyFp w_m, w_p; + v.NormalizedBoundaries(&w_m, &w_p); + + const DiyFp c_mk = GetCachedPower(w_p.e, K); + const DiyFp W = v.Normalize() * c_mk; + DiyFp Wp = w_p * c_mk; + DiyFp Wm = w_m * c_mk; + Wm.f++; + Wp.f--; + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); +} + +inline char* WriteExponent(int K, char* buffer) { + if (K < 0) { + *buffer++ = '-'; + K = -K; + } + + if (K >= 100) { + *buffer++ = static_cast('0' + static_cast(K / 100)); + K %= 100; + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else if (K >= 10) { + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else + *buffer++ = static_cast('0' + static_cast(K)); + + return buffer; +} + +inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { + const int kk = length + k; // 10^(kk-1) <= v < 10^kk + + if (0 <= k && kk <= 21) { + // 1234e7 -> 12340000000 + for (int i = length; i < kk; i++) + buffer[i] = '0'; + buffer[kk] = '.'; + buffer[kk + 1] = '0'; + return &buffer[kk + 2]; + } + else if (0 < kk && kk <= 21) { + // 1234e-2 -> 12.34 + std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); + buffer[kk] = '.'; + if (0 > k + maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[kk + 2]; // Reserve one zero + } + else + return &buffer[length + 1]; + } + else if (-6 < kk && kk <= 0) { + // 1234e-6 -> 0.001234 + const int offset = 2 - kk; + std::memmove(&buffer[offset], &buffer[0], static_cast(length)); + buffer[0] = '0'; + buffer[1] = '.'; + for (int i = 2; i < offset; i++) + buffer[i] = '0'; + if (length - kk > maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = maxDecimalPlaces + 1; i > 2; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[3]; // Reserve one zero + } + else + return &buffer[length + offset]; + } + else if (kk < -maxDecimalPlaces) { + // Truncate to zero + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else if (length == 1) { + // 1e30 + buffer[1] = 'e'; + return WriteExponent(kk - 1, &buffer[2]); + } + else { + // 1234e30 -> 1.234e33 + std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); + buffer[1] = '.'; + buffer[length + 1] = 'e'; + return WriteExponent(kk - 1, &buffer[0 + length + 2]); + } +} + +inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { + CEREAL_RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + Double d(value); + if (d.IsZero()) { + if (d.Sign()) + *buffer++ = '-'; // -0.0, Issue #289 + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else { + if (value < 0) { + *buffer++ = '-'; + value = -value; + } + int length, K; + Grisu2(value, buffer, &length, &K); + return Prettify(buffer, length, K, maxDecimalPlaces); + } +} + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_DTOA_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h new file mode 100644 index 000000000..6730dfdc5 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h @@ -0,0 +1,78 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_IEEE754_ +#define CEREAL_RAPIDJSON_IEEE754_ + +#include "../rapidjson.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class Double { +public: + Double() {} + Double(double d) : d_(d) {} + Double(uint64_t u) : u_(u) {} + + double Value() const { return d_; } + uint64_t Uint64Value() const { return u_; } + + double NextPositiveDouble() const { + CEREAL_RAPIDJSON_ASSERT(!Sign()); + return Double(u_ + 1).Value(); + } + + bool Sign() const { return (u_ & kSignMask) != 0; } + uint64_t Significand() const { return u_ & kSignificandMask; } + int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } + + bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } + bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } + bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } + bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } + bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } + + uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } + int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } + uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } + + static int EffectiveSignificandSize(int order) { + if (order >= -1021) + return 53; + else if (order <= -1074) + return 0; + else + return order + 1074; + } + +private: + static const int kSignificandSize = 52; + static const int kExponentBias = 0x3FF; + static const int kDenormalExponent = 1 - kExponentBias; + static const uint64_t kSignMask = CEREAL_RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); + static const uint64_t kExponentMask = CEREAL_RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kSignificandMask = CEREAL_RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kHiddenBit = CEREAL_RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + union { + double d_; + uint64_t u_; + }; +}; + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_IEEE754_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h new file mode 100644 index 000000000..f04e3fa83 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h @@ -0,0 +1,308 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ITOA_ +#define CEREAL_RAPIDJSON_ITOA_ + +#include "../rapidjson.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline const char* GetDigitsLut() { + static const char cDigitsLut[200] = { + '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', + '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', + '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', + '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', + '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', + '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', + '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', + '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', + '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', + '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' + }; + return cDigitsLut; +} + +inline char* u32toa(uint32_t value, char* buffer) { + CEREAL_RAPIDJSON_ASSERT(buffer != 0); + + const char* cDigitsLut = GetDigitsLut(); + + if (value < 10000) { + const uint32_t d1 = (value / 100) << 1; + const uint32_t d2 = (value % 100) << 1; + + if (value >= 1000) + *buffer++ = cDigitsLut[d1]; + if (value >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else if (value < 100000000) { + // value = bbbbcccc + const uint32_t b = value / 10000; + const uint32_t c = value % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + else { + // value = aabbbbcccc in decimal + + const uint32_t a = value / 100000000; // 1 to 42 + value %= 100000000; + + if (a >= 10) { + const unsigned i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else + *buffer++ = static_cast('0' + static_cast(a)); + + const uint32_t b = value / 10000; // 0 to 9999 + const uint32_t c = value % 10000; // 0 to 9999 + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + return buffer; +} + +inline char* i32toa(int32_t value, char* buffer) { + CEREAL_RAPIDJSON_ASSERT(buffer != 0); + uint32_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u32toa(u, buffer); +} + +inline char* u64toa(uint64_t value, char* buffer) { + CEREAL_RAPIDJSON_ASSERT(buffer != 0); + const char* cDigitsLut = GetDigitsLut(); + const uint64_t kTen8 = 100000000; + const uint64_t kTen9 = kTen8 * 10; + const uint64_t kTen10 = kTen8 * 100; + const uint64_t kTen11 = kTen8 * 1000; + const uint64_t kTen12 = kTen8 * 10000; + const uint64_t kTen13 = kTen8 * 100000; + const uint64_t kTen14 = kTen8 * 1000000; + const uint64_t kTen15 = kTen8 * 10000000; + const uint64_t kTen16 = kTen8 * kTen8; + + if (value < kTen8) { + uint32_t v = static_cast(value); + if (v < 10000) { + const uint32_t d1 = (v / 100) << 1; + const uint32_t d2 = (v % 100) << 1; + + if (v >= 1000) + *buffer++ = cDigitsLut[d1]; + if (v >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (v >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else { + // value = bbbbcccc + const uint32_t b = v / 10000; + const uint32_t c = v % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + } + else if (value < kTen16) { + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + if (value >= kTen15) + *buffer++ = cDigitsLut[d1]; + if (value >= kTen14) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= kTen13) + *buffer++ = cDigitsLut[d2]; + if (value >= kTen12) + *buffer++ = cDigitsLut[d2 + 1]; + if (value >= kTen11) + *buffer++ = cDigitsLut[d3]; + if (value >= kTen10) + *buffer++ = cDigitsLut[d3 + 1]; + if (value >= kTen9) + *buffer++ = cDigitsLut[d4]; + + *buffer++ = cDigitsLut[d4 + 1]; + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + else { + const uint32_t a = static_cast(value / kTen16); // 1 to 1844 + value %= kTen16; + + if (a < 10) + *buffer++ = static_cast('0' + static_cast(a)); + else if (a < 100) { + const uint32_t i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else if (a < 1000) { + *buffer++ = static_cast('0' + static_cast(a / 100)); + + const uint32_t i = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else { + const uint32_t i = (a / 100) << 1; + const uint32_t j = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + *buffer++ = cDigitsLut[j]; + *buffer++ = cDigitsLut[j + 1]; + } + + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + + return buffer; +} + +inline char* i64toa(int64_t value, char* buffer) { + CEREAL_RAPIDJSON_ASSERT(buffer != 0); + uint64_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u64toa(u, buffer); +} + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_ITOA_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h new file mode 100644 index 000000000..f511ff8ff --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h @@ -0,0 +1,186 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_INTERNAL_META_H_ +#define CEREAL_RAPIDJSON_INTERNAL_META_H_ + +#include "../rapidjson.h" + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(_MSC_VER) && !defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(6334) +#endif + +#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS +#include +#endif + +//@cond CEREAL_RAPIDJSON_INTERNAL +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching +template struct Void { typedef void Type; }; + +/////////////////////////////////////////////////////////////////////////////// +// BoolType, TrueType, FalseType +// +template struct BoolType { + static const bool Value = Cond; + typedef BoolType Type; +}; +typedef BoolType TrueType; +typedef BoolType FalseType; + + +/////////////////////////////////////////////////////////////////////////////// +// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr +// + +template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; +template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; +template struct SelectIfCond : SelectIfImpl::template Apply {}; +template struct SelectIf : SelectIfCond {}; + +template struct AndExprCond : FalseType {}; +template <> struct AndExprCond : TrueType {}; +template struct OrExprCond : TrueType {}; +template <> struct OrExprCond : FalseType {}; + +template struct BoolExpr : SelectIf::Type {}; +template struct NotExpr : SelectIf::Type {}; +template struct AndExpr : AndExprCond::Type {}; +template struct OrExpr : OrExprCond::Type {}; + + +/////////////////////////////////////////////////////////////////////////////// +// AddConst, MaybeAddConst, RemoveConst +template struct AddConst { typedef const T Type; }; +template struct MaybeAddConst : SelectIfCond {}; +template struct RemoveConst { typedef T Type; }; +template struct RemoveConst { typedef T Type; }; + + +/////////////////////////////////////////////////////////////////////////////// +// IsSame, IsConst, IsMoreConst, IsPointer +// +template struct IsSame : FalseType {}; +template struct IsSame : TrueType {}; + +template struct IsConst : FalseType {}; +template struct IsConst : TrueType {}; + +template +struct IsMoreConst + : AndExpr::Type, typename RemoveConst::Type>, + BoolType::Value >= IsConst::Value> >::Type {}; + +template struct IsPointer : FalseType {}; +template struct IsPointer : TrueType {}; + +/////////////////////////////////////////////////////////////////////////////// +// IsBaseOf +// +#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS + +template struct IsBaseOf + : BoolType< ::std::is_base_of::value> {}; + +#else // simplified version adopted from Boost + +template struct IsBaseOfImpl { + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); + CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); + + typedef char (&Yes)[1]; + typedef char (&No) [2]; + + template + static Yes Check(const D*, T); + static No Check(const B*, int); + + struct Host { + operator const B*() const; + operator const D*(); + }; + + enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; +}; + +template struct IsBaseOf + : OrExpr, BoolExpr > >::Type {}; + +#endif // CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS + + +////////////////////////////////////////////////////////////////////////// +// EnableIf / DisableIf +// +template struct EnableIfCond { typedef T Type; }; +template struct EnableIfCond { /* empty */ }; + +template struct DisableIfCond { typedef T Type; }; +template struct DisableIfCond { /* empty */ }; + +template +struct EnableIf : EnableIfCond {}; + +template +struct DisableIf : DisableIfCond {}; + +// SFINAE helpers +struct SfinaeTag {}; +template struct RemoveSfinaeTag; +template struct RemoveSfinaeTag { typedef T Type; }; + +#define CEREAL_RAPIDJSON_REMOVEFPTR_(type) \ + typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ + < ::CEREAL_RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type + +#define CEREAL_RAPIDJSON_ENABLEIF(cond) \ + typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type * = NULL + +#define CEREAL_RAPIDJSON_DISABLEIF(cond) \ + typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type * = NULL + +#define CEREAL_RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ + typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type + +#define CEREAL_RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ + typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END +//@endcond + +#if defined(_MSC_VER) && !defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_INTERNAL_META_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h new file mode 100644 index 000000000..7f796a153 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h @@ -0,0 +1,55 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_POW10_ +#define CEREAL_RAPIDJSON_POW10_ + +#include "../rapidjson.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Computes integer powers of 10 in double (10.0^n). +/*! This function uses lookup table for fast and accurate results. + \param n non-negative exponent. Must <= 308. + \return 10.0^n +*/ +inline double Pow10(int n) { + static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes + 1e+0, + 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, + 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, + 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, + 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, + 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, + 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, + 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, + 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, + 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, + 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, + 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, + 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, + 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, + 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, + 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, + 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 + }; + CEREAL_RAPIDJSON_ASSERT(n >= 0 && n <= 308); + return e[n]; +} + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_POW10_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h new file mode 100644 index 000000000..6c2ed6eff --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h @@ -0,0 +1,740 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ +#define CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ + +#include "../allocators.h" +#include "../stream.h" +#include "stack.h" + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) +CEREAL_RAPIDJSON_DIAG_OFF(implicit-fallthrough) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#if __GNUC__ >= 7 +CEREAL_RAPIDJSON_DIAG_OFF(implicit-fallthrough) +#endif +#endif + +#ifndef CEREAL_RAPIDJSON_REGEX_VERBOSE +#define CEREAL_RAPIDJSON_REGEX_VERBOSE 0 +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// DecodedStream + +template +class DecodedStream { +public: + DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); } + unsigned Peek() { return codepoint_; } + unsigned Take() { + unsigned c = codepoint_; + if (c) // No further decoding when '\0' + Decode(); + return c; + } + +private: + void Decode() { + if (!Encoding::Decode(ss_, &codepoint_)) + codepoint_ = 0; + } + + SourceStream& ss_; + unsigned codepoint_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericRegex + +static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1 +static const SizeType kRegexInvalidRange = ~SizeType(0); + +template +class GenericRegexSearch; + +//! Regular expression engine with subset of ECMAscript grammar. +/*! + Supported regular expression syntax: + - \c ab Concatenation + - \c a|b Alternation + - \c a? Zero or one + - \c a* Zero or more + - \c a+ One or more + - \c a{3} Exactly 3 times + - \c a{3,} At least 3 times + - \c a{3,5} 3 to 5 times + - \c (ab) Grouping + - \c ^a At the beginning + - \c a$ At the end + - \c . Any character + - \c [abc] Character classes + - \c [a-c] Character class range + - \c [a-z0-9_] Character class combination + - \c [^abc] Negated character classes + - \c [^a-c] Negated character class range + - \c [\b] Backspace (U+0008) + - \c \\| \\\\ ... Escape characters + - \c \\f Form feed (U+000C) + - \c \\n Line feed (U+000A) + - \c \\r Carriage return (U+000D) + - \c \\t Tab (U+0009) + - \c \\v Vertical tab (U+000B) + + \note This is a Thompson NFA engine, implemented with reference to + Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", + https://swtch.com/~rsc/regexp/regexp1.html +*/ +template +class GenericRegex { +public: + typedef Encoding EncodingType; + typedef typename Encoding::Ch Ch; + template friend class GenericRegexSearch; + + GenericRegex(const Ch* source, Allocator* allocator = 0) : + ownAllocator_(allocator ? 0 : CEREAL_RAPIDJSON_NEW(Allocator)()), allocator_(allocator ? allocator : ownAllocator_), + states_(allocator_, 256), ranges_(allocator_, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(), + anchorBegin_(), anchorEnd_() + { + GenericStringStream ss(source); + DecodedStream, Encoding> ds(ss); + Parse(ds); + } + + ~GenericRegex() + { + CEREAL_RAPIDJSON_DELETE(ownAllocator_); + } + + bool IsValid() const { + return root_ != kRegexInvalidState; + } + +private: + enum Operator { + kZeroOrOne, + kZeroOrMore, + kOneOrMore, + kConcatenation, + kAlternation, + kLeftParenthesis + }; + + static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.' + static const unsigned kRangeCharacterClass = 0xFFFFFFFE; + static const unsigned kRangeNegationFlag = 0x80000000; + + struct Range { + unsigned start; // + unsigned end; + SizeType next; + }; + + struct State { + SizeType out; //!< Equals to kInvalid for matching state + SizeType out1; //!< Equals to non-kInvalid for split + SizeType rangeStart; + unsigned codepoint; + }; + + struct Frag { + Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {} + SizeType start; + SizeType out; //!< link-list of all output states + SizeType minIndex; + }; + + State& GetState(SizeType index) { + CEREAL_RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + const State& GetState(SizeType index) const { + CEREAL_RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + Range& GetRange(SizeType index) { + CEREAL_RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + const Range& GetRange(SizeType index) const { + CEREAL_RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + template + void Parse(DecodedStream& ds) { + Stack operandStack(allocator_, 256); // Frag + Stack operatorStack(allocator_, 256); // Operator + Stack atomCountStack(allocator_, 256); // unsigned (Atom per parenthesis) + + *atomCountStack.template Push() = 0; + + unsigned codepoint; + while (ds.Peek() != 0) { + switch (codepoint = ds.Take()) { + case '^': + anchorBegin_ = true; + break; + + case '$': + anchorEnd_ = true; + break; + + case '|': + while (!operatorStack.Empty() && *operatorStack.template Top() < kAlternation) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + *operatorStack.template Push() = kAlternation; + *atomCountStack.template Top() = 0; + break; + + case '(': + *operatorStack.template Push() = kLeftParenthesis; + *atomCountStack.template Push() = 0; + break; + + case ')': + while (!operatorStack.Empty() && *operatorStack.template Top() != kLeftParenthesis) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + if (operatorStack.Empty()) + return; + operatorStack.template Pop(1); + atomCountStack.template Pop(1); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '?': + if (!Eval(operandStack, kZeroOrOne)) + return; + break; + + case '*': + if (!Eval(operandStack, kZeroOrMore)) + return; + break; + + case '+': + if (!Eval(operandStack, kOneOrMore)) + return; + break; + + case '{': + { + unsigned n, m; + if (!ParseUnsigned(ds, &n)) + return; + + if (ds.Peek() == ',') { + ds.Take(); + if (ds.Peek() == '}') + m = kInfinityQuantifier; + else if (!ParseUnsigned(ds, &m) || m < n) + return; + } + else + m = n; + + if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}') + return; + ds.Take(); + } + break; + + case '.': + PushOperand(operandStack, kAnyCharacterClass); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '[': + { + SizeType range; + if (!ParseRange(ds, &range)) + return; + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass); + GetState(s).rangeStart = range; + *operandStack.template Push() = Frag(s, s, s); + } + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '\\': // Escape character + if (!CharacterEscape(ds, &codepoint)) + return; // Unsupported escape character + // fall through to default + + default: // Pattern character + PushOperand(operandStack, codepoint); + ImplicitConcatenation(atomCountStack, operatorStack); + } + } + + while (!operatorStack.Empty()) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + + // Link the operand to matching state. + if (operandStack.GetSize() == sizeof(Frag)) { + Frag* e = operandStack.template Pop(1); + Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0)); + root_ = e->start; + +#if CEREAL_RAPIDJSON_REGEX_VERBOSE + printf("root: %d\n", root_); + for (SizeType i = 0; i < stateCount_ ; i++) { + State& s = GetState(i); + printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint); + } + printf("\n"); +#endif + } + } + + SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) { + State* s = states_.template Push(); + s->out = out; + s->out1 = out1; + s->codepoint = codepoint; + s->rangeStart = kRegexInvalidRange; + return stateCount_++; + } + + void PushOperand(Stack& operandStack, unsigned codepoint) { + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint); + *operandStack.template Push() = Frag(s, s, s); + } + + void ImplicitConcatenation(Stack& atomCountStack, Stack& operatorStack) { + if (*atomCountStack.template Top()) + *operatorStack.template Push() = kConcatenation; + (*atomCountStack.template Top())++; + } + + SizeType Append(SizeType l1, SizeType l2) { + SizeType old = l1; + while (GetState(l1).out != kRegexInvalidState) + l1 = GetState(l1).out; + GetState(l1).out = l2; + return old; + } + + void Patch(SizeType l, SizeType s) { + for (SizeType next; l != kRegexInvalidState; l = next) { + next = GetState(l).out; + GetState(l).out = s; + } + } + + bool Eval(Stack& operandStack, Operator op) { + switch (op) { + case kConcatenation: + CEREAL_RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2); + { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + Patch(e1.out, e2.start); + *operandStack.template Push() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex)); + } + return true; + + case kAlternation: + if (operandStack.GetSize() >= sizeof(Frag) * 2) { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + SizeType s = NewState(e1.start, e2.start, 0); + *operandStack.template Push() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex)); + return true; + } + return false; + + case kZeroOrOne: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + *operandStack.template Push() = Frag(s, Append(e.out, s), e.minIndex); + return true; + } + return false; + + case kZeroOrMore: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(s, s, e.minIndex); + return true; + } + return false; + + case kOneOrMore: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(e.start, s, e.minIndex); + return true; + } + return false; + + default: + // syntax error (e.g. unclosed kLeftParenthesis) + return false; + } + } + + bool EvalQuantifier(Stack& operandStack, unsigned n, unsigned m) { + CEREAL_RAPIDJSON_ASSERT(n <= m); + CEREAL_RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag)); + + if (n == 0) { + if (m == 0) // a{0} not support + return false; + else if (m == kInfinityQuantifier) + Eval(operandStack, kZeroOrMore); // a{0,} -> a* + else { + Eval(operandStack, kZeroOrOne); // a{0,5} -> a? + for (unsigned i = 0; i < m - 1; i++) + CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a? + for (unsigned i = 0; i < m - 1; i++) + Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a? + } + return true; + } + + for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a + CloneTopOperand(operandStack); + + if (m == kInfinityQuantifier) + Eval(operandStack, kOneOrMore); // a{3,} -> a a a+ + else if (m > n) { + CloneTopOperand(operandStack); // a{3,5} -> a a a a + Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a? + for (unsigned i = n; i < m - 1; i++) + CloneTopOperand(operandStack); // a{3,5} -> a a a a? a? + for (unsigned i = n; i < m; i++) + Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a? + } + + for (unsigned i = 0; i < n - 1; i++) + Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a? + + return true; + } + + static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; } + + void CloneTopOperand(Stack& operandStack) { + const Frag src = *operandStack.template Top(); // Copy constructor to prevent invalidation + SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_) + State* s = states_.template Push(count); + memcpy(s, &GetState(src.minIndex), count * sizeof(State)); + for (SizeType j = 0; j < count; j++) { + if (s[j].out != kRegexInvalidState) + s[j].out += count; + if (s[j].out1 != kRegexInvalidState) + s[j].out1 += count; + } + *operandStack.template Push() = Frag(src.start + count, src.out + count, src.minIndex + count); + stateCount_ += count; + } + + template + bool ParseUnsigned(DecodedStream& ds, unsigned* u) { + unsigned r = 0; + if (ds.Peek() < '0' || ds.Peek() > '9') + return false; + while (ds.Peek() >= '0' && ds.Peek() <= '9') { + if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295 + return false; // overflow + r = r * 10 + (ds.Take() - '0'); + } + *u = r; + return true; + } + + template + bool ParseRange(DecodedStream& ds, SizeType* range) { + bool isBegin = true; + bool negate = false; + int step = 0; + SizeType start = kRegexInvalidRange; + SizeType current = kRegexInvalidRange; + unsigned codepoint; + while ((codepoint = ds.Take()) != 0) { + if (isBegin) { + isBegin = false; + if (codepoint == '^') { + negate = true; + continue; + } + } + + switch (codepoint) { + case ']': + if (start == kRegexInvalidRange) + return false; // Error: nothing inside [] + if (step == 2) { // Add trailing '-' + SizeType r = NewRange('-'); + CEREAL_RAPIDJSON_ASSERT(current != kRegexInvalidRange); + GetRange(current).next = r; + } + if (negate) + GetRange(start).start |= kRangeNegationFlag; + *range = start; + return true; + + case '\\': + if (ds.Peek() == 'b') { + ds.Take(); + codepoint = 0x0008; // Escape backspace character + } + else if (!CharacterEscape(ds, &codepoint)) + return false; + // fall through to default + + default: + switch (step) { + case 1: + if (codepoint == '-') { + step++; + break; + } + // fall through to step 0 for other characters + + case 0: + { + SizeType r = NewRange(codepoint); + if (current != kRegexInvalidRange) + GetRange(current).next = r; + if (start == kRegexInvalidRange) + start = r; + current = r; + } + step = 1; + break; + + default: + CEREAL_RAPIDJSON_ASSERT(step == 2); + GetRange(current).end = codepoint; + step = 0; + } + } + } + return false; + } + + SizeType NewRange(unsigned codepoint) { + Range* r = ranges_.template Push(); + r->start = r->end = codepoint; + r->next = kRegexInvalidRange; + return rangeCount_++; + } + + template + bool CharacterEscape(DecodedStream& ds, unsigned* escapedCodepoint) { + unsigned codepoint; + switch (codepoint = ds.Take()) { + case '^': + case '$': + case '|': + case '(': + case ')': + case '?': + case '*': + case '+': + case '.': + case '[': + case ']': + case '{': + case '}': + case '\\': + *escapedCodepoint = codepoint; return true; + case 'f': *escapedCodepoint = 0x000C; return true; + case 'n': *escapedCodepoint = 0x000A; return true; + case 'r': *escapedCodepoint = 0x000D; return true; + case 't': *escapedCodepoint = 0x0009; return true; + case 'v': *escapedCodepoint = 0x000B; return true; + default: + return false; // Unsupported escape character + } + } + + Allocator* ownAllocator_; + Allocator* allocator_; + Stack states_; + Stack ranges_; + SizeType root_; + SizeType stateCount_; + SizeType rangeCount_; + + static const unsigned kInfinityQuantifier = ~0u; + + // For SearchWithAnchoring() + bool anchorBegin_; + bool anchorEnd_; +}; + +template +class GenericRegexSearch { +public: + typedef typename RegexType::EncodingType Encoding; + typedef typename Encoding::Ch Ch; + + GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) : + regex_(regex), allocator_(allocator), ownAllocator_(0), + state0_(allocator, 0), state1_(allocator, 0), stateSet_() + { + CEREAL_RAPIDJSON_ASSERT(regex_.IsValid()); + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + stateSet_ = static_cast(allocator_->Malloc(GetStateSetSize())); + state0_.template Reserve(regex_.stateCount_); + state1_.template Reserve(regex_.stateCount_); + } + + ~GenericRegexSearch() { + Allocator::Free(stateSet_); + CEREAL_RAPIDJSON_DELETE(ownAllocator_); + } + + template + bool Match(InputStream& is) { + return SearchWithAnchoring(is, true, true); + } + + bool Match(const Ch* s) { + GenericStringStream is(s); + return Match(is); + } + + template + bool Search(InputStream& is) { + return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_); + } + + bool Search(const Ch* s) { + GenericStringStream is(s); + return Search(is); + } + +private: + typedef typename RegexType::State State; + typedef typename RegexType::Range Range; + + template + bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) { + DecodedStream ds(is); + + state0_.Clear(); + Stack *current = &state0_, *next = &state1_; + const size_t stateSetSize = GetStateSetSize(); + std::memset(stateSet_, 0, stateSetSize); + + bool matched = AddState(*current, regex_.root_); + unsigned codepoint; + while (!current->Empty() && (codepoint = ds.Take()) != 0) { + std::memset(stateSet_, 0, stateSetSize); + next->Clear(); + matched = false; + for (const SizeType* s = current->template Bottom(); s != current->template End(); ++s) { + const State& sr = regex_.GetState(*s); + if (sr.codepoint == codepoint || + sr.codepoint == RegexType::kAnyCharacterClass || + (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint))) + { + matched = AddState(*next, sr.out) || matched; + if (!anchorEnd && matched) + return true; + } + if (!anchorBegin) + AddState(*next, regex_.root_); + } + internal::Swap(current, next); + } + + return matched; + } + + size_t GetStateSetSize() const { + return (regex_.stateCount_ + 31) / 32 * 4; + } + + // Return whether the added states is a match state + bool AddState(Stack& l, SizeType index) { + CEREAL_RAPIDJSON_ASSERT(index != kRegexInvalidState); + + const State& s = regex_.GetState(index); + if (s.out1 != kRegexInvalidState) { // Split + bool matched = AddState(l, s.out); + return AddState(l, s.out1) || matched; + } + else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) { + stateSet_[index >> 5] |= (1u << (index & 31)); + *l.template PushUnsafe() = index; + } + return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation. + } + + bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { + bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0; + while (rangeIndex != kRegexInvalidRange) { + const Range& r = regex_.GetRange(rangeIndex); + if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end) + return yes; + rangeIndex = r.next; + } + return !yes; + } + + const RegexType& regex_; + Allocator* allocator_; + Allocator* ownAllocator_; + Stack state0_; + Stack state1_; + uint32_t* stateSet_; +}; + +typedef GenericRegex > Regex; +typedef GenericRegexSearch RegexSearch; + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#if defined(__clang__) || defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h new file mode 100644 index 000000000..be77088f9 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h @@ -0,0 +1,232 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_INTERNAL_STACK_H_ +#define CEREAL_RAPIDJSON_INTERNAL_STACK_H_ + +#include "../allocators.h" +#include "swap.h" +#include + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// Stack + +//! A type-unsafe stack for storing different types of data. +/*! \tparam Allocator Allocator for allocating stack memory. +*/ +template +class Stack { +public: + // Optimization note: Do not allocate memory for stack_ in constructor. + // Do it lazily when first Push() -> Expand() -> Resize(). + Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack(Stack&& rhs) + : allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(rhs.stack_), + stackTop_(rhs.stackTop_), + stackEnd_(rhs.stackEnd_), + initialCapacity_(rhs.initialCapacity_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } +#endif + + ~Stack() { + Destroy(); + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack& operator=(Stack&& rhs) { + if (&rhs != this) + { + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = rhs.stack_; + stackTop_ = rhs.stackTop_; + stackEnd_ = rhs.stackEnd_; + initialCapacity_ = rhs.initialCapacity_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } + return *this; + } +#endif + + void Swap(Stack& rhs) CEREAL_RAPIDJSON_NOEXCEPT { + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(stack_, rhs.stack_); + internal::Swap(stackTop_, rhs.stackTop_); + internal::Swap(stackEnd_, rhs.stackEnd_); + internal::Swap(initialCapacity_, rhs.initialCapacity_); + } + + void Clear() { stackTop_ = stack_; } + + void ShrinkToFit() { + if (Empty()) { + // If the stack is empty, completely deallocate the memory. + Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc) + stack_ = 0; + stackTop_ = 0; + stackEnd_ = 0; + } + else + Resize(GetSize()); + } + + // Optimization note: try to minimize the size of this function for force inline. + // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. + template + CEREAL_RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { + // Expand the stack if needed + if (CEREAL_RAPIDJSON_UNLIKELY(static_cast(sizeof(T) * count) > (stackEnd_ - stackTop_))) + Expand(count); + } + + template + CEREAL_RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { + Reserve(count); + return PushUnsafe(count); + } + + template + CEREAL_RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { + CEREAL_RAPIDJSON_ASSERT(stackTop_); + CEREAL_RAPIDJSON_ASSERT(static_cast(sizeof(T) * count) <= (stackEnd_ - stackTop_)); + T* ret = reinterpret_cast(stackTop_); + stackTop_ += sizeof(T) * count; + return ret; + } + + template + T* Pop(size_t count) { + CEREAL_RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); + stackTop_ -= count * sizeof(T); + return reinterpret_cast(stackTop_); + } + + template + T* Top() { + CEREAL_RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + const T* Top() const { + CEREAL_RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + T* End() { return reinterpret_cast(stackTop_); } + + template + const T* End() const { return reinterpret_cast(stackTop_); } + + template + T* Bottom() { return reinterpret_cast(stack_); } + + template + const T* Bottom() const { return reinterpret_cast(stack_); } + + bool HasAllocator() const { + return allocator_ != 0; + } + + Allocator& GetAllocator() { + CEREAL_RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + bool Empty() const { return stackTop_ == stack_; } + size_t GetSize() const { return static_cast(stackTop_ - stack_); } + size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } + +private: + template + void Expand(size_t count) { + // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. + size_t newCapacity; + if (stack_ == 0) { + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + newCapacity = initialCapacity_; + } else { + newCapacity = GetCapacity(); + newCapacity += (newCapacity + 1) / 2; + } + size_t newSize = GetSize() + sizeof(T) * count; + if (newCapacity < newSize) + newCapacity = newSize; + + Resize(newCapacity); + } + + void Resize(size_t newCapacity) { + const size_t size = GetSize(); // Backup the current size + stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); + stackTop_ = stack_ + size; + stackEnd_ = stack_ + newCapacity; + } + + void Destroy() { + Allocator::Free(stack_); + CEREAL_RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack + } + + // Prohibit copy constructor & assignment operator. + Stack(const Stack&); + Stack& operator=(const Stack&); + + Allocator* allocator_; + Allocator* ownAllocator_; + char *stack_; + char *stackTop_; + char *stackEnd_; + size_t initialCapacity_; +}; + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_STACK_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h new file mode 100644 index 000000000..44af229de --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h @@ -0,0 +1,69 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ +#define CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ + +#include "../stream.h" +#include + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom strlen() which works on different character types. +/*! \tparam Ch Character type (e.g. char, wchar_t, short) + \param s Null-terminated input string. + \return Number of characters in the string. + \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. +*/ +template +inline SizeType StrLen(const Ch* s) { + CEREAL_RAPIDJSON_ASSERT(s != 0); + const Ch* p = s; + while (*p) ++p; + return SizeType(p - s); +} + +template <> +inline SizeType StrLen(const char* s) { + return SizeType(std::strlen(s)); +} + +template <> +inline SizeType StrLen(const wchar_t* s) { + return SizeType(std::wcslen(s)); +} + +//! Returns number of code points in a encoded string. +template +bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { + CEREAL_RAPIDJSON_ASSERT(s != 0); + CEREAL_RAPIDJSON_ASSERT(outCount != 0); + GenericStringStream is(s); + const typename Encoding::Ch* end = s + length; + SizeType count = 0; + while (is.src_ < end) { + unsigned codepoint; + if (!Encoding::Decode(is, &codepoint)) + return false; + count++; + } + *outCount = count; + return true; +} + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h new file mode 100644 index 000000000..d60c740b5 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h @@ -0,0 +1,290 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_STRTOD_ +#define CEREAL_RAPIDJSON_STRTOD_ + +#include "ieee754.h" +#include "biginteger.h" +#include "diyfp.h" +#include "pow10.h" +#include +#include + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline double FastPath(double significand, int exp) { + if (exp < -308) + return 0.0; + else if (exp >= 0) + return significand * internal::Pow10(exp); + else + return significand / internal::Pow10(-exp); +} + +inline double StrtodNormalPrecision(double d, int p) { + if (p < -308) { + // Prevent expSum < -308, making Pow10(p) = 0 + d = FastPath(d, -308); + d = FastPath(d, p + 308); + } + else + d = FastPath(d, p); + return d; +} + +template +inline T Min3(T a, T b, T c) { + T m = a; + if (m > b) m = b; + if (m > c) m = c; + return m; +} + +inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { + const Double db(b); + const uint64_t bInt = db.IntegerSignificand(); + const int bExp = db.IntegerExponent(); + const int hExp = bExp - 1; + + int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; + + // Adjust for decimal exponent + if (dExp >= 0) { + dS_Exp2 += dExp; + dS_Exp5 += dExp; + } + else { + bS_Exp2 -= dExp; + bS_Exp5 -= dExp; + hS_Exp2 -= dExp; + hS_Exp5 -= dExp; + } + + // Adjust for binary exponent + if (bExp >= 0) + bS_Exp2 += bExp; + else { + dS_Exp2 -= bExp; + hS_Exp2 -= bExp; + } + + // Adjust for half ulp exponent + if (hExp >= 0) + hS_Exp2 += hExp; + else { + dS_Exp2 -= hExp; + bS_Exp2 -= hExp; + } + + // Remove common power of two factor from all three scaled values + int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); + dS_Exp2 -= common_Exp2; + bS_Exp2 -= common_Exp2; + hS_Exp2 -= common_Exp2; + + BigInteger dS = d; + dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); + + BigInteger bS(bInt); + bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); + + BigInteger hS(1); + hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); + + BigInteger delta(0); + dS.Difference(bS, &delta); + + return delta.Compare(hS); +} + +inline bool StrtodFast(double d, int p, double* result) { + // Use fast path for string-to-double conversion if possible + // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + if (p > 22 && p < 22 + 16) { + // Fast Path Cases In Disguise + d *= internal::Pow10(p - 22); + p = 22; + } + + if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 + *result = FastPath(d, p); + return true; + } + else + return false; +} + +// Compute an approximation and see if it is within 1/2 ULP +inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result) { + uint64_t significand = 0; + int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 + for (; i < dLen; i++) { + if (significand > CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || + (significand == CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > '5')) + break; + significand = significand * 10u + static_cast(decimals[i] - '0'); + } + + if (i < dLen && decimals[i] >= '5') // Rounding + significand++; + + int remaining = dLen - i; + const int kUlpShift = 3; + const int kUlp = 1 << kUlpShift; + int64_t error = (remaining == 0) ? 0 : kUlp / 2; + + DiyFp v(significand, 0); + v = v.Normalize(); + error <<= -v.e; + + dExp += remaining; + + int actualExp; + DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); + if (actualExp != dExp) { + static const DiyFp kPow10[] = { + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6 + DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7 + }; + int adjustment = dExp - actualExp; + CEREAL_RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8); + v = v * kPow10[adjustment - 1]; + if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit + error += kUlp / 2; + } + + v = v * cachedPower; + + error += kUlp + (error == 0 ? 0 : 1); + + const int oldExp = v.e; + v = v.Normalize(); + error <<= oldExp - v.e; + + const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); + int precisionSize = 64 - effectiveSignificandSize; + if (precisionSize + kUlpShift >= 64) { + int scaleExp = (precisionSize + kUlpShift) - 63; + v.f >>= scaleExp; + v.e += scaleExp; + error = (error >> scaleExp) + 1 + kUlp; + precisionSize -= scaleExp; + } + + DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); + const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; + const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; + if (precisionBits >= halfWay + static_cast(error)) { + rounded.f++; + if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) + rounded.f >>= 1; + rounded.e++; + } + } + + *result = rounded.ToDouble(); + + return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); +} + +inline double StrtodBigInteger(double approx, const char* decimals, int dLen, int dExp) { + CEREAL_RAPIDJSON_ASSERT(dLen >= 0); + const BigInteger dInt(decimals, static_cast(dLen)); + Double a(approx); + int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); + if (cmp < 0) + return a.Value(); // within half ULP + else if (cmp == 0) { + // Round towards even + if (a.Significand() & 1) + return a.NextPositiveDouble(); + else + return a.Value(); + } + else // adjustment + return a.NextPositiveDouble(); +} + +inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) { + CEREAL_RAPIDJSON_ASSERT(d >= 0.0); + CEREAL_RAPIDJSON_ASSERT(length >= 1); + + double result = 0.0; + if (StrtodFast(d, p, &result)) + return result; + + CEREAL_RAPIDJSON_ASSERT(length <= INT_MAX); + int dLen = static_cast(length); + + CEREAL_RAPIDJSON_ASSERT(length >= decimalPosition); + CEREAL_RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX); + int dExpAdjust = static_cast(length - decimalPosition); + + CEREAL_RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust); + int dExp = exp - dExpAdjust; + + // Make sure length+dExp does not overflow + CEREAL_RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen); + + // Trim leading zeros + while (dLen > 0 && *decimals == '0') { + dLen--; + decimals++; + } + + // Trim trailing zeros + while (dLen > 0 && decimals[dLen - 1] == '0') { + dLen--; + dExp++; + } + + if (dLen == 0) { // Buffer only contains zeros. + return 0.0; + } + + // Trim right-most digits + const int kMaxDecimalDigit = 767 + 1; + if (dLen > kMaxDecimalDigit) { + dExp += dLen - kMaxDecimalDigit; + dLen = kMaxDecimalDigit; + } + + // If too small, underflow to zero. + // Any x <= 10^-324 is interpreted as zero. + if (dLen + dExp <= -324) + return 0.0; + + // If too large, overflow to infinity. + // Any x >= 10^309 is interpreted as +infinity. + if (dLen + dExp > 309) + return std::numeric_limits::infinity(); + + if (StrtodDiyFp(decimals, dLen, dExp, &result)) + return result; + + // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison + return StrtodBigInteger(result, decimals, dLen, dExp); +} + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_STRTOD_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h new file mode 100644 index 000000000..5d8910ce5 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h @@ -0,0 +1,46 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ +#define CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ + +#include "../rapidjson.h" + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom swap() to avoid dependency on C++ header +/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. + \note This has the same semantics as std::swap(). +*/ +template +inline void Swap(T& a, T& b) CEREAL_RAPIDJSON_NOEXCEPT { + T tmp = a; + a = b; + b = tmp; +} + +} // namespace internal +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h new file mode 100644 index 000000000..4df7ce3e2 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h @@ -0,0 +1,128 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ +#define CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ + +#include "stream.h" +#include +#include + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::istringstream + - \c std::stringstream + - \c std::wistringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wifstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_istream. +*/ + +template +class BasicIStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + + //! Constructor. + /*! + \param stream stream opened for read. + */ + BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + Read(); + } + + //! Constructor. + /*! + \param stream stream opened for read. + \param buffer user-supplied buffer. + \param bufferSize size of buffer in bytes. Must >=4 bytes. + */ + BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + CEREAL_RAPIDJSON_ASSERT(bufferSize >= 4); + Read(); + } + + Ch Peek() const { return *current_; } + Ch Take() { Ch c = *current_; Read(); return c; } + size_t Tell() const { return count_ + static_cast(current_ - buffer_); } + + // Not implemented + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; + } + +private: + BasicIStreamWrapper(); + BasicIStreamWrapper(const BasicIStreamWrapper&); + BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); + + void Read() { + if (current_ < bufferLast_) + ++current_; + else if (!eof_) { + count_ += readCount_; + readCount_ = bufferSize_; + bufferLast_ = buffer_ + readCount_ - 1; + current_ = buffer_; + + if (!stream_.read(buffer_, static_cast(bufferSize_))) { + readCount_ = static_cast(stream_.gcount()); + *(bufferLast_ = buffer_ + readCount_) = '\0'; + eof_ = true; + } + } + } + + StreamType &stream_; + Ch peekBuffer_[4], *buffer_; + size_t bufferSize_; + Ch *bufferLast_; + Ch *current_; + size_t readCount_; + size_t count_; //!< Number of characters read + bool eof_; +}; + +typedef BasicIStreamWrapper IStreamWrapper; +typedef BasicIStreamWrapper WIStreamWrapper; + +#if defined(__clang__) || defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h new file mode 100644 index 000000000..0cd75cf47 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h @@ -0,0 +1,70 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_MEMORYBUFFER_H_ +#define CEREAL_RAPIDJSON_MEMORYBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output byte stream. +/*! + This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. + + It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. + + Differences between MemoryBuffer and StringBuffer: + 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. + 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. + + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +struct GenericMemoryBuffer { + typedef char Ch; // byte + + GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + + void Put(Ch c) { *stack_.template Push() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { stack_.ShrinkToFit(); } + Ch* Push(size_t count) { return stack_.template Push(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetBuffer() const { + return stack_.template Bottom(); + } + + size_t GetSize() const { return stack_.GetSize(); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; +}; + +typedef GenericMemoryBuffer<> MemoryBuffer; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { + std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); +} + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h new file mode 100644 index 000000000..326bda54f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h @@ -0,0 +1,71 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_MEMORYSTREAM_H_ +#define CEREAL_RAPIDJSON_MEMORYSTREAM_H_ + +#include "stream.h" + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) +CEREAL_RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory input byte stream. +/*! + This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. + + It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. + + Differences between MemoryStream and StringStream: + 1. StringStream has encoding but MemoryStream is a byte stream. + 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. + 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). + \note implements Stream concept +*/ +struct MemoryStream { + typedef char Ch; // byte + + MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} + + Ch Peek() const { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } + Ch Take() { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } + size_t Tell() const { return static_cast(src_ - begin_); } + + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return Tell() + 4 <= size_ ? src_ : 0; + } + + const Ch* src_; //!< Current read position. + const Ch* begin_; //!< Original head of the string. + const Ch* end_; //!< End of stream. + size_t size_; //!< Size of the stream. +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE new file mode 100644 index 000000000..e3d96f8fb --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE @@ -0,0 +1,29 @@ +ISO C9x compliant stdint.h for Microsoft Visual Studio +Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 + + Copyright (c) 2006-2013 Alexander Chemeris + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the product nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h new file mode 100644 index 000000000..18111286b --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h @@ -0,0 +1,316 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the product nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// miloyip: VC supports inttypes.h since VC2013 +#if _MSC_VER >= 1800 +#include +#else + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + +#endif // _MSC_VER >= 1800 + +#endif // _MSC_INTTYPES_H_ ] diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h new file mode 100644 index 000000000..3d4477b9a --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h @@ -0,0 +1,300 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the product nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. +#if _MSC_VER >= 1600 // [ +#include + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +#undef INT8_C +#undef INT16_C +#undef INT32_C +#undef INT64_C +#undef UINT8_C +#undef UINT16_C +#undef UINT32_C +#undef UINT64_C + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#else // ] _MSC_VER >= 1700 [ + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we have to wrap include with 'extern "C++" {}' +// or compiler would give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#if defined(__cplusplus) && !defined(_M_ARM) +extern "C" { +#endif +# include +#if defined(__cplusplus) && !defined(_M_ARM) +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#endif // _MSC_VER >= 1600 ] + +#endif // _MSC_STDINT_H_ ] diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h new file mode 100644 index 000000000..58c034a24 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h @@ -0,0 +1,81 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ +#define CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::ostringstream + - \c std::stringstream + - \c std::wpstringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wofstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_ostream. +*/ + +template +class BasicOStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} + + void Put(Ch c) { + stream_.put(c); + } + + void Flush() { + stream_.flush(); + } + + // Not implemented + char Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + char Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + +private: + BasicOStreamWrapper(const BasicOStreamWrapper&); + BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); + + StreamType& stream_; +}; + +typedef BasicOStreamWrapper OStreamWrapper; +typedef BasicOStreamWrapper WOStreamWrapper; + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h new file mode 100644 index 000000000..930970f98 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h @@ -0,0 +1,1414 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_POINTER_H_ +#define CEREAL_RAPIDJSON_POINTER_H_ + +#include "document.h" +#include "internal/itoa.h" + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token + +//! Error code of parsing. +/*! \ingroup CEREAL_RAPIDJSON_ERRORS + \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode +*/ +enum PointerParseErrorCode { + kPointerParseErrorNone = 0, //!< The parse is successful + + kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/' + kPointerParseErrorInvalidEscape, //!< Invalid escape + kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment + kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericPointer + +//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. +/*! + This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer" + (https://tools.ietf.org/html/rfc6901). + + A JSON pointer is for identifying a specific value in a JSON document + (GenericDocument). It can simplify coding of DOM tree manipulation, because it + can access multiple-level depth of DOM tree with single API call. + + After it parses a string representation (e.g. "/foo/0" or URI fragment + representation (e.g. "#/foo/0") into its internal representation (tokens), + it can be used to resolve a specific value in multiple documents, or sub-tree + of documents. + + Contrary to GenericValue, Pointer can be copy constructed and copy assigned. + Apart from assignment, a Pointer cannot be modified after construction. + + Although Pointer is very convenient, please aware that constructing Pointer + involves parsing and dynamic memory allocation. A special constructor with user- + supplied tokens eliminates these. + + GenericPointer depends on GenericDocument and GenericValue. + + \tparam ValueType The value type of the DOM tree. E.g. GenericValue > + \tparam Allocator The allocator type for allocating memory for internal representation. + + \note GenericPointer uses same encoding of ValueType. + However, Allocator of GenericPointer is independent of Allocator of Value. +*/ +template +class GenericPointer { +public: + typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value + typedef typename ValueType::Ch Ch; //!< Character type from Value + + //! A token is the basic units of internal representation. + /*! + A JSON pointer string representation "/foo/123" is parsed to two tokens: + "foo" and 123. 123 will be represented in both numeric form and string form. + They are resolved according to the actual value type (object or array). + + For token that are not numbers, or the numeric value is out of bound + (greater than limits of SizeType), they are only treated as string form + (i.e. the token's index will be equal to kPointerInvalidIndex). + + This struct is public so that user can create a Pointer without parsing and + allocation, using a special constructor. + */ + struct Token { + const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character. + SizeType length; //!< Length of the name. + SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex. + }; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor. + GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A null-terminated, string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + */ + explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, internal::StrLen(source)); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. + */ + explicit GenericPointer(const std::basic_string& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source.c_str(), source.size()); + } +#endif + + //! Constructor that parses a string or URI fragment representation, with length of the source string. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param length Length of source. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Slightly faster than the overload without length. + */ + GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, length); + } + + //! Constructor with user-supplied tokens. + /*! + This constructor let user supplies const array of tokens. + This prevents the parsing process and eliminates allocation. + This is preferred for memory constrained environments. + + \param tokens An constant array of tokens representing the JSON pointer. + \param tokenCount Number of tokens. + + \b Example + \code + #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex } + #define INDEX(i) { #i, sizeof(#i) - 1, i } + + static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) }; + static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0])); + // Equivalent to static const Pointer p("/foo/123"); + + #undef NAME + #undef INDEX + \endcode + */ + GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Copy constructor. + GenericPointer(const GenericPointer& rhs) : allocator_(rhs.allocator_), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + *this = rhs; + } + + //! Copy constructor. + GenericPointer(const GenericPointer& rhs, Allocator* allocator) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + *this = rhs; + } + + //! Destructor. + ~GenericPointer() { + if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated. + Allocator::Free(tokens_); + CEREAL_RAPIDJSON_DELETE(ownAllocator_); + } + + //! Assignment operator. + GenericPointer& operator=(const GenericPointer& rhs) { + if (this != &rhs) { + // Do not delete ownAllcator + if (nameBuffer_) + Allocator::Free(tokens_); + + tokenCount_ = rhs.tokenCount_; + parseErrorOffset_ = rhs.parseErrorOffset_; + parseErrorCode_ = rhs.parseErrorCode_; + + if (rhs.nameBuffer_) + CopyFromRaw(rhs); // Normally parsed tokens. + else { + tokens_ = rhs.tokens_; // User supplied const tokens. + nameBuffer_ = 0; + } + } + return *this; + } + + //! Swap the content of this pointer with an other. + /*! + \param other The pointer to swap with. + \note Constant complexity. + */ + GenericPointer& Swap(GenericPointer& other) CEREAL_RAPIDJSON_NOEXCEPT { + internal::Swap(allocator_, other.allocator_); + internal::Swap(ownAllocator_, other.ownAllocator_); + internal::Swap(nameBuffer_, other.nameBuffer_); + internal::Swap(tokens_, other.tokens_); + internal::Swap(tokenCount_, other.tokenCount_); + internal::Swap(parseErrorOffset_, other.parseErrorOffset_); + internal::Swap(parseErrorCode_, other.parseErrorCode_); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.pointer, b.pointer); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericPointer& a, GenericPointer& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //@} + + //!@name Append token + //@{ + + //! Append a token and return a new Pointer + /*! + \param token Token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Token& token, Allocator* allocator = 0) const { + GenericPointer r; + r.allocator_ = allocator; + Ch *p = r.CopyFromRaw(*this, 1, token.length + 1); + std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch)); + r.tokens_[tokenCount_].name = p; + r.tokens_[tokenCount_].length = token.length; + r.tokens_[tokenCount_].index = token.index; + return r; + } + + //! Append a name token with length, and return a new Pointer + /*! + \param name Name to be appended. + \param length Length of name. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const { + Token token = { name, length, kPointerInvalidIndex }; + return Append(token, allocator); + } + + //! Append a name token without length, and return a new Pointer + /*! + \param name Name (const Ch*) to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >), (GenericPointer)) + Append(T* name, Allocator* allocator = 0) const { + return Append(name, internal::StrLen(name), allocator); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Append a name token, and return a new Pointer + /*! + \param name Name to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const std::basic_string& name, Allocator* allocator = 0) const { + return Append(name.c_str(), static_cast(name.size()), allocator); + } +#endif + + //! Append a index token, and return a new Pointer + /*! + \param index Index to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(SizeType index, Allocator* allocator = 0) const { + char buffer[21]; + char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer); + SizeType length = static_cast(end - buffer); + buffer[length] = '\0'; + + if (sizeof(Ch) == 1) { + Token token = { reinterpret_cast(buffer), length, index }; + return Append(token, allocator); + } + else { + Ch name[21]; + for (size_t i = 0; i <= length; i++) + name[i] = static_cast(buffer[i]); + Token token = { name, length, index }; + return Append(token, allocator); + } + } + + //! Append a token by value, and return a new Pointer + /*! + \param token token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { + if (token.IsString()) + return Append(token.GetString(), token.GetStringLength(), allocator); + else { + CEREAL_RAPIDJSON_ASSERT(token.IsUint64()); + CEREAL_RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0)); + return Append(static_cast(token.GetUint64()), allocator); + } + } + + //!@name Handling Parse Error + //@{ + + //! Check whether this is a valid pointer. + bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; } + + //! Get the parsing error offset in code unit. + size_t GetParseErrorOffset() const { return parseErrorOffset_; } + + //! Get the parsing error code. + PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; } + + //@} + + //! Get the allocator of this pointer. + Allocator& GetAllocator() { return *allocator_; } + + //!@name Tokens + //@{ + + //! Get the token array (const version only). + const Token* GetTokens() const { return tokens_; } + + //! Get the number of tokens. + size_t GetTokenCount() const { return tokenCount_; } + + //@} + + //!@name Equality/inequality operators + //@{ + + //! Equality operator. + /*! + \note When any pointers are invalid, always returns false. + */ + bool operator==(const GenericPointer& rhs) const { + if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_) + return false; + + for (size_t i = 0; i < tokenCount_; i++) { + if (tokens_[i].index != rhs.tokens_[i].index || + tokens_[i].length != rhs.tokens_[i].length || + (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0)) + { + return false; + } + } + + return true; + } + + //! Inequality operator. + /*! + \note When any pointers are invalid, always returns true. + */ + bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); } + + //! Less than operator. + /*! + \note Invalid pointers are always greater than valid ones. + */ + bool operator<(const GenericPointer& rhs) const { + if (!IsValid()) + return false; + if (!rhs.IsValid()) + return true; + + if (tokenCount_ != rhs.tokenCount_) + return tokenCount_ < rhs.tokenCount_; + + for (size_t i = 0; i < tokenCount_; i++) { + if (tokens_[i].index != rhs.tokens_[i].index) + return tokens_[i].index < rhs.tokens_[i].index; + + if (tokens_[i].length != rhs.tokens_[i].length) + return tokens_[i].length < rhs.tokens_[i].length; + + if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length)) + return cmp < 0; + } + + return false; + } + + //@} + + //!@name Stringify + //@{ + + //! Stringify the pointer into string representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + return Stringify(os); + } + + //! Stringify the pointer into URI fragment representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool StringifyUriFragment(OutputStream& os) const { + return Stringify(os); + } + + //@} + + //!@name Create value + //@{ + + //! Create a value in a subtree. + /*! + If the value is not exist, it creates all parent values and a JSON Null value. + So it always succeed and return the newly created or existing value. + + Remind that it may change types of parents according to tokens, so it + potentially removes previously stored values. For example, if a document + was an array, and "/foo" is used to create a value, then the document + will be changed to an object, and all existing array elements are lost. + + \param root Root value of a DOM subtree to be resolved. It can be any value other than document root. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created (a JSON Null value), or already exists value. + */ + ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const { + CEREAL_RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + bool exist = true; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + if (v->IsArray() && t->name[0] == '-' && t->length == 1) { + v->PushBack(ValueType().Move(), allocator); + v = &((*v)[v->Size() - 1]); + exist = false; + } + else { + if (t->index == kPointerInvalidIndex) { // must be object name + if (!v->IsObject()) + v->SetObject(); // Change to Object + } + else { // object name or array index + if (!v->IsArray() && !v->IsObject()) + v->SetArray(); // Change to Array + } + + if (v->IsArray()) { + if (t->index >= v->Size()) { + v->Reserve(t->index + 1, allocator); + while (t->index >= v->Size()) + v->PushBack(ValueType().Move(), allocator); + exist = false; + } + v = &((*v)[t->index]); + } + else { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) { + v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator); + v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end + exist = false; + } + else + v = &m->value; + } + } + } + + if (alreadyExist) + *alreadyExist = exist; + + return *v; + } + + //! Creates a value in a document. + /*! + \param document A document to be resolved. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created, or already exists value. + */ + template + ValueType& Create(GenericDocument& document, bool* alreadyExist = 0) const { + return Create(document, document.GetAllocator(), alreadyExist); + } + + //@} + + //!@name Query value + //@{ + + //! Query a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. + \return Pointer to the value if it can be resolved. Otherwise null. + + \note + There are only 3 situations when a value cannot be resolved: + 1. A value in the path is not an array nor object. + 2. An object value does not contain the token. + 3. A token is out of range of an array value. + + Use unresolvedTokenIndex to retrieve the token index. + */ + ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const { + CEREAL_RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) + break; + v = &m->value; + } + continue; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + break; + v = &((*v)[t->index]); + continue; + default: + break; + } + + // Error: unresolved token + if (unresolvedTokenIndex) + *unresolvedTokenIndex = static_cast(t - tokens_); + return 0; + } + return v; + } + + //! Query a const value in a const subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Pointer to the value if it can be resolved. Otherwise null. + */ + const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const { + return Get(const_cast(root), unresolvedTokenIndex); + } + + //@} + + //!@name Query a value with default + //@{ + + //! Query a value in a subtree with default value. + /*! + Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value. + So that this function always succeed. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param defaultValue Default value to be cloned if the value was not exists. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); + } + + //! Query a value in a subtree with default null-terminated string. + ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Query a value in a subtree with default std::basic_string. + ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } +#endif + + //! Query a value in a subtree with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const { + return GetWithDefault(root, ValueType(defaultValue).Move(), allocator); + } + + //! Query a value in a document with default value. + template + ValueType& GetWithDefault(GenericDocument& document, const ValueType& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //! Query a value in a document with default null-terminated string. + template + ValueType& GetWithDefault(GenericDocument& document, const Ch* defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Query a value in a document with default std::basic_string. + template + ValueType& GetWithDefault(GenericDocument& document, const std::basic_string& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } +#endif + + //! Query a value in a document with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(GenericDocument& document, T defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //@} + + //!@name Set a value + //@{ + + //! Set a value in a subtree, with move semantics. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be set. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = value; + } + + //! Set a value in a subtree, with copy semantics. + ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).CopyFrom(value, allocator); + } + + //! Set a null-terminated string in a subtree. + ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Set a std::basic_string in a subtree. + ValueType& Set(ValueType& root, const std::basic_string& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } +#endif + + //! Set a primitive value in a subtree. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value).Move(); + } + + //! Set a value in a document, with move semantics. + template + ValueType& Set(GenericDocument& document, ValueType& value) const { + return Create(document) = value; + } + + //! Set a value in a document, with copy semantics. + template + ValueType& Set(GenericDocument& document, const ValueType& value) const { + return Create(document).CopyFrom(value, document.GetAllocator()); + } + + //! Set a null-terminated string in a document. + template + ValueType& Set(GenericDocument& document, const Ch* value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + //! Sets a std::basic_string in a document. + template + ValueType& Set(GenericDocument& document, const std::basic_string& value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } +#endif + + //! Set a primitive value in a document. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(GenericDocument& document, T value) const { + return Create(document) = value; + } + + //@} + + //!@name Swap a value + //@{ + + //! Swap a value with a value in a subtree. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be swapped. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).Swap(value); + } + + //! Swap a value with a value in a document. + template + ValueType& Swap(GenericDocument& document, ValueType& value) const { + return Create(document).Swap(value); + } + + //@} + + //! Erase a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Whether the resolved value is found and erased. + + \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false. + */ + bool Erase(ValueType& root) const { + CEREAL_RAPIDJSON_ASSERT(IsValid()); + if (tokenCount_ == 0) // Cannot erase the root + return false; + + ValueType* v = &root; + const Token* last = tokens_ + (tokenCount_ - 1); + for (const Token *t = tokens_; t != last; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) + return false; + v = &m->value; + } + break; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + return false; + v = &((*v)[t->index]); + break; + default: + return false; + } + } + + switch (v->GetType()) { + case kObjectType: + return v->EraseMember(GenericStringRef(last->name, last->length)); + case kArrayType: + if (last->index == kPointerInvalidIndex || last->index >= v->Size()) + return false; + v->Erase(v->Begin() + last->index); + return true; + default: + return false; + } + } + +private: + //! Clone the content from rhs to this. + /*! + \param rhs Source pointer. + \param extraToken Extra tokens to be allocated. + \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated. + \return Start of non-occupied name buffer, for storing extra names. + */ + Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) { + if (!allocator_) // allocator is independently owned. + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + + size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens + for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t) + nameBufferSize += t->length; + + tokenCount_ = rhs.tokenCount_ + extraToken; + tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch))); + nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + if (rhs.tokenCount_ > 0) { + std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token)); + } + if (nameBufferSize > 0) { + std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch)); + } + + // Adjust pointers to name buffer + std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_; + for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t) + t->name += diff; + + return nameBuffer_ + nameBufferSize; + } + + //! Check whether a character should be percent-encoded. + /*! + According to RFC 3986 2.3 Unreserved Characters. + \param c The character (code unit) to be tested. + */ + bool NeedPercentEncode(Ch c) const { + return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~'); + } + + //! Parse a JSON String or its URI fragment representation into tokens. +#ifndef __clang__ // -Wdocumentation + /*! + \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated. + \param length Length of the source string. + \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped. + */ +#endif + void Parse(const Ch* source, size_t length) { + CEREAL_RAPIDJSON_ASSERT(source != NULL); + CEREAL_RAPIDJSON_ASSERT(nameBuffer_ == 0); + CEREAL_RAPIDJSON_ASSERT(tokens_ == 0); + + // Create own allocator if user did not supply. + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + + // Count number of '/' as tokenCount + tokenCount_ = 0; + for (const Ch* s = source; s != source + length; s++) + if (*s == '/') + tokenCount_++; + + Token* token = tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch))); + Ch* name = nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + size_t i = 0; + + // Detect if it is a URI fragment + bool uriFragment = false; + if (source[i] == '#') { + uriFragment = true; + i++; + } + + if (i != length && source[i] != '/') { + parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus; + goto error; + } + + while (i < length) { + CEREAL_RAPIDJSON_ASSERT(source[i] == '/'); + i++; // consumes '/' + + token->name = name; + bool isNumber = true; + + while (i < length && source[i] != '/') { + Ch c = source[i]; + if (uriFragment) { + // Decoding percent-encoding for URI fragment + if (c == '%') { + PercentDecodeStream is(&source[i], source + length); + GenericInsituStringStream os(name); + Ch* begin = os.PutBegin(); + if (!Transcoder, EncodingType>().Validate(is, os) || !is.IsValid()) { + parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; + goto error; + } + size_t len = os.PutEnd(begin); + i += is.Tell() - 1; + if (len == 1) + c = *name; + else { + name += len; + isNumber = false; + i++; + continue; + } + } + else if (NeedPercentEncode(c)) { + parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode; + goto error; + } + } + + i++; + + // Escaping "~0" -> '~', "~1" -> '/' + if (c == '~') { + if (i < length) { + c = source[i]; + if (c == '0') c = '~'; + else if (c == '1') c = '/'; + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + i++; + } + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + } + + // First check for index: all of characters are digit + if (c < '0' || c > '9') + isNumber = false; + + *name++ = c; + } + token->length = static_cast(name - token->name); + if (token->length == 0) + isNumber = false; + *name++ = '\0'; // Null terminator + + // Second check for index: more than one digit cannot have leading zero + if (isNumber && token->length > 1 && token->name[0] == '0') + isNumber = false; + + // String to SizeType conversion + SizeType n = 0; + if (isNumber) { + for (size_t j = 0; j < token->length; j++) { + SizeType m = n * 10 + static_cast(token->name[j] - '0'); + if (m < n) { // overflow detection + isNumber = false; + break; + } + n = m; + } + } + + token->index = isNumber ? n : kPointerInvalidIndex; + token++; + } + + CEREAL_RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer + parseErrorCode_ = kPointerParseErrorNone; + return; + + error: + Allocator::Free(tokens_); + nameBuffer_ = 0; + tokens_ = 0; + tokenCount_ = 0; + parseErrorOffset_ = i; + return; + } + + //! Stringify to string or URI fragment representation. + /*! + \tparam uriFragment True for stringifying to URI fragment representation. False for string representation. + \tparam OutputStream type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + CEREAL_RAPIDJSON_ASSERT(IsValid()); + + if (uriFragment) + os.Put('#'); + + for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + os.Put('/'); + for (size_t j = 0; j < t->length; j++) { + Ch c = t->name[j]; + if (c == '~') { + os.Put('~'); + os.Put('0'); + } + else if (c == '/') { + os.Put('~'); + os.Put('1'); + } + else if (uriFragment && NeedPercentEncode(c)) { + // Transcode to UTF8 sequence + GenericStringStream source(&t->name[j]); + PercentEncodeStream target(os); + if (!Transcoder >().Validate(source, target)) + return false; + j += source.Tell() - 1; + } + else + os.Put(c); + } + } + return true; + } + + //! A helper stream for decoding a percent-encoded sequence into code unit. + /*! + This stream decodes %XY triplet into code unit (0-255). + If it encounters invalid characters, it sets output code unit as 0 and + mark invalid, and to be checked by IsValid(). + */ + class PercentDecodeStream { + public: + typedef typename ValueType::Ch Ch; + + //! Constructor + /*! + \param source Start of the stream + \param end Past-the-end of the stream. + */ + PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {} + + Ch Take() { + if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet + valid_ = false; + return 0; + } + src_++; + Ch c = 0; + for (int j = 0; j < 2; j++) { + c = static_cast(c << 4); + Ch h = *src_; + if (h >= '0' && h <= '9') c = static_cast(c + h - '0'); + else if (h >= 'A' && h <= 'F') c = static_cast(c + h - 'A' + 10); + else if (h >= 'a' && h <= 'f') c = static_cast(c + h - 'a' + 10); + else { + valid_ = false; + return 0; + } + src_++; + } + return c; + } + + size_t Tell() const { return static_cast(src_ - head_); } + bool IsValid() const { return valid_; } + + private: + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. + const Ch* end_; //!< Past-the-end position. + bool valid_; //!< Whether the parsing is valid. + }; + + //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. + template + class PercentEncodeStream { + public: + PercentEncodeStream(OutputStream& os) : os_(os) {} + void Put(char c) { // UTF-8 must be byte + unsigned char u = static_cast(c); + static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + os_.Put('%'); + os_.Put(static_cast(hexDigits[u >> 4])); + os_.Put(static_cast(hexDigits[u & 15])); + } + private: + OutputStream& os_; + }; + + Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. + Allocator* ownAllocator_; //!< Allocator owned by this Pointer. + Ch* nameBuffer_; //!< A buffer containing all names in tokens. + Token* tokens_; //!< A list of tokens. + size_t tokenCount_; //!< Number of tokens in tokens_. + size_t parseErrorOffset_; //!< Offset in code unit when parsing fail. + PointerParseErrorCode parseErrorCode_; //!< Parsing error code. +}; + +//! GenericPointer for Value (UTF-8, default allocator). +typedef GenericPointer Pointer; + +//!@name Helper functions for GenericPointer +//@{ + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer& pointer, typename T::AllocatorType& a) { + return pointer.Create(root, a); +} + +template +typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Create(root, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer& pointer) { + return pointer.Create(document); +} + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Create(document); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType* GetValueByPointer(T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, T2 defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const std::basic_string& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, T2 defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::Ch* value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const std::basic_string& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const GenericPointer& pointer, T2 value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* value) { + return pointer.Set(document, value); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const std::basic_string& value) { + return pointer.Set(document, value); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const GenericPointer& pointer, T2 value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string& value) { + return GenericPointer(source, N - 1).Set(document, value); +} +#endif + +template +CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Swap(root, value, a); +} + +template +typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Swap(root, value, a); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Swap(document, value); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Swap(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +bool EraseValueByPointer(T& root, const GenericPointer& pointer) { + return pointer.Erase(root); +} + +template +bool EraseValueByPointer(T& root, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Erase(root); +} + +//@} + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) || defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_POINTER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h new file mode 100644 index 000000000..0c2beb496 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h @@ -0,0 +1,277 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_PRETTYWRITER_H_ +#define CEREAL_RAPIDJSON_PRETTYWRITER_H_ + +#include "writer.h" + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Combination of PrettyWriter format flags. +/*! \see PrettyWriter::SetFormatOptions + */ +enum PrettyFormatOptions { + kFormatDefault = 0, //!< Default pretty formatting. + kFormatSingleLineArray = 1 //!< Format arrays on a single line. +}; + +//! Writer with indentation and spacing. +/*! + \tparam OutputStream Type of output os. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class PrettyWriter : public Writer { +public: + typedef Writer Base; + typedef typename Base::Ch Ch; + + //! Constructor + /*! \param os Output stream. + \param allocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} + + + explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {} + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + PrettyWriter(PrettyWriter&& rhs) : + Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {} +#endif + + //! Set custom indentation. + /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). + \param indentCharCount Number of indent characters for each indentation level. + \note The default indentation is 4 spaces. + */ + PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { + CEREAL_RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); + indentChar_ = indentChar; + indentCharCount_ = indentCharCount; + return *this; + } + + //! Set pretty writer formatting options. + /*! \param options Formatting options. + */ + PrettyWriter& SetFormatOptions(PrettyFormatOptions options) { + formatOptions_ = options; + return *this; + } + + /*! @name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); } + bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); } + bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); } + bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); } + bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); } + bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); } + bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + CEREAL_RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kNumberType); + return Base::EndValue(Base::WriteString(str, length)); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + CEREAL_RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kStringType); + return Base::EndValue(Base::WriteString(str, length)); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + PrettyPrefix(kObjectType); + new (Base::level_stack_.template Push()) typename Base::Level(false); + return Base::WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object + CEREAL_RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); // currently inside an Array, not Object + CEREAL_RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::EndValue(Base::WriteEndObject()); + (void)ret; + CEREAL_RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + bool StartArray() { + PrettyPrefix(kArrayType); + new (Base::level_stack_.template Push()) typename Base::Level(true); + return Base::WriteStartArray(); + } + + bool EndArray(SizeType memberCount = 0) { + (void)memberCount; + CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); + CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty && !(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::EndValue(Base::WriteEndArray()); + (void)ret; + CEREAL_RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + \note When using PrettyWriter::RawValue(), the result json may not be indented correctly. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + CEREAL_RAPIDJSON_ASSERT(json != 0); + PrettyPrefix(type); + return Base::EndValue(Base::WriteRawValue(json, length)); + } + +protected: + void PrettyPrefix(Type type) { + (void)type; + if (Base::level_stack_.GetSize() != 0) { // this value is not at root + typename Base::Level* level = Base::level_stack_.template Top(); + + if (level->inArray) { + if (level->valueCount > 0) { + Base::os_->Put(','); // add comma if it is not the first element in array + if (formatOptions_ & kFormatSingleLineArray) + Base::os_->Put(' '); + } + + if (!(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + } + else { // in object + if (level->valueCount > 0) { + if (level->valueCount % 2 == 0) { + Base::os_->Put(','); + Base::os_->Put('\n'); + } + else { + Base::os_->Put(':'); + Base::os_->Put(' '); + } + } + else + Base::os_->Put('\n'); + + if (level->valueCount % 2 == 0) + WriteIndent(); + } + if (!level->inArray && level->valueCount % 2 == 0) + CEREAL_RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + CEREAL_RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. + Base::hasRoot_ = true; + } + } + + void WriteIndent() { + size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; + PutN(*Base::os_, static_cast(indentChar_), count); + } + + Ch indentChar_; + unsigned indentCharCount_; + PrettyFormatOptions formatOptions_; + +private: + // Prohibit copy constructor & assignment operator. + PrettyWriter(const PrettyWriter&); + PrettyWriter& operator=(const PrettyWriter&); +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h new file mode 100644 index 000000000..3eefe60a9 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h @@ -0,0 +1,656 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ +#define CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ + +/*!\file rapidjson.h + \brief common definitions and configuration + + \see CEREAL_RAPIDJSON_CONFIG + */ + +/*! \defgroup CEREAL_RAPIDJSON_CONFIG RapidJSON configuration + \brief Configuration macros for library features + + Some RapidJSON features are configurable to adapt the library to a wide + variety of platforms, environments and usage scenarios. Most of the + features can be configured in terms of overridden or predefined + preprocessor macros at compile-time. + + Some additional customization is available in the \ref CEREAL_RAPIDJSON_ERRORS APIs. + + \note These macros should be given on the compiler command-line + (where applicable) to avoid inconsistent values when compiling + different translation units of a single application. + */ + +#include // malloc(), realloc(), free(), size_t +#include // memset(), memcpy(), memmove(), memcmp() + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_VERSION_STRING +// +// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. +// + +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +// token stringification +#define CEREAL_RAPIDJSON_STRINGIFY(x) CEREAL_RAPIDJSON_DO_STRINGIFY(x) +#define CEREAL_RAPIDJSON_DO_STRINGIFY(x) #x + +// token concatenation +#define CEREAL_RAPIDJSON_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN(X, Y) +#define CEREAL_RAPIDJSON_DO_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN2(X, Y) +#define CEREAL_RAPIDJSON_DO_JOIN2(X, Y) X##Y +//!@endcond + +/*! \def CEREAL_RAPIDJSON_MAJOR_VERSION + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Major version of RapidJSON in integer. +*/ +/*! \def CEREAL_RAPIDJSON_MINOR_VERSION + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Minor version of RapidJSON in integer. +*/ +/*! \def CEREAL_RAPIDJSON_PATCH_VERSION + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Patch version of RapidJSON in integer. +*/ +/*! \def CEREAL_RAPIDJSON_VERSION_STRING + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Version of RapidJSON in ".." string format. +*/ +#define CEREAL_RAPIDJSON_MAJOR_VERSION 1 +#define CEREAL_RAPIDJSON_MINOR_VERSION 1 +#define CEREAL_RAPIDJSON_PATCH_VERSION 0 +#define CEREAL_RAPIDJSON_VERSION_STRING \ + CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_MAJOR_VERSION.CEREAL_RAPIDJSON_MINOR_VERSION.CEREAL_RAPIDJSON_PATCH_VERSION) + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_NAMESPACE_(BEGIN|END) +/*! \def CEREAL_RAPIDJSON_NAMESPACE + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace + + In order to avoid symbol clashes and/or "One Definition Rule" errors + between multiple inclusions of (different versions of) RapidJSON in + a single binary, users can customize the name of the main RapidJSON + namespace. + + In case of a single nesting level, defining \c CEREAL_RAPIDJSON_NAMESPACE + to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple + levels are needed, both \ref CEREAL_RAPIDJSON_NAMESPACE_BEGIN and \ref + CEREAL_RAPIDJSON_NAMESPACE_END need to be defined as well: + + \code + // in some .cpp file + #define CEREAL_RAPIDJSON_NAMESPACE my::rapidjson + #define CEREAL_RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { + #define CEREAL_RAPIDJSON_NAMESPACE_END } } + #include "rapidjson/..." + \endcode + + \see rapidjson + */ +/*! \def CEREAL_RAPIDJSON_NAMESPACE_BEGIN + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (opening expression) + \see CEREAL_RAPIDJSON_NAMESPACE +*/ +/*! \def CEREAL_RAPIDJSON_NAMESPACE_END + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (closing expression) + \see CEREAL_RAPIDJSON_NAMESPACE +*/ +#ifndef CEREAL_RAPIDJSON_NAMESPACE +#define CEREAL_RAPIDJSON_NAMESPACE rapidjson +#endif +#ifndef CEREAL_RAPIDJSON_NAMESPACE_BEGIN +#define CEREAL_RAPIDJSON_NAMESPACE_BEGIN namespace CEREAL_RAPIDJSON_NAMESPACE { +#endif +#ifndef CEREAL_RAPIDJSON_NAMESPACE_END +#define CEREAL_RAPIDJSON_NAMESPACE_END } +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_HAS_STDSTRING + +#ifndef CEREAL_RAPIDJSON_HAS_STDSTRING +#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING +#define CEREAL_RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation +#else +#define CEREAL_RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default +#endif +/*! \def CEREAL_RAPIDJSON_HAS_STDSTRING + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Enable RapidJSON support for \c std::string + + By defining this preprocessor symbol to \c 1, several convenience functions for using + \ref rapidjson::GenericValue with \c std::string are enabled, especially + for construction and comparison. + + \hideinitializer +*/ +#endif // !defined(CEREAL_RAPIDJSON_HAS_STDSTRING) + +#if CEREAL_RAPIDJSON_HAS_STDSTRING +#include +#endif // CEREAL_RAPIDJSON_HAS_STDSTRING + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_NO_INT64DEFINE + +/*! \def CEREAL_RAPIDJSON_NO_INT64DEFINE + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Use external 64-bit integer types. + + RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types + to be available at global scope. + + If users have their own definition, define CEREAL_RAPIDJSON_NO_INT64DEFINE to + prevent RapidJSON from defining its own types. +*/ +#ifndef CEREAL_RAPIDJSON_NO_INT64DEFINE +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 +#include "msinttypes/stdint.h" +#include "msinttypes/inttypes.h" +#else +// Other compilers should have this. +#include +#include +#endif +//!@endcond +#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING +#define CEREAL_RAPIDJSON_NO_INT64DEFINE +#endif +#endif // CEREAL_RAPIDJSON_NO_INT64TYPEDEF + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_FORCEINLINE + +#ifndef CEREAL_RAPIDJSON_FORCEINLINE +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && defined(NDEBUG) +#define CEREAL_RAPIDJSON_FORCEINLINE __forceinline +#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) +#define CEREAL_RAPIDJSON_FORCEINLINE __attribute__((always_inline)) +#else +#define CEREAL_RAPIDJSON_FORCEINLINE +#endif +//!@endcond +#endif // CEREAL_RAPIDJSON_FORCEINLINE + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_ENDIAN +#define CEREAL_RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine +#define CEREAL_RAPIDJSON_BIGENDIAN 1 //!< Big endian machine + +//! Endianness of the machine. +/*! + \def CEREAL_RAPIDJSON_ENDIAN + \ingroup CEREAL_RAPIDJSON_CONFIG + + GCC 4.6 provided macro for detecting endianness of the target machine. But other + compilers may not have this. User can define CEREAL_RAPIDJSON_ENDIAN to either + \ref CEREAL_RAPIDJSON_LITTLEENDIAN or \ref CEREAL_RAPIDJSON_BIGENDIAN. + + Default detection implemented with reference to + \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html + \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp +*/ +#ifndef CEREAL_RAPIDJSON_ENDIAN +// Detect with GCC 4.6's macro +# ifdef __BYTE_ORDER__ +# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN +# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. +# endif // __BYTE_ORDER__ +// Detect with GLIBC's endian.h +# elif defined(__GLIBC__) +# include +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. +# endif // __GLIBC__ +// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro +# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN +# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN +// Detect with architecture macros +# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN +# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN +# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) +# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN +# elif defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) +# define CEREAL_RAPIDJSON_ENDIAN +# else +# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. +# endif +#endif // CEREAL_RAPIDJSON_ENDIAN + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_64BIT + +//! Whether using 64-bit architecture +#ifndef CEREAL_RAPIDJSON_64BIT +#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) +#define CEREAL_RAPIDJSON_64BIT 1 +#else +#define CEREAL_RAPIDJSON_64BIT 0 +#endif +#endif // CEREAL_RAPIDJSON_64BIT + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_ALIGN + +//! Data alignment of the machine. +/*! \ingroup CEREAL_RAPIDJSON_CONFIG + \param x pointer to align + + Some machines require strict data alignment. The default is 8 bytes. + User can customize by defining the CEREAL_RAPIDJSON_ALIGN function macro. +*/ +#ifndef CEREAL_RAPIDJSON_ALIGN +#define CEREAL_RAPIDJSON_ALIGN(x) (((x) + static_cast(7u)) & ~static_cast(7u)) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_UINT64_C2 + +//! Construct a 64-bit literal by a pair of 32-bit integer. +/*! + 64-bit literal with or without ULL suffix is prone to compiler warnings. + UINT64_C() is C macro which cause compilation problems. + Use this macro to define 64-bit constants by a pair of 32-bit integer. +*/ +#ifndef CEREAL_RAPIDJSON_UINT64_C2 +#define CEREAL_RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION + +//! Use only lower 48-bit address for some pointers. +/*! + \ingroup CEREAL_RAPIDJSON_CONFIG + + This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. + The higher 16-bit can be used for storing other data. + \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture. +*/ +#ifndef CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION +#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) +#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 +#else +#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 +#endif +#endif // CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION + +#if CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 +#if CEREAL_RAPIDJSON_64BIT != 1 +#error CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when CEREAL_RAPIDJSON_64BIT=1 +#endif +#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast((reinterpret_cast(p) & static_cast(CEREAL_RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast(reinterpret_cast(x)))) +#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast(reinterpret_cast(p) & static_cast(CEREAL_RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) +#else +#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) +#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (p) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_SSE2/CEREAL_RAPIDJSON_SSE42/CEREAL_RAPIDJSON_NEON/CEREAL_RAPIDJSON_SIMD + +/*! \def CEREAL_RAPIDJSON_SIMD + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief Enable SSE2/SSE4.2/Neon optimization. + + RapidJSON supports optimized implementations for some parsing operations + based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel + or ARM compatible processors. + + To enable these optimizations, three different symbols can be defined; + \code + // Enable SSE2 optimization. + #define CEREAL_RAPIDJSON_SSE2 + + // Enable SSE4.2 optimization. + #define CEREAL_RAPIDJSON_SSE42 + \endcode + + // Enable ARM Neon optimization. + #define CEREAL_RAPIDJSON_NEON + \endcode + + \c CEREAL_RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined. + + If any of these symbols is defined, RapidJSON defines the macro + \c CEREAL_RAPIDJSON_SIMD to indicate the availability of the optimized code. +*/ +#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) \ + || defined(CEREAL_RAPIDJSON_NEON) || defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) +#define CEREAL_RAPIDJSON_SIMD +#endif + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE + +#ifndef CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE +/*! \def CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief User-provided \c SizeType definition. + + In order to avoid using 32-bit size types for indexing strings and arrays, + define this preprocessor symbol and provide the type rapidjson::SizeType + before including RapidJSON: + \code + #define CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE + namespace rapidjson { typedef ::std::size_t SizeType; } + #include "rapidjson/..." + \endcode + + \see rapidjson::SizeType +*/ +#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING +#define CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE +#endif +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +//! Size type (for string lengths, array sizes, etc.) +/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, + instead of using \c size_t. Users may override the SizeType by defining + \ref CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE. +*/ +typedef unsigned SizeType; +CEREAL_RAPIDJSON_NAMESPACE_END +#endif + +// always import std::size_t to rapidjson namespace +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +using std::size_t; +CEREAL_RAPIDJSON_NAMESPACE_END + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_ASSERT + +//! Assertion. +/*! \ingroup CEREAL_RAPIDJSON_CONFIG + By default, rapidjson uses C \c assert() for internal assertions. + User can override it by defining CEREAL_RAPIDJSON_ASSERT(x) macro. + + \note Parsing errors are handled and can be customized by the + \ref CEREAL_RAPIDJSON_ERRORS APIs. +*/ +#ifndef CEREAL_RAPIDJSON_ASSERT +#include +#define CEREAL_RAPIDJSON_ASSERT(x) assert(x) +#endif // CEREAL_RAPIDJSON_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_STATIC_ASSERT + +// Prefer C++11 static_assert, if available +#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT +#if __cplusplus >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) +#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ + static_assert(x, CEREAL_RAPIDJSON_STRINGIFY(x)) +#endif // C++11 +#endif // CEREAL_RAPIDJSON_STATIC_ASSERT + +// Adopt C++03 implementation from boost +#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT +#ifndef __clang__ +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#endif +CEREAL_RAPIDJSON_NAMESPACE_BEGIN +template struct STATIC_ASSERTION_FAILURE; +template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; +template struct StaticAssertTest {}; +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) || defined(__clang__) +#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) +#else +#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif +#ifndef __clang__ +//!@endcond +#endif + +/*! \def CEREAL_RAPIDJSON_STATIC_ASSERT + \brief (Internal) macro to check for conditions at compile-time + \param x compile-time condition + \hideinitializer + */ +#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ + typedef ::CEREAL_RAPIDJSON_NAMESPACE::StaticAssertTest< \ + sizeof(::CEREAL_RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ + CEREAL_RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif // CEREAL_RAPIDJSON_STATIC_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_LIKELY, CEREAL_RAPIDJSON_UNLIKELY + +//! Compiler branching hint for expression with high probability to be true. +/*! + \ingroup CEREAL_RAPIDJSON_CONFIG + \param x Boolean expression likely to be true. +*/ +#ifndef CEREAL_RAPIDJSON_LIKELY +#if defined(__GNUC__) || defined(__clang__) +#define CEREAL_RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) +#else +#define CEREAL_RAPIDJSON_LIKELY(x) (x) +#endif +#endif + +//! Compiler branching hint for expression with low probability to be true. +/*! + \ingroup CEREAL_RAPIDJSON_CONFIG + \param x Boolean expression unlikely to be true. +*/ +#ifndef CEREAL_RAPIDJSON_UNLIKELY +#if defined(__GNUC__) || defined(__clang__) +#define CEREAL_RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +#define CEREAL_RAPIDJSON_UNLIKELY(x) (x) +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Helpers + +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN + +#define CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN do { +#define CEREAL_RAPIDJSON_MULTILINEMACRO_END \ +} while((void)0, 0) + +// adopted from Boost +#define CEREAL_RAPIDJSON_VERSION_CODE(x,y,z) \ + (((x)*100000) + ((y)*100) + (z)) + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_DIAG_PUSH/POP, CEREAL_RAPIDJSON_DIAG_OFF + +#if defined(__GNUC__) +#define CEREAL_RAPIDJSON_GNUC \ + CEREAL_RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) +#endif + +#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,2,0)) + +#define CEREAL_RAPIDJSON_PRAGMA(x) _Pragma(CEREAL_RAPIDJSON_STRINGIFY(x)) +#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(GCC diagnostic x) +#define CEREAL_RAPIDJSON_DIAG_OFF(x) \ + CEREAL_RAPIDJSON_DIAG_PRAGMA(ignored CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_JOIN(-W,x))) + +// push/pop support in Clang and GCC>=4.6 +#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) +#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) +#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) +#else // GCC >= 4.2, < 4.6 +#define CEREAL_RAPIDJSON_DIAG_PUSH /* ignored */ +#define CEREAL_RAPIDJSON_DIAG_POP /* ignored */ +#endif + +#elif defined(_MSC_VER) + +// pragma (MSVC specific) +#define CEREAL_RAPIDJSON_PRAGMA(x) __pragma(x) +#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(warning(x)) + +#define CEREAL_RAPIDJSON_DIAG_OFF(x) CEREAL_RAPIDJSON_DIAG_PRAGMA(disable: x) +#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) +#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) + +#else + +#define CEREAL_RAPIDJSON_DIAG_OFF(x) /* ignored */ +#define CEREAL_RAPIDJSON_DIAG_PUSH /* ignored */ +#define CEREAL_RAPIDJSON_DIAG_POP /* ignored */ + +#endif // CEREAL_RAPIDJSON_DIAG_* + +/////////////////////////////////////////////////////////////////////////////// +// C++11 features + +#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS +#if defined(__clang__) +#if __has_feature(cxx_rvalue_references) && \ + (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) +#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1600) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) + +#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + +#ifndef CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT +#if defined(__clang__) +#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) +#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1900) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 1 +#else +#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 0 +#endif +#endif +#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT +#define CEREAL_RAPIDJSON_NOEXCEPT noexcept +#else +#define CEREAL_RAPIDJSON_NOEXCEPT /* noexcept */ +#endif // CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT + +// no automatic detection, yet +#ifndef CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS +#if (defined(_MSC_VER) && _MSC_VER >= 1700) +#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 1 +#else +#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 0 +#endif +#endif + +#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR +#if defined(__clang__) +#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) +#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1700) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 1 +#else +#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 0 +#endif +#endif // CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR + +//!@endcond + +//! Assertion (in non-throwing contexts). + /*! \ingroup CEREAL_RAPIDJSON_CONFIG + Some functions provide a \c noexcept guarantee, if the compiler supports it. + In these cases, the \ref CEREAL_RAPIDJSON_ASSERT macro cannot be overridden to + throw an exception. This macro adds a separate customization point for + such cases. + + Defaults to C \c assert() (as \ref CEREAL_RAPIDJSON_ASSERT), if \c noexcept is + supported, and to \ref CEREAL_RAPIDJSON_ASSERT otherwise. + */ + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_NOEXCEPT_ASSERT + +#ifndef CEREAL_RAPIDJSON_NOEXCEPT_ASSERT +#ifdef CEREAL_RAPIDJSON_ASSERT_THROWS +#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT +#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) +#else +#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) +#endif // CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT +#else +#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) +#endif // CEREAL_RAPIDJSON_ASSERT_THROWS +#endif // CEREAL_RAPIDJSON_NOEXCEPT_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// new/delete + +#ifndef CEREAL_RAPIDJSON_NEW +///! customization point for global \c new +#define CEREAL_RAPIDJSON_NEW(TypeName) new TypeName +#endif +#ifndef CEREAL_RAPIDJSON_DELETE +///! customization point for global \c delete +#define CEREAL_RAPIDJSON_DELETE(x) delete x +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Type + +/*! \namespace rapidjson + \brief main RapidJSON namespace + \see CEREAL_RAPIDJSON_NAMESPACE +*/ +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Type of JSON value +enum Type { + kNullType = 0, //!< null + kFalseType = 1, //!< false + kTrueType = 2, //!< true + kObjectType = 3, //!< object + kArrayType = 4, //!< array + kStringType = 5, //!< string + kNumberType = 6 //!< number +}; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h new file mode 100644 index 000000000..43eb52598 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h @@ -0,0 +1,2230 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_READER_H_ +#define CEREAL_RAPIDJSON_READER_H_ + +/*! \file reader.h */ + +#include "allocators.h" +#include "stream.h" +#include "encodedstream.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strtod.h" +#include + +#if defined(CEREAL_RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef CEREAL_RAPIDJSON_SSE42 +#include +#elif defined(CEREAL_RAPIDJSON_SSE2) +#include +#elif defined(CEREAL_RAPIDJSON_NEON) +#include +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(old-style-cast) +CEREAL_RAPIDJSON_DIAG_OFF(padded) +CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code +#endif + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define CEREAL_RAPIDJSON_NOTHING /* deliberately empty */ +#ifndef CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN +#define CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ + CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ + if (CEREAL_RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \ + CEREAL_RAPIDJSON_MULTILINEMACRO_END +#endif +#define CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(CEREAL_RAPIDJSON_NOTHING) +//!@endcond + +/*! \def CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN + \ingroup CEREAL_RAPIDJSON_ERRORS + \brief Macro to indicate a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + This macros can be used as a customization point for the internal + error handling mechanism of RapidJSON. + + A common usage model is to throw an exception instead of requiring the + caller to explicitly check the \ref rapidjson::GenericReader::Parse's + return value: + + \code + #define CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ + throw ParseException(parseErrorCode, #parseErrorCode, offset) + + #include // std::runtime_error + #include "rapidjson/error/error.h" // rapidjson::ParseResult + + struct ParseException : std::runtime_error, rapidjson::ParseResult { + ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) + : std::runtime_error(msg), ParseResult(code, offset) {} + }; + + #include "rapidjson/reader.h" + \endcode + + \see CEREAL_RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse + */ +#ifndef CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN +#define CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ + CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ + CEREAL_RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ + SetParseError(parseErrorCode, offset); \ + CEREAL_RAPIDJSON_MULTILINEMACRO_END +#endif + +/*! \def CEREAL_RAPIDJSON_PARSE_ERROR + \ingroup CEREAL_RAPIDJSON_ERRORS + \brief (Internal) macro to indicate and handle a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + Invokes CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. + + \see CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN + \hideinitializer + */ +#ifndef CEREAL_RAPIDJSON_PARSE_ERROR +#define CEREAL_RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ + CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ + CEREAL_RAPIDJSON_MULTILINEMACRO_END +#endif + +#include "error/error.h" // ParseErrorCode, ParseResult + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseFlag + +/*! \def CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief User-defined kParseDefaultFlags definition. + + User can define this as any \c ParseFlag combinations. +*/ +#ifndef CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS +#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags +#endif + +//! Combination of parseFlags +/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream + */ +enum ParseFlag { + kParseNoFlags = 0, //!< No flags are set. + kParseInsituFlag = 1, //!< In-situ(destructive) parsing. + kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. + kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. + kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. + kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). + kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments. + kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings. + kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays. + kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles. + kParseDefaultFlags = CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS +}; + +/////////////////////////////////////////////////////////////////////////////// +// Handler + +/*! \class rapidjson::Handler + \brief Concept for receiving events from GenericReader upon parsing. + The functions return true if no error occurs. If they return false, + the event publisher should terminate the process. +\code +concept Handler { + typename Ch; + + bool Null(); + bool Bool(bool b); + bool Int(int i); + bool Uint(unsigned i); + bool Int64(int64_t i); + bool Uint64(uint64_t i); + bool Double(double d); + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType length, bool copy); + bool String(const Ch* str, SizeType length, bool copy); + bool StartObject(); + bool Key(const Ch* str, SizeType length, bool copy); + bool EndObject(SizeType memberCount); + bool StartArray(); + bool EndArray(SizeType elementCount); +}; +\endcode +*/ +/////////////////////////////////////////////////////////////////////////////// +// BaseReaderHandler + +//! Default implementation of Handler. +/*! This can be used as base class of any reader handler. + \note implements Handler concept +*/ +template, typename Derived = void> +struct BaseReaderHandler { + typedef typename Encoding::Ch Ch; + + typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; + + bool Default() { return true; } + bool Null() { return static_cast(*this).Default(); } + bool Bool(bool) { return static_cast(*this).Default(); } + bool Int(int) { return static_cast(*this).Default(); } + bool Uint(unsigned) { return static_cast(*this).Default(); } + bool Int64(int64_t) { return static_cast(*this).Default(); } + bool Uint64(uint64_t) { return static_cast(*this).Default(); } + bool Double(double) { return static_cast(*this).Default(); } + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } + bool StartObject() { return static_cast(*this).Default(); } + bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool EndObject(SizeType) { return static_cast(*this).Default(); } + bool StartArray() { return static_cast(*this).Default(); } + bool EndArray(SizeType) { return static_cast(*this).Default(); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamLocalCopy + +namespace internal { + +template::copyOptimization> +class StreamLocalCopy; + +//! Do copy optimization. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original), original_(original) {} + ~StreamLocalCopy() { original_ = s; } + + Stream s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; + + Stream& original_; +}; + +//! Keep reference. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original) {} + + Stream& s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// SkipWhitespace + +//! Skip the JSON white spaces in a stream. +/*! \param is A input stream for skipping white spaces. + \note This function has SSE2/SSE4.2 specialization. +*/ +template +void SkipWhitespace(InputStream& is) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + typename InputStream::Ch c; + while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t') + s.Take(); +} + +inline const char* SkipWhitespace(const char* p, const char* end) { + while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + return p; +} + +#ifdef CEREAL_RAPIDJSON_SSE42 +//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The middle of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } + + return SkipWhitespace(p, end); +} + +#elif defined(CEREAL_RAPIDJSON_SSE2) + +//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } + + return SkipWhitespace(p, end); +} + +#elif defined(CEREAL_RAPIDJSON_NEON) + +//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz =__builtin_clzll(high);; + return p + 8 + (lz >> 3); + } + } else { + int lz = __builtin_clzll(low);; + return p + (lz >> 3); + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (; p <= end - 16; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz = __builtin_clzll(high); + return p + 8 + (lz >> 3); + } + } else { + int lz = __builtin_clzll(low); + return p + (lz >> 3); + } + } + + return SkipWhitespace(p, end); +} + +#endif // CEREAL_RAPIDJSON_NEON + +#ifdef CEREAL_RAPIDJSON_SIMD +//! Template function specialization for InsituStringStream +template<> inline void SkipWhitespace(InsituStringStream& is) { + is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); +} + +//! Template function specialization for StringStream +template<> inline void SkipWhitespace(StringStream& is) { + is.src_ = SkipWhitespace_SIMD(is.src_); +} + +template<> inline void SkipWhitespace(EncodedInputStream, MemoryStream>& is) { + is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_); +} +#endif // CEREAL_RAPIDJSON_SIMD + +/////////////////////////////////////////////////////////////////////////////// +// GenericReader + +//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. +/*! GenericReader parses JSON text from a stream, and send events synchronously to an + object implementing Handler concept. + + It needs to allocate a stack for storing a single decoded string during + non-destructive parsing. + + For in-situ parsing, the decoded string is directly written to the source + text string, no temporary buffer is required. + + A GenericReader object can be reused for parsing multiple JSON text. + + \tparam SourceEncoding Encoding of the input stream. + \tparam TargetEncoding Encoding of the parse output. + \tparam StackAllocator Allocator type for stack. +*/ +template +class GenericReader { +public: + typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type + + //! Constructor. + /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) + \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) + */ + GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : + stack_(stackAllocator, stackCapacity), parseResult_(), state_(IterativeParsingStartState) {} + + //! Parse JSON text. + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + if (parseFlags & kParseIterativeFlag) + return IterativeParse(is, handler); + + parseResult_.Clear(); + + ClearStackOnExit scope(*this); + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() == '\0')) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + else { + ParseValue(is, handler); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (!(parseFlags & kParseStopWhenDoneFlag)) { + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() != '\0')) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + } + } + + return parseResult_; + } + + //! Parse JSON text (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + return Parse(is, handler); + } + + //! Initialize JSON text token-by-token parsing + /*! + */ + void IterativeParseInit() { + parseResult_.Clear(); + state_ = IterativeParsingStartState; + } + + //! Parse one token from JSON text + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + bool IterativeParseNext(InputStream& is, Handler& handler) { + while (CEREAL_RAPIDJSON_LIKELY(is.Peek() != '\0')) { + SkipWhitespaceAndComments(is); + + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state_, t); + IterativeParsingState d = Transit(state_, t, n, is, handler); + + // If we've finished or hit an error... + if (CEREAL_RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) { + // Report errors. + if (d == IterativeParsingErrorState) { + HandleError(state_, is); + return false; + } + + // Transition to the finish state. + CEREAL_RAPIDJSON_ASSERT(d == IterativeParsingFinishState); + state_ = d; + + // If StopWhenDone is not set... + if (!(parseFlags & kParseStopWhenDoneFlag)) { + // ... and extra non-whitespace data is found... + SkipWhitespaceAndComments(is); + if (is.Peek() != '\0') { + // ... this is considered an error. + HandleError(state_, is); + return false; + } + } + + // Success! We are done! + return true; + } + + // Transition to the new state. + state_ = d; + + // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now. + if (!IsIterativeParsingDelimiterState(n)) + return true; + } + + // We reached the end of file. + stack_.Clear(); + + if (state_ != IterativeParsingFinishState) { + HandleError(state_, is); + return false; + } + + return true; + } + + //! Check if token-by-token parsing JSON text is complete + /*! \return Whether the JSON has been fully decoded. + */ + CEREAL_RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const { + return IsIterativeParsingCompleteState(state_); + } + + //! Whether a parse error has occurred in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + +protected: + void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } + +private: + // Prohibit copy constructor & assignment operator. + GenericReader(const GenericReader&); + GenericReader& operator=(const GenericReader&); + + void ClearStack() { stack_.Clear(); } + + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericReader& r) : r_(r) {} + ~ClearStackOnExit() { r_.ClearStack(); } + private: + GenericReader& r_; + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + }; + + template + void SkipWhitespaceAndComments(InputStream& is) { + SkipWhitespace(is); + + if (parseFlags & kParseCommentsFlag) { + while (CEREAL_RAPIDJSON_UNLIKELY(Consume(is, '/'))) { + if (Consume(is, '*')) { + while (true) { + if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() == '\0')) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + else if (Consume(is, '*')) { + if (Consume(is, '/')) + break; + } + else + is.Take(); + } + } + else if (CEREAL_RAPIDJSON_LIKELY(Consume(is, '/'))) + while (is.Peek() != '\0' && is.Take() != '\n') {} + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + + SkipWhitespace(is); + } + } + } + + // Parse object: { string : value, ... } + template + void ParseObject(InputStream& is, Handler& handler) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() == '{'); + is.Take(); // Skip '{' + + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartObject())) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, '}')) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType memberCount = 0;;) { + if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() != '"')) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); + + ParseString(is, handler, true); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (CEREAL_RAPIDJSON_UNLIKELY(!Consume(is, ':'))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ParseValue(is, handler); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++memberCount; + + switch (is.Peek()) { + case ',': + is.Take(); + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + break; + case '}': + is.Take(); + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + default: + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy + } + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == '}') { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + // Parse array: [ value, ... ] + template + void ParseArray(InputStream& is, Handler& handler) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() == '['); + is.Take(); // Skip '[' + + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartArray())) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ']')) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType elementCount = 0;;) { + ParseValue(is, handler); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++elementCount; + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ',')) { + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + } + else if (Consume(is, ']')) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == ']') { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + template + void ParseNull(InputStream& is, Handler& handler) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() == 'n'); + is.Take(); + + if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Null())) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseTrue(InputStream& is, Handler& handler) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() == 't'); + is.Take(); + + if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Bool(true))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseFalse(InputStream& is, Handler& handler) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() == 'f'); + is.Take(); + + if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) { + if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Bool(false))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + CEREAL_RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) { + if (CEREAL_RAPIDJSON_LIKELY(is.Peek() == expect)) { + is.Take(); + return true; + } + else + return false; + } + + // Helper function to parse four hexadecimal digits in \uXXXX in ParseString(). + template + unsigned ParseHex4(InputStream& is, size_t escapeOffset) { + unsigned codepoint = 0; + for (int i = 0; i < 4; i++) { + Ch c = is.Peek(); + codepoint <<= 4; + codepoint += static_cast(c); + if (c >= '0' && c <= '9') + codepoint -= '0'; + else if (c >= 'A' && c <= 'F') + codepoint -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + codepoint -= 'a' - 10; + else { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); + } + is.Take(); + } + return codepoint; + } + + template + class StackStream { + public: + typedef CharType Ch; + + StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} + CEREAL_RAPIDJSON_FORCEINLINE void Put(Ch c) { + *stack_.template Push() = c; + ++length_; + } + + CEREAL_RAPIDJSON_FORCEINLINE void* Push(SizeType count) { + length_ += count; + return stack_.template Push(count); + } + + size_t Length() const { return length_; } + + Ch* Pop() { + return stack_.template Pop(length_); + } + + private: + StackStream(const StackStream&); + StackStream& operator=(const StackStream&); + + internal::Stack& stack_; + SizeType length_; + }; + + // Parse string and generate String event. Different code paths for kParseInsituFlag. + template + void ParseString(InputStream& is, Handler& handler, bool isKey = false) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + CEREAL_RAPIDJSON_ASSERT(s.Peek() == '\"'); + s.Take(); // Skip '\"' + + bool success = false; + if (parseFlags & kParseInsituFlag) { + typename InputStream::Ch *head = s.PutBegin(); + ParseStringToStream(s, s); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + size_t length = s.PutEnd(head) - 1; + CEREAL_RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); + } + else { + StackStream stackStream(stack_); + ParseStringToStream(s, stackStream); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + SizeType length = static_cast(stackStream.Length()) - 1; + const typename TargetEncoding::Ch* const str = stackStream.Pop(); + success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); + } + if (CEREAL_RAPIDJSON_UNLIKELY(!success)) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); + } + + // Parse string to an output is + // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. + template + CEREAL_RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + static const char escape[256] = { + Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', + Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, + 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, + 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 + }; +#undef Z16 +//!@endcond + + for (;;) { + // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation. + if (!(parseFlags & kParseValidateEncodingFlag)) + ScanCopyUnescapedString(is, os); + + Ch c = is.Peek(); + if (CEREAL_RAPIDJSON_UNLIKELY(c == '\\')) { // Escape + size_t escapeOffset = is.Tell(); // For invalid escaping, report the initial '\\' as error offset + is.Take(); + Ch e = is.Peek(); + if ((sizeof(Ch) == 1 || unsigned(e) < 256) && CEREAL_RAPIDJSON_LIKELY(escape[static_cast(e)])) { + is.Take(); + os.Put(static_cast(escape[static_cast(e)])); + } + else if (CEREAL_RAPIDJSON_LIKELY(e == 'u')) { // Unicode + is.Take(); + unsigned codepoint = ParseHex4(is, escapeOffset); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (CEREAL_RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDBFF)) { + // Handle UTF-16 surrogate pair + if (CEREAL_RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u'))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + unsigned codepoint2 = ParseHex4(is, escapeOffset); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (CEREAL_RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; + } + TEncoding::Encode(os, codepoint); + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset); + } + else if (CEREAL_RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote + is.Take(); + os.Put('\0'); // null-terminate the string + return; + } + else if (CEREAL_RAPIDJSON_UNLIKELY(static_cast(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF + if (c == '\0') + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell()); + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); + } + else { + size_t offset = is.Tell(); + if (CEREAL_RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ? + !Transcoder::Validate(is, os) : + !Transcoder::Transcode(is, os)))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset); + } + } + } + + template + static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) { + // Do nothing for generic version + } + +#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) + // StringStream -> StackStream + static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType length; + #ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; + #else + length = static_cast(__builtin_ffs(r) - 1); + #endif + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + CEREAL_RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16, q += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + for (const char* pend = p + length; p != pend; ) + *q++ = *p++; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static CEREAL_RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + CEREAL_RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + p += length; + break; + } + } + + is.src_ = is.dst_ = p; + } +#elif defined(CEREAL_RAPIDJSON_NEON) + // StringStream -> StackStream + static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high);; + length = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low);; + length = lz >> 3; + escaped = true; + } + if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + vst1q_u8(reinterpret_cast(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + CEREAL_RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16, q += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high); + length = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low); + length = lz >> 3; + escaped = true; + } + if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + for (const char* pend = p + length; p != pend; ) { + *q++ = *p++; + } + break; + } + vst1q_u8(reinterpret_cast(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static CEREAL_RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + CEREAL_RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz = __builtin_clzll(high); + p += 8 + (lz >> 3); + break; + } + } else { + int lz = __builtin_clzll(low); + p += lz >> 3; + break; + } + } + + is.src_ = is.dst_ = p; + } +#endif // CEREAL_RAPIDJSON_NEON + + template + class NumberStream; + + template + class NumberStream { + public: + typedef typename InputStream::Ch Ch; + + NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } + + CEREAL_RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } + CEREAL_RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } + CEREAL_RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } + CEREAL_RAPIDJSON_FORCEINLINE void Push(char) {} + + size_t Tell() { return is.Tell(); } + size_t Length() { return 0; } + const char* Pop() { return 0; } + + protected: + NumberStream& operator=(const NumberStream&); + + InputStream& is; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s), stackStream(reader.stack_) {} + + CEREAL_RAPIDJSON_FORCEINLINE Ch TakePush() { + stackStream.Put(static_cast(Base::is.Peek())); + return Base::is.Take(); + } + + CEREAL_RAPIDJSON_FORCEINLINE void Push(char c) { + stackStream.Put(c); + } + + size_t Length() { return stackStream.Length(); } + + const char* Pop() { + stackStream.Put('\0'); + return stackStream.Pop(); + } + + private: + StackStream stackStream; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& is) : Base(reader, is) {} + + CEREAL_RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); } + }; + + template + void ParseNumber(InputStream& is, Handler& handler) { + internal::StreamLocalCopy copy(is); + NumberStream s(*this, copy.s); + + size_t startOffset = s.Tell(); + double d = 0.0; + bool useNanOrInf = false; + + // Parse minus + bool minus = Consume(s, '-'); + + // Parse int: zero / ( digit1-9 *DIGIT ) + unsigned i = 0; + uint64_t i64 = 0; + bool use64bit = false; + int significandDigit = 0; + if (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() == '0')) { + i = 0; + s.TakePush(); + } + else if (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) { + i = static_cast(s.TakePush() - '0'); + + if (minus) + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (CEREAL_RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648 + if (CEREAL_RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (CEREAL_RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295 + if (CEREAL_RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + // Parse NaN or Infinity here + else if ((parseFlags & kParseNanAndInfFlag) && CEREAL_RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) { + if (Consume(s, 'N')) { + if (Consume(s, 'a') && Consume(s, 'N')) { + d = std::numeric_limits::quiet_NaN(); + useNanOrInf = true; + } + } + else if (CEREAL_RAPIDJSON_LIKELY(Consume(s, 'I'))) { + if (Consume(s, 'n') && Consume(s, 'f')) { + d = (minus ? -std::numeric_limits::infinity() : std::numeric_limits::infinity()); + useNanOrInf = true; + + if (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n') + && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) { + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + } + + if (CEREAL_RAPIDJSON_UNLIKELY(!useNanOrInf)) { + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + + // Parse 64bit int + bool useDouble = false; + if (use64bit) { + if (minus) + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (CEREAL_RAPIDJSON_UNLIKELY(i64 >= CEREAL_RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808 + if (CEREAL_RAPIDJSON_LIKELY(i64 != CEREAL_RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (CEREAL_RAPIDJSON_UNLIKELY(i64 >= CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615 + if (CEREAL_RAPIDJSON_LIKELY(i64 != CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + + // Force double for big integer + if (useDouble) { + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + d = d * 10 + (s.TakePush() - '0'); + } + } + + // Parse frac = decimal-point 1*DIGIT + int expFrac = 0; + size_t decimalPosition; + if (Consume(s, '.')) { + decimalPosition = s.Length(); + + if (CEREAL_RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9'))) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); + + if (!useDouble) { +#if CEREAL_RAPIDJSON_64BIT + // Use i64 to store significand in 64-bit architecture + if (!use64bit) + i64 = i; + + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (i64 > CEREAL_RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path + break; + else { + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + --expFrac; + if (i64 != 0) + significandDigit++; + } + } + + d = static_cast(i64); +#else + // Use double to store significand in 32-bit architecture + d = static_cast(use64bit ? i64 : i); +#endif + useDouble = true; + } + + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (significandDigit < 17) { + d = d * 10.0 + (s.TakePush() - '0'); + --expFrac; + if (CEREAL_RAPIDJSON_LIKELY(d > 0.0)) + significandDigit++; + } + else + s.TakePush(); + } + } + else + decimalPosition = s.Length(); // decimal position at the end of integer. + + // Parse exp = e [ minus / plus ] 1*DIGIT + int exp = 0; + if (Consume(s, 'e') || Consume(s, 'E')) { + if (!useDouble) { + d = static_cast(use64bit ? i64 : i); + useDouble = true; + } + + bool expMinus = false; + if (Consume(s, '+')) + ; + else if (Consume(s, '-')) + expMinus = true; + + if (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = static_cast(s.Take() - '0'); + if (expMinus) { + // (exp + expFrac) must not underflow int => we're detecting when -exp gets + // dangerously close to INT_MIN (a pessimistic next digit 9 would push it into + // underflow territory): + // + // -(exp * 10 + 9) + expFrac >= INT_MIN + // <=> exp <= (expFrac - INT_MIN - 9) / 10 + CEREAL_RAPIDJSON_ASSERT(expFrac <= 0); + int maxExp = (expFrac + 2147483639) / 10; + + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (CEREAL_RAPIDJSON_UNLIKELY(exp > maxExp)) { + while (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent + s.Take(); + } + } + } + else { // positive exp + int maxExp = 308 - expFrac; + while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (CEREAL_RAPIDJSON_UNLIKELY(exp > maxExp)) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + } + } + } + else + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); + + if (expMinus) + exp = -exp; + } + + // Finish parsing, call event according to the type of number. + bool cont = true; + + if (parseFlags & kParseNumbersAsStringsFlag) { + if (parseFlags & kParseInsituFlag) { + s.Pop(); // Pop stack no matter if it will be used or not. + typename InputStream::Ch* head = is.PutBegin(); + const size_t length = s.Tell() - startOffset; + CEREAL_RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + // unable to insert the \0 character here, it will erase the comma after this number + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + cont = handler.RawNumber(str, SizeType(length), false); + } + else { + SizeType numCharsToCopy = static_cast(s.Length()); + StringStream srcStream(s.Pop()); + StackStream dstStream(stack_); + while (numCharsToCopy--) { + Transcoder, TargetEncoding>::Transcode(srcStream, dstStream); + } + dstStream.Put('\0'); + const typename TargetEncoding::Ch* str = dstStream.Pop(); + const SizeType length = static_cast(dstStream.Length()) - 1; + cont = handler.RawNumber(str, SizeType(length), true); + } + } + else { + size_t length = s.Length(); + const char* decimal = s.Pop(); // Pop stack no matter if it will be used or not. + + if (useDouble) { + int p = exp + expFrac; + if (parseFlags & kParseFullPrecisionFlag) + d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); + else + d = internal::StrtodNormalPrecision(d, p); + + // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal + if (d > (std::numeric_limits::max)()) { + // Overflow + // TODO: internal::StrtodX should report overflow (or underflow) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + } + + cont = handler.Double(minus ? -d : d); + } + else if (useNanOrInf) { + cont = handler.Double(d); + } + else { + if (use64bit) { + if (minus) + cont = handler.Int64(static_cast(~i64 + 1)); + else + cont = handler.Uint64(i64); + } + else { + if (minus) + cont = handler.Int(static_cast(~i + 1)); + else + cont = handler.Uint(i); + } + } + } + if (CEREAL_RAPIDJSON_UNLIKELY(!cont)) + CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset); + } + + // Parse any JSON value + template + void ParseValue(InputStream& is, Handler& handler) { + switch (is.Peek()) { + case 'n': ParseNull (is, handler); break; + case 't': ParseTrue (is, handler); break; + case 'f': ParseFalse (is, handler); break; + case '"': ParseString(is, handler); break; + case '{': ParseObject(is, handler); break; + case '[': ParseArray (is, handler); break; + default : + ParseNumber(is, handler); + break; + + } + } + + // Iterative Parsing + + // States + enum IterativeParsingState { + IterativeParsingFinishState = 0, // sink states at top + IterativeParsingErrorState, // sink states at top + IterativeParsingStartState, + + // Object states + IterativeParsingObjectInitialState, + IterativeParsingMemberKeyState, + IterativeParsingMemberValueState, + IterativeParsingObjectFinishState, + + // Array states + IterativeParsingArrayInitialState, + IterativeParsingElementState, + IterativeParsingArrayFinishState, + + // Single value state + IterativeParsingValueState, + + // Delimiter states (at bottom) + IterativeParsingElementDelimiterState, + IterativeParsingMemberDelimiterState, + IterativeParsingKeyValueDelimiterState, + + cIterativeParsingStateCount + }; + + // Tokens + enum Token { + LeftBracketToken = 0, + RightBracketToken, + + LeftCurlyBracketToken, + RightCurlyBracketToken, + + CommaToken, + ColonToken, + + StringToken, + FalseToken, + TrueToken, + NullToken, + NumberToken, + + kTokenCount + }; + + CEREAL_RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) const { + +//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define N NumberToken +#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N + // Maps from ASCII to Token + static const unsigned char tokenMap[256] = { + N16, // 00~0F + N16, // 10~1F + N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F + N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F + N16, // 40~4F + N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F + N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F + N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F + N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF + }; +#undef N +#undef N16 +//!@endcond + + if (sizeof(Ch) == 1 || static_cast(c) < 256) + return static_cast(tokenMap[static_cast(c)]); + else + return NumberToken; + } + + CEREAL_RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) const { + // current state x one lookahead token -> new state + static const char G[cIterativeParsingStateCount][kTokenCount] = { + // Finish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Error(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Start + { + IterativeParsingArrayInitialState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingValueState, // String + IterativeParsingValueState, // False + IterativeParsingValueState, // True + IterativeParsingValueState, // Null + IterativeParsingValueState // Number + }, + // ObjectInitial + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberKey + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingKeyValueDelimiterState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberValue + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingMemberDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ObjectFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ArrayInitial + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // Element + { + IterativeParsingErrorState, // Left bracket + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingElementDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ArrayFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Single Value (sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ElementDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // MemberDelimiter + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // KeyValueDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberValueState, // String + IterativeParsingMemberValueState, // False + IterativeParsingMemberValueState, // True + IterativeParsingMemberValueState, // Null + IterativeParsingMemberValueState // Number + }, + }; // End of G + + return static_cast(G[state][token]); + } + + // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). + // May return a new state on state pop. + template + CEREAL_RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { + (void)token; + + switch (dst) { + case IterativeParsingErrorState: + return dst; + + case IterativeParsingObjectInitialState: + case IterativeParsingArrayInitialState: + { + // Push the state(Element or MemeberValue) if we are nested in another array or value of member. + // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. + IterativeParsingState n = src; + if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) + n = IterativeParsingElementState; + else if (src == IterativeParsingKeyValueDelimiterState) + n = IterativeParsingMemberValueState; + // Push current state. + *stack_.template Push(1) = n; + // Initialize and push the member/element count. + *stack_.template Push(1) = 0; + // Call handler + bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); + // On handler short circuits the parsing. + if (!hr) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return dst; + } + } + + case IterativeParsingMemberKeyState: + ParseString(is, handler, true); + if (HasParseError()) + return IterativeParsingErrorState; + else + return dst; + + case IterativeParsingKeyValueDelimiterState: + CEREAL_RAPIDJSON_ASSERT(token == ColonToken); + is.Take(); + return dst; + + case IterativeParsingMemberValueState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingElementState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingMemberDelimiterState: + case IterativeParsingElementDelimiterState: + is.Take(); + // Update member/element count. + *stack_.template Top() = *stack_.template Top() + 1; + return dst; + + case IterativeParsingObjectFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell()); + return IterativeParsingErrorState; + } + // Get member count. + SizeType c = *stack_.template Pop(1); + // If the object is not empty, count the last member. + if (src == IterativeParsingMemberValueState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndObject(c); + // On handler short circuits the parsing. + if (!hr) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + case IterativeParsingArrayFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell()); + return IterativeParsingErrorState; + } + // Get element count. + SizeType c = *stack_.template Pop(1); + // If the array is not empty, count the last element. + if (src == IterativeParsingElementState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndArray(c); + // On handler short circuits the parsing. + if (!hr) { + CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + default: + // This branch is for IterativeParsingValueState actually. + // Use `default:` rather than + // `case IterativeParsingValueState:` is for code coverage. + + // The IterativeParsingStartState is not enumerated in this switch-case. + // It is impossible for that case. And it can be caught by following assertion. + + // The IterativeParsingFinishState is not enumerated in this switch-case either. + // It is a "derivative" state which cannot triggered from Predict() directly. + // Therefore it cannot happen here. And it can be caught by following assertion. + CEREAL_RAPIDJSON_ASSERT(dst == IterativeParsingValueState); + + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return IterativeParsingFinishState; + } + } + + template + void HandleError(IterativeParsingState src, InputStream& is) { + if (HasParseError()) { + // Error flag has been set. + return; + } + + switch (src) { + case IterativeParsingStartState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return; + case IterativeParsingFinishState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return; + case IterativeParsingObjectInitialState: + case IterativeParsingMemberDelimiterState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return; + case IterativeParsingMemberKeyState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return; + case IterativeParsingMemberValueState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return; + case IterativeParsingKeyValueDelimiterState: + case IterativeParsingArrayInitialState: + case IterativeParsingElementDelimiterState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return; + default: CEREAL_RAPIDJSON_ASSERT(src == IterativeParsingElementState); CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return; + } + } + + CEREAL_RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const { + return s >= IterativeParsingElementDelimiterState; + } + + CEREAL_RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const { + return s <= IterativeParsingErrorState; + } + + template + ParseResult IterativeParse(InputStream& is, Handler& handler) { + parseResult_.Clear(); + ClearStackOnExit scope(*this); + IterativeParsingState state = IterativeParsingStartState; + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + while (is.Peek() != '\0') { + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state, t); + IterativeParsingState d = Transit(state, t, n, is, handler); + + if (d == IterativeParsingErrorState) { + HandleError(state, is); + break; + } + + state = d; + + // Do not further consume streams if a root JSON has been parsed. + if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) + break; + + SkipWhitespaceAndComments(is); + CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + + // Handle the end of file. + if (state != IterativeParsingFinishState) + HandleError(state, is); + + return parseResult_; + } + + static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. + internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. + ParseResult parseResult_; + IterativeParsingState state_; +}; // class GenericReader + +//! Reader with UTF8 encoding and default allocator. +typedef GenericReader, UTF8<> > Reader; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) || defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_POP +#endif + + +#ifdef __GNUC__ +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_READER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h new file mode 100644 index 000000000..17366c670 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h @@ -0,0 +1,2497 @@ +// Tencent is pleased to support the open source community by making RapidJSON available-> +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved-> +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License-> You may obtain a copy of the License at +// +// http://opensource->org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied-> See the License for the +// specific language governing permissions and limitations under the License-> + +#ifndef CEREAL_RAPIDJSON_SCHEMA_H_ +#define CEREAL_RAPIDJSON_SCHEMA_H_ + +#include "document.h" +#include "pointer.h" +#include "stringbuffer.h" +#include // abs, floor + +#if !defined(CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX) +#define CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1 +#else +#define CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0 +#endif + +#if !CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) +#define CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX 1 +#else +#define CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX 0 +#endif + +#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX +#include "internal/regex.h" +#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX +#include +#endif + +#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX || CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX +#define CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX 1 +#else +#define CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX 0 +#endif + +#ifndef CEREAL_RAPIDJSON_SCHEMA_VERBOSE +#define CEREAL_RAPIDJSON_SCHEMA_VERBOSE 0 +#endif + +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE +#include "stringbuffer.h" +#endif + +CEREAL_RAPIDJSON_DIAG_PUSH + +#if defined(__GNUC__) +CEREAL_RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_OFF(weak-vtables) +CEREAL_RAPIDJSON_DIAG_OFF(exit-time-destructors) +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat-pedantic) +CEREAL_RAPIDJSON_DIAG_OFF(variadic-macros) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Verbose Utilities + +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + +namespace internal { + +inline void PrintInvalidKeyword(const char* keyword) { + printf("Fail keyword: %s\n", keyword); +} + +inline void PrintInvalidKeyword(const wchar_t* keyword) { + wprintf(L"Fail keyword: %ls\n", keyword); +} + +inline void PrintInvalidDocument(const char* document) { + printf("Fail document: %s\n\n", document); +} + +inline void PrintInvalidDocument(const wchar_t* document) { + wprintf(L"Fail document: %ls\n\n", document); +} + +inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) { + printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d); +} + +inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) { + wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d); +} + +} // namespace internal + +#endif // CEREAL_RAPIDJSON_SCHEMA_VERBOSE + +/////////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN + +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE +#define CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword) +#else +#define CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) +#endif + +#define CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\ +CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN\ + context.invalidKeyword = keyword.GetString();\ + CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword.GetString());\ + return false;\ +CEREAL_RAPIDJSON_MULTILINEMACRO_END + +/////////////////////////////////////////////////////////////////////////////// +// Forward declarations + +template +class GenericSchemaDocument; + +namespace internal { + +template +class Schema; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaValidator + +class ISchemaValidator { +public: + virtual ~ISchemaValidator() {} + virtual bool IsValid() const = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaStateFactory + +template +class ISchemaStateFactory { +public: + virtual ~ISchemaStateFactory() {} + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&) = 0; + virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0; + virtual void* CreateHasher() = 0; + virtual uint64_t GetHashCode(void* hasher) = 0; + virtual void DestroryHasher(void* hasher) = 0; + virtual void* MallocState(size_t size) = 0; + virtual void FreeState(void* p) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// IValidationErrorHandler + +template +class IValidationErrorHandler { +public: + typedef typename SchemaType::Ch Ch; + typedef typename SchemaType::SValue SValue; + + virtual ~IValidationErrorHandler() {} + + virtual void NotMultipleOf(int64_t actual, const SValue& expected) = 0; + virtual void NotMultipleOf(uint64_t actual, const SValue& expected) = 0; + virtual void NotMultipleOf(double actual, const SValue& expected) = 0; + virtual void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void AboveMaximum(double actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(double actual, const SValue& expected, bool exclusive) = 0; + + virtual void TooLong(const Ch* str, SizeType length, SizeType expected) = 0; + virtual void TooShort(const Ch* str, SizeType length, SizeType expected) = 0; + virtual void DoesNotMatch(const Ch* str, SizeType length) = 0; + + virtual void DisallowedItem(SizeType index) = 0; + virtual void TooFewItems(SizeType actualCount, SizeType expectedCount) = 0; + virtual void TooManyItems(SizeType actualCount, SizeType expectedCount) = 0; + virtual void DuplicateItems(SizeType index1, SizeType index2) = 0; + + virtual void TooManyProperties(SizeType actualCount, SizeType expectedCount) = 0; + virtual void TooFewProperties(SizeType actualCount, SizeType expectedCount) = 0; + virtual void StartMissingProperties() = 0; + virtual void AddMissingProperty(const SValue& name) = 0; + virtual bool EndMissingProperties() = 0; + virtual void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void DisallowedProperty(const Ch* name, SizeType length) = 0; + + virtual void StartDependencyErrors() = 0; + virtual void StartMissingDependentProperties() = 0; + virtual void AddMissingDependentProperty(const SValue& targetName) = 0; + virtual void EndMissingDependentProperties(const SValue& sourceName) = 0; + virtual void AddDependencySchemaError(const SValue& souceName, ISchemaValidator* subvalidator) = 0; + virtual bool EndDependencyErrors() = 0; + + virtual void DisallowedValue() = 0; + virtual void StartDisallowedType() = 0; + virtual void AddExpectedType(const typename SchemaType::ValueType& expectedType) = 0; + virtual void EndDisallowedType(const typename SchemaType::ValueType& actualType) = 0; + virtual void NotAllOf(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void NoneOf(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void NotOneOf(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void Disallowed() = 0; +}; + + +/////////////////////////////////////////////////////////////////////////////// +// Hasher + +// For comparison of compound value +template +class Hasher { +public: + typedef typename Encoding::Ch Ch; + + Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {} + + bool Null() { return WriteType(kNullType); } + bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); } + bool Int(int i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Double(double d) { + Number n; + if (d < 0) n.u.i = static_cast(d); + else n.u.u = static_cast(d); + n.d = d; + return WriteNumber(n); + } + + bool RawNumber(const Ch* str, SizeType len, bool) { + WriteBuffer(kNumberType, str, len * sizeof(Ch)); + return true; + } + + bool String(const Ch* str, SizeType len, bool) { + WriteBuffer(kStringType, str, len * sizeof(Ch)); + return true; + } + + bool StartObject() { return true; } + bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } + bool EndObject(SizeType memberCount) { + uint64_t h = Hash(0, kObjectType); + uint64_t* kv = stack_.template Pop(memberCount * 2); + for (SizeType i = 0; i < memberCount; i++) + h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive + *stack_.template Push() = h; + return true; + } + + bool StartArray() { return true; } + bool EndArray(SizeType elementCount) { + uint64_t h = Hash(0, kArrayType); + uint64_t* e = stack_.template Pop(elementCount); + for (SizeType i = 0; i < elementCount; i++) + h = Hash(h, e[i]); // Use hash to achieve element order sensitive + *stack_.template Push() = h; + return true; + } + + bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); } + + uint64_t GetHashCode() const { + CEREAL_RAPIDJSON_ASSERT(IsValid()); + return *stack_.template Top(); + } + +private: + static const size_t kDefaultSize = 256; + struct Number { + union U { + uint64_t u; + int64_t i; + }u; + double d; + }; + + bool WriteType(Type type) { return WriteBuffer(type, 0, 0); } + + bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); } + + bool WriteBuffer(Type type, const void* data, size_t len) { + // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ + uint64_t h = Hash(CEREAL_RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type); + const unsigned char* d = static_cast(data); + for (size_t i = 0; i < len; i++) + h = Hash(h, d[i]); + *stack_.template Push() = h; + return true; + } + + static uint64_t Hash(uint64_t h, uint64_t d) { + static const uint64_t kPrime = CEREAL_RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3); + h ^= d; + h *= kPrime; + return h; + } + + Stack stack_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidationContext + +template +struct SchemaValidationContext { + typedef Schema SchemaType; + typedef ISchemaStateFactory SchemaValidatorFactoryType; + typedef IValidationErrorHandler ErrorHandlerType; + typedef typename SchemaType::ValueType ValueType; + typedef typename ValueType::Ch Ch; + + enum PatternValidatorType { + kPatternValidatorOnly, + kPatternValidatorWithProperty, + kPatternValidatorWithAdditionalProperty + }; + + SchemaValidationContext(SchemaValidatorFactoryType& f, ErrorHandlerType& eh, const SchemaType* s) : + factory(f), + error_handler(eh), + schema(s), + valueSchema(), + invalidKeyword(), + hasher(), + arrayElementHashCodes(), + validators(), + validatorCount(), + patternPropertiesValidators(), + patternPropertiesValidatorCount(), + patternPropertiesSchemas(), + patternPropertiesSchemaCount(), + valuePatternValidatorType(kPatternValidatorOnly), + propertyExist(), + inArray(false), + valueUniqueness(false), + arrayUniqueness(false) + { + } + + ~SchemaValidationContext() { + if (hasher) + factory.DestroryHasher(hasher); + if (validators) { + for (SizeType i = 0; i < validatorCount; i++) + factory.DestroySchemaValidator(validators[i]); + factory.FreeState(validators); + } + if (patternPropertiesValidators) { + for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) + factory.DestroySchemaValidator(patternPropertiesValidators[i]); + factory.FreeState(patternPropertiesValidators); + } + if (patternPropertiesSchemas) + factory.FreeState(patternPropertiesSchemas); + if (propertyExist) + factory.FreeState(propertyExist); + } + + SchemaValidatorFactoryType& factory; + ErrorHandlerType& error_handler; + const SchemaType* schema; + const SchemaType* valueSchema; + const Ch* invalidKeyword; + void* hasher; // Only validator access + void* arrayElementHashCodes; // Only validator access this + ISchemaValidator** validators; + SizeType validatorCount; + ISchemaValidator** patternPropertiesValidators; + SizeType patternPropertiesValidatorCount; + const SchemaType** patternPropertiesSchemas; + SizeType patternPropertiesSchemaCount; + PatternValidatorType valuePatternValidatorType; + PatternValidatorType objectPatternValidatorType; + SizeType arrayElementIndex; + bool* propertyExist; + bool inArray; + bool valueUniqueness; + bool arrayUniqueness; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Schema + +template +class Schema { +public: + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename SchemaDocumentType::AllocatorType AllocatorType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef SchemaValidationContext Context; + typedef Schema SchemaType; + typedef GenericValue SValue; + typedef IValidationErrorHandler ErrorHandler; + friend class GenericSchemaDocument; + + Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) : + allocator_(allocator), + uri_(schemaDocument->GetURI(), *allocator), + pointer_(p, allocator), + typeless_(schemaDocument->GetTypeless()), + enum_(), + enumCount_(), + not_(), + type_((1 << kTotalSchemaType) - 1), // typeless + validatorCount_(), + notValidatorIndex_(), + properties_(), + additionalPropertiesSchema_(), + patternProperties_(), + patternPropertyCount_(), + propertyCount_(), + minProperties_(), + maxProperties_(SizeType(~0)), + additionalProperties_(true), + hasDependencies_(), + hasRequired_(), + hasSchemaDependencies_(), + additionalItemsSchema_(), + itemsList_(), + itemsTuple_(), + itemsTupleCount_(), + minItems_(), + maxItems_(SizeType(~0)), + additionalItems_(true), + uniqueItems_(false), + pattern_(), + minLength_(0), + maxLength_(~SizeType(0)), + exclusiveMinimum_(false), + exclusiveMaximum_(false), + defaultValueLength_(0) + { + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename ValueType::ConstValueIterator ConstValueIterator; + typedef typename ValueType::ConstMemberIterator ConstMemberIterator; + + if (!value.IsObject()) + return; + + if (const ValueType* v = GetMember(value, GetTypeString())) { + type_ = 0; + if (v->IsString()) + AddType(*v); + else if (v->IsArray()) + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) + AddType(*itr); + } + + if (const ValueType* v = GetMember(value, GetEnumString())) + if (v->IsArray() && v->Size() > 0) { + enum_ = static_cast(allocator_->Malloc(sizeof(uint64_t) * v->Size())); + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { + typedef Hasher > EnumHasherType; + char buffer[256u + 24]; + MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer)); + EnumHasherType h(&hasherAllocator, 256); + itr->Accept(h); + enum_[enumCount_++] = h.GetHashCode(); + } + } + + if (schemaDocument) { + AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); + AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); + AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); + } + + if (const ValueType* v = GetMember(value, GetNotString())) { + schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document); + notValidatorIndex_ = validatorCount_; + validatorCount_++; + } + + // Object + + const ValueType* properties = GetMember(value, GetPropertiesString()); + const ValueType* required = GetMember(value, GetRequiredString()); + const ValueType* dependencies = GetMember(value, GetDependenciesString()); + { + // Gather properties from properties/required/dependencies + SValue allProperties(kArrayType); + + if (properties && properties->IsObject()) + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) + AddUniqueElement(allProperties, itr->name); + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) + AddUniqueElement(allProperties, *itr); + + if (dependencies && dependencies->IsObject()) + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + AddUniqueElement(allProperties, itr->name); + if (itr->value.IsArray()) + for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) + if (i->IsString()) + AddUniqueElement(allProperties, *i); + } + + if (allProperties.Size() > 0) { + propertyCount_ = allProperties.Size(); + properties_ = static_cast(allocator_->Malloc(sizeof(Property) * propertyCount_)); + for (SizeType i = 0; i < propertyCount_; i++) { + new (&properties_[i]) Property(); + properties_[i].name = allProperties[i]; + properties_[i].schema = typeless_; + } + } + } + + if (properties && properties->IsObject()) { + PointerType q = p.Append(GetPropertiesString(), allocator_); + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { + SizeType index; + if (FindPropertyIndex(itr->name, &index)) + schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document); + } + } + + if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) { + PointerType q = p.Append(GetPatternPropertiesString(), allocator_); + patternProperties_ = static_cast(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount())); + patternPropertyCount_ = 0; + + for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { + new (&patternProperties_[patternPropertyCount_]) PatternProperty(); + patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name); + schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document); + patternPropertyCount_++; + } + } + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) { + SizeType index; + if (FindPropertyIndex(*itr, &index)) { + properties_[index].required = true; + hasRequired_ = true; + } + } + + if (dependencies && dependencies->IsObject()) { + PointerType q = p.Append(GetDependenciesString(), allocator_); + hasDependencies_ = true; + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + SizeType sourceIndex; + if (FindPropertyIndex(itr->name, &sourceIndex)) { + if (itr->value.IsArray()) { + properties_[sourceIndex].dependencies = static_cast(allocator_->Malloc(sizeof(bool) * propertyCount_)); + std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_); + for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) { + SizeType targetIndex; + if (FindPropertyIndex(*targetItr, &targetIndex)) + properties_[sourceIndex].dependencies[targetIndex] = true; + } + } + else if (itr->value.IsObject()) { + hasSchemaDependencies_ = true; + schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document); + properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_; + validatorCount_++; + } + } + } + } + + if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) { + if (v->IsBool()) + additionalProperties_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document); + } + + AssignIfExist(minProperties_, value, GetMinPropertiesString()); + AssignIfExist(maxProperties_, value, GetMaxPropertiesString()); + + // Array + if (const ValueType* v = GetMember(value, GetItemsString())) { + PointerType q = p.Append(GetItemsString(), allocator_); + if (v->IsObject()) // List validation + schemaDocument->CreateSchema(&itemsList_, q, *v, document); + else if (v->IsArray()) { // Tuple validation + itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); + SizeType index = 0; + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) + schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document); + } + } + + AssignIfExist(minItems_, value, GetMinItemsString()); + AssignIfExist(maxItems_, value, GetMaxItemsString()); + + if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) { + if (v->IsBool()) + additionalItems_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document); + } + + AssignIfExist(uniqueItems_, value, GetUniqueItemsString()); + + // String + AssignIfExist(minLength_, value, GetMinLengthString()); + AssignIfExist(maxLength_, value, GetMaxLengthString()); + + if (const ValueType* v = GetMember(value, GetPatternString())) + pattern_ = CreatePattern(*v); + + // Number + if (const ValueType* v = GetMember(value, GetMinimumString())) + if (v->IsNumber()) + minimum_.CopyFrom(*v, *allocator_); + + if (const ValueType* v = GetMember(value, GetMaximumString())) + if (v->IsNumber()) + maximum_.CopyFrom(*v, *allocator_); + + AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString()); + AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString()); + + if (const ValueType* v = GetMember(value, GetMultipleOfString())) + if (v->IsNumber() && v->GetDouble() > 0.0) + multipleOf_.CopyFrom(*v, *allocator_); + + // Default + if (const ValueType* v = GetMember(value, GetDefaultValueString())) + if (v->IsString()) + defaultValueLength_ = v->GetStringLength(); + + } + + ~Schema() { + AllocatorType::Free(enum_); + if (properties_) { + for (SizeType i = 0; i < propertyCount_; i++) + properties_[i].~Property(); + AllocatorType::Free(properties_); + } + if (patternProperties_) { + for (SizeType i = 0; i < patternPropertyCount_; i++) + patternProperties_[i].~PatternProperty(); + AllocatorType::Free(patternProperties_); + } + AllocatorType::Free(itemsTuple_); +#if CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX + if (pattern_) { + pattern_->~RegexType(); + AllocatorType::Free(pattern_); + } +#endif + } + + const SValue& GetURI() const { + return uri_; + } + + const PointerType& GetPointer() const { + return pointer_; + } + + bool BeginValue(Context& context) const { + if (context.inArray) { + if (uniqueItems_) + context.valueUniqueness = true; + + if (itemsList_) + context.valueSchema = itemsList_; + else if (itemsTuple_) { + if (context.arrayElementIndex < itemsTupleCount_) + context.valueSchema = itemsTuple_[context.arrayElementIndex]; + else if (additionalItemsSchema_) + context.valueSchema = additionalItemsSchema_; + else if (additionalItems_) + context.valueSchema = typeless_; + else { + context.error_handler.DisallowedItem(context.arrayElementIndex); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetItemsString()); + } + } + else + context.valueSchema = typeless_; + + context.arrayElementIndex++; + } + return true; + } + + CEREAL_RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { + if (context.patternPropertiesValidatorCount > 0) { + bool otherValid = false; + SizeType count = context.patternPropertiesValidatorCount; + if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) + otherValid = context.patternPropertiesValidators[--count]->IsValid(); + + bool patternValid = true; + for (SizeType i = 0; i < count; i++) + if (!context.patternPropertiesValidators[i]->IsValid()) { + patternValid = false; + break; + } + + if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { + if (!patternValid) { + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + } + else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { + if (!patternValid || !otherValid) { + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + } + else if (!patternValid && !otherValid) { // kPatternValidatorWithAdditionalProperty) + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + } + + if (enum_) { + const uint64_t h = context.factory.GetHashCode(context.hasher); + for (SizeType i = 0; i < enumCount_; i++) + if (enum_[i] == h) + goto foundEnum; + context.error_handler.DisallowedValue(); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString()); + foundEnum:; + } + + if (allOf_.schemas) + for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) + if (!context.validators[i]->IsValid()) { + context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString()); + } + + if (anyOf_.schemas) { + for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) + if (context.validators[i]->IsValid()) + goto foundAny; + context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString()); + foundAny:; + } + + if (oneOf_.schemas) { + bool oneValid = false; + for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) + if (context.validators[i]->IsValid()) { + if (oneValid) { + context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); + } else + oneValid = true; + } + if (!oneValid) { + context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); + } + } + + if (not_ && context.validators[notValidatorIndex_]->IsValid()) { + context.error_handler.Disallowed(); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetNotString()); + } + + return true; + } + + bool Null(Context& context) const { + if (!(type_ & (1 << kNullSchemaType))) { + DisallowedType(context, GetNullString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + return CreateParallelValidator(context); + } + + bool Bool(Context& context, bool) const { + if (!(type_ & (1 << kBooleanSchemaType))) { + DisallowedType(context, GetBooleanString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + return CreateParallelValidator(context); + } + + bool Int(Context& context, int i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint(Context& context, unsigned u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Int64(Context& context, int64_t i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint64(Context& context, uint64_t u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Double(Context& context, double d) const { + if (!(type_ & (1 << kNumberSchemaType))) { + DisallowedType(context, GetNumberString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) + return false; + + if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) + return false; + + if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) + return false; + + return CreateParallelValidator(context); + } + + bool String(Context& context, const Ch* str, SizeType length, bool) const { + if (!(type_ & (1 << kStringSchemaType))) { + DisallowedType(context, GetStringString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + if (minLength_ != 0 || maxLength_ != SizeType(~0)) { + SizeType count; + if (internal::CountStringCodePoint(str, length, &count)) { + if (count < minLength_) { + context.error_handler.TooShort(str, length, minLength_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString()); + } + if (count > maxLength_) { + context.error_handler.TooLong(str, length, maxLength_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString()); + } + } + } + + if (pattern_ && !IsPatternMatch(pattern_, str, length)) { + context.error_handler.DoesNotMatch(str, length); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString()); + } + + return CreateParallelValidator(context); + } + + bool StartObject(Context& context) const { + if (!(type_ & (1 << kObjectSchemaType))) { + DisallowedType(context, GetObjectString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + if (hasDependencies_ || hasRequired_) { + context.propertyExist = static_cast(context.factory.MallocState(sizeof(bool) * propertyCount_)); + std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); + } + + if (patternProperties_) { // pre-allocate schema array + SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType + context.patternPropertiesSchemas = static_cast(context.factory.MallocState(sizeof(const SchemaType*) * count)); + context.patternPropertiesSchemaCount = 0; + std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); + } + + return CreateParallelValidator(context); + } + + bool Key(Context& context, const Ch* str, SizeType len, bool) const { + if (patternProperties_) { + context.patternPropertiesSchemaCount = 0; + for (SizeType i = 0; i < patternPropertyCount_; i++) + if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema; + context.valueSchema = typeless_; + } + } + + SizeType index; + if (FindPropertyIndex(ValueType(str, len).Move(), &index)) { + if (context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; + } + else + context.valueSchema = properties_[index].schema; + + if (context.propertyExist) + context.propertyExist[index] = true; + + return true; + } + + if (additionalPropertiesSchema_) { + if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; + } + else + context.valueSchema = additionalPropertiesSchema_; + return true; + } + else if (additionalProperties_) { + context.valueSchema = typeless_; + return true; + } + + if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties + context.error_handler.DisallowedProperty(str, len); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAdditionalPropertiesString()); + } + + return true; + } + + bool EndObject(Context& context, SizeType memberCount) const { + if (hasRequired_) { + context.error_handler.StartMissingProperties(); + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].required && !context.propertyExist[index]) + if (properties_[index].schema->defaultValueLength_ == 0 ) + context.error_handler.AddMissingProperty(properties_[index].name); + if (context.error_handler.EndMissingProperties()) + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetRequiredString()); + } + + if (memberCount < minProperties_) { + context.error_handler.TooFewProperties(memberCount, minProperties_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinPropertiesString()); + } + + if (memberCount > maxProperties_) { + context.error_handler.TooManyProperties(memberCount, maxProperties_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxPropertiesString()); + } + + if (hasDependencies_) { + context.error_handler.StartDependencyErrors(); + for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) { + const Property& source = properties_[sourceIndex]; + if (context.propertyExist[sourceIndex]) { + if (source.dependencies) { + context.error_handler.StartMissingDependentProperties(); + for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++) + if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex]) + context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name); + context.error_handler.EndMissingDependentProperties(source.name); + } + else if (source.dependenciesSchema) { + ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex]; + if (!dependenciesValidator->IsValid()) + context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator); + } + } + } + if (context.error_handler.EndDependencyErrors()) + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString()); + } + + return true; + } + + bool StartArray(Context& context) const { + if (!(type_ & (1 << kArraySchemaType))) { + DisallowedType(context, GetArrayString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + context.arrayElementIndex = 0; + context.inArray = true; + + return CreateParallelValidator(context); + } + + bool EndArray(Context& context, SizeType elementCount) const { + context.inArray = false; + + if (elementCount < minItems_) { + context.error_handler.TooFewItems(elementCount, minItems_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinItemsString()); + } + + if (elementCount > maxItems_) { + context.error_handler.TooManyItems(elementCount, maxItems_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxItemsString()); + } + + return true; + } + + // Generate functions for string literal according to Ch +#define CEREAL_RAPIDJSON_STRING_(name, ...) \ + static const ValueType& Get##name##String() {\ + static const Ch s[] = { __VA_ARGS__, '\0' };\ + static const ValueType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1));\ + return v;\ + } + + CEREAL_RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') + CEREAL_RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n') + CEREAL_RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't') + CEREAL_RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y') + CEREAL_RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g') + CEREAL_RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r') + CEREAL_RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r') + CEREAL_RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e') + CEREAL_RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm') + CEREAL_RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f') + CEREAL_RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f') + CEREAL_RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f') + CEREAL_RAPIDJSON_STRING_(Not, 'n', 'o', 't') + CEREAL_RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd') + CEREAL_RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + CEREAL_RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's') + CEREAL_RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's') + CEREAL_RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's') + CEREAL_RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's') + CEREAL_RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's') + CEREAL_RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h') + CEREAL_RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h') + CEREAL_RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n') + CEREAL_RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm') + CEREAL_RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm') + CEREAL_RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm') + CEREAL_RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm') + CEREAL_RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f') + CEREAL_RAPIDJSON_STRING_(DefaultValue, 'd', 'e', 'f', 'a', 'u', 'l', 't') + +#undef CEREAL_RAPIDJSON_STRING_ + +private: + enum SchemaValueType { + kNullSchemaType, + kBooleanSchemaType, + kObjectSchemaType, + kArraySchemaType, + kStringSchemaType, + kNumberSchemaType, + kIntegerSchemaType, + kTotalSchemaType + }; + +#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX + typedef internal::GenericRegex RegexType; +#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX + typedef std::basic_regex RegexType; +#else + typedef char RegexType; +#endif + + struct SchemaArray { + SchemaArray() : schemas(), count() {} + ~SchemaArray() { AllocatorType::Free(schemas); } + const SchemaType** schemas; + SizeType begin; // begin index of context.validators + SizeType count; + }; + + template + void AddUniqueElement(V1& a, const V2& v) { + for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) + if (*itr == v) + return; + V1 c(v, *allocator_); + a.PushBack(c, *allocator_); + } + + static const ValueType* GetMember(const ValueType& value, const ValueType& name) { + typename ValueType::ConstMemberIterator itr = value.FindMember(name); + return itr != value.MemberEnd() ? &(itr->value) : 0; + } + + static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsBool()) + out = v->GetBool(); + } + + static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) + out = static_cast(v->GetUint64()); + } + + void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) { + if (const ValueType* v = GetMember(value, name)) { + if (v->IsArray() && v->Size() > 0) { + PointerType q = p.Append(name, allocator_); + out.count = v->Size(); + out.schemas = static_cast(allocator_->Malloc(out.count * sizeof(const Schema*))); + memset(out.schemas, 0, sizeof(Schema*)* out.count); + for (SizeType i = 0; i < out.count; i++) + schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document); + out.begin = validatorCount_; + validatorCount_ += out.count; + } + } + } + +#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) { + RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_); + if (!r->IsValid()) { + r->~RegexType(); + AllocatorType::Free(r); + r = 0; + } + return r; + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { + GenericRegexSearch rs(*pattern); + return rs.Search(str); + } +#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) { + RegexType *r = static_cast(allocator_->Malloc(sizeof(RegexType))); + try { + return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); + } + catch (const std::regex_error&) { + AllocatorType::Free(r); + } + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) { + std::match_results r; + return std::regex_search(str, str + length, r, *pattern); + } +#else + template + RegexType* CreatePattern(const ValueType&) { return 0; } + + static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; } +#endif // CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX + + void AddType(const ValueType& type) { + if (type == GetNullString() ) type_ |= 1 << kNullSchemaType; + else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType; + else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType; + else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType; + else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType; + else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType; + else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); + } + + bool CreateParallelValidator(Context& context) const { + if (enum_ || context.arrayUniqueness) + context.hasher = context.factory.CreateHasher(); + + if (validatorCount_) { + CEREAL_RAPIDJSON_ASSERT(context.validators == 0); + context.validators = static_cast(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_)); + context.validatorCount = validatorCount_; + + if (allOf_.schemas) + CreateSchemaValidators(context, allOf_); + + if (anyOf_.schemas) + CreateSchemaValidators(context, anyOf_); + + if (oneOf_.schemas) + CreateSchemaValidators(context, oneOf_); + + if (not_) + context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_); + + if (hasSchemaDependencies_) { + for (SizeType i = 0; i < propertyCount_; i++) + if (properties_[i].dependenciesSchema) + context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema); + } + } + + return true; + } + + void CreateSchemaValidators(Context& context, const SchemaArray& schemas) const { + for (SizeType i = 0; i < schemas.count; i++) + context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i]); + } + + // O(n) + bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const { + SizeType len = name.GetStringLength(); + const Ch* str = name.GetString(); + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].name.GetStringLength() == len && + (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0)) + { + *outIndex = index; + return true; + } + return false; + } + + bool CheckInt(Context& context, int64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { + DisallowedType(context, GetIntegerString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + if (!minimum_.IsNull()) { + if (minimum_.IsInt64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + } + } + else if (minimum_.IsUint64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); // i <= max(int64_t) < minimum.GetUint64() + } + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsInt64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + } + } + else if (maximum_.IsUint64()) { } + /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (static_cast(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) { + context.error_handler.NotMultipleOf(i, multipleOf_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + } + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckUint(Context& context, uint64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { + DisallowedType(context, GetIntegerString()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + } + + if (!minimum_.IsNull()) { + if (minimum_.IsUint64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + } + } + else if (minimum_.IsInt64()) + /* do nothing */; // i >= 0 > minimum.Getint64() + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsUint64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + } + } + else if (maximum_.IsInt64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); // i >= 0 > maximum_ + } + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (i % multipleOf_.GetUint64() != 0) { + context.error_handler.NotMultipleOf(i, multipleOf_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + } + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckDoubleMinimum(Context& context, double d) const { + if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) { + context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + } + return true; + } + + bool CheckDoubleMaximum(Context& context, double d) const { + if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) { + context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + } + return true; + } + + bool CheckDoubleMultipleOf(Context& context, double d) const { + double a = std::abs(d), b = std::abs(multipleOf_.GetDouble()); + double q = std::floor(a / b); + double r = a - q * b; + if (r > 0.0) { + context.error_handler.NotMultipleOf(d, multipleOf_); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + } + return true; + } + + void DisallowedType(Context& context, const ValueType& actualType) const { + ErrorHandler& eh = context.error_handler; + eh.StartDisallowedType(); + + if (type_ & (1 << kNullSchemaType)) eh.AddExpectedType(GetNullString()); + if (type_ & (1 << kBooleanSchemaType)) eh.AddExpectedType(GetBooleanString()); + if (type_ & (1 << kObjectSchemaType)) eh.AddExpectedType(GetObjectString()); + if (type_ & (1 << kArraySchemaType)) eh.AddExpectedType(GetArrayString()); + if (type_ & (1 << kStringSchemaType)) eh.AddExpectedType(GetStringString()); + + if (type_ & (1 << kNumberSchemaType)) eh.AddExpectedType(GetNumberString()); + else if (type_ & (1 << kIntegerSchemaType)) eh.AddExpectedType(GetIntegerString()); + + eh.EndDisallowedType(actualType); + } + + struct Property { + Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {} + ~Property() { AllocatorType::Free(dependencies); } + SValue name; + const SchemaType* schema; + const SchemaType* dependenciesSchema; + SizeType dependenciesValidatorIndex; + bool* dependencies; + bool required; + }; + + struct PatternProperty { + PatternProperty() : schema(), pattern() {} + ~PatternProperty() { + if (pattern) { + pattern->~RegexType(); + AllocatorType::Free(pattern); + } + } + const SchemaType* schema; + RegexType* pattern; + }; + + AllocatorType* allocator_; + SValue uri_; + PointerType pointer_; + const SchemaType* typeless_; + uint64_t* enum_; + SizeType enumCount_; + SchemaArray allOf_; + SchemaArray anyOf_; + SchemaArray oneOf_; + const SchemaType* not_; + unsigned type_; // bitmask of kSchemaType + SizeType validatorCount_; + SizeType notValidatorIndex_; + + Property* properties_; + const SchemaType* additionalPropertiesSchema_; + PatternProperty* patternProperties_; + SizeType patternPropertyCount_; + SizeType propertyCount_; + SizeType minProperties_; + SizeType maxProperties_; + bool additionalProperties_; + bool hasDependencies_; + bool hasRequired_; + bool hasSchemaDependencies_; + + const SchemaType* additionalItemsSchema_; + const SchemaType* itemsList_; + const SchemaType** itemsTuple_; + SizeType itemsTupleCount_; + SizeType minItems_; + SizeType maxItems_; + bool additionalItems_; + bool uniqueItems_; + + RegexType* pattern_; + SizeType minLength_; + SizeType maxLength_; + + SValue minimum_; + SValue maximum_; + SValue multipleOf_; + bool exclusiveMinimum_; + bool exclusiveMaximum_; + + SizeType defaultValueLength_; +}; + +template +struct TokenHelper { + CEREAL_RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + *documentStack.template Push() = '/'; + char buffer[21]; + size_t length = static_cast((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); + for (size_t i = 0; i < length; i++) + *documentStack.template Push() = static_cast(buffer[i]); + } +}; + +// Partial specialized version for char to prevent buffer copying. +template +struct TokenHelper { + CEREAL_RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + if (sizeof(SizeType) == 4) { + char *buffer = documentStack.template Push(1 + 10); // '/' + uint + *buffer++ = '/'; + const char* end = internal::u32toa(index, buffer); + documentStack.template Pop(static_cast(10 - (end - buffer))); + } + else { + char *buffer = documentStack.template Push(1 + 20); // '/' + uint64 + *buffer++ = '/'; + const char* end = internal::u64toa(index, buffer); + documentStack.template Pop(static_cast(20 - (end - buffer))); + } + } +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// IGenericRemoteSchemaDocumentProvider + +template +class IGenericRemoteSchemaDocumentProvider { +public: + typedef typename SchemaDocumentType::Ch Ch; + + virtual ~IGenericRemoteSchemaDocumentProvider() {} + virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaDocument + +//! JSON schema document. +/*! + A JSON schema document is a compiled version of a JSON schema. + It is basically a tree of internal::Schema. + + \note This is an immutable class (i.e. its instance cannot be modified after construction). + \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding. + \tparam Allocator Allocator type for allocating memory of this document. +*/ +template +class GenericSchemaDocument { +public: + typedef ValueT ValueType; + typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProviderType; + typedef Allocator AllocatorType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef internal::Schema SchemaType; + typedef GenericPointer PointerType; + typedef GenericValue URIType; + friend class internal::Schema; + template + friend class GenericSchemaValidator; + + //! Constructor. + /*! + Compile a JSON document into schema document. + + \param document A JSON document as source. + \param uri The base URI of this schema document for purposes of violation reporting. + \param uriLength Length of \c name, in code points. + \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null. + \param allocator An optional allocator instance for allocating memory. Can be null. + */ + explicit GenericSchemaDocument(const ValueType& document, const Ch* uri = 0, SizeType uriLength = 0, + IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) : + remoteProvider_(remoteProvider), + allocator_(allocator), + ownAllocator_(), + root_(), + typeless_(), + schemaMap_(allocator, kInitialSchemaMapSize), + schemaRef_(allocator, kInitialSchemaRefSize) + { + if (!allocator_) + ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); + + Ch noUri[1] = {0}; + uri_.SetString(uri ? uri : noUri, uriLength, *allocator_); + + typeless_ = static_cast(allocator_->Malloc(sizeof(SchemaType))); + new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), allocator_); + + // Generate root schema, it will call CreateSchema() to create sub-schemas, + // And call AddRefSchema() if there are $ref. + CreateSchemaRecursive(&root_, PointerType(), document, document); + + // Resolve $ref + while (!schemaRef_.Empty()) { + SchemaRefEntry* refEntry = schemaRef_.template Pop(1); + if (const SchemaType* s = GetSchema(refEntry->target)) { + if (refEntry->schema) + *refEntry->schema = s; + + // Create entry in map if not exist + if (!GetSchema(refEntry->source)) { + new (schemaMap_.template Push()) SchemaEntry(refEntry->source, const_cast(s), false, allocator_); + } + } + else if (refEntry->schema) + *refEntry->schema = typeless_; + + refEntry->~SchemaRefEntry(); + } + + CEREAL_RAPIDJSON_ASSERT(root_ != 0); + + schemaRef_.ShrinkToFit(); // Deallocate all memory for ref + } + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericSchemaDocument(GenericSchemaDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT : + remoteProvider_(rhs.remoteProvider_), + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + root_(rhs.root_), + typeless_(rhs.typeless_), + schemaMap_(std::move(rhs.schemaMap_)), + schemaRef_(std::move(rhs.schemaRef_)), + uri_(std::move(rhs.uri_)) + { + rhs.remoteProvider_ = 0; + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.typeless_ = 0; + } +#endif + + //! Destructor + ~GenericSchemaDocument() { + while (!schemaMap_.Empty()) + schemaMap_.template Pop(1)->~SchemaEntry(); + + if (typeless_) { + typeless_->~SchemaType(); + Allocator::Free(typeless_); + } + + CEREAL_RAPIDJSON_DELETE(ownAllocator_); + } + + const URIType& GetURI() const { return uri_; } + + //! Get the root schema. + const SchemaType& GetRoot() const { return *root_; } + +private: + //! Prohibit copying + GenericSchemaDocument(const GenericSchemaDocument&); + //! Prohibit assignment + GenericSchemaDocument& operator=(const GenericSchemaDocument&); + + struct SchemaRefEntry { + SchemaRefEntry(const PointerType& s, const PointerType& t, const SchemaType** outSchema, Allocator *allocator) : source(s, allocator), target(t, allocator), schema(outSchema) {} + PointerType source; + PointerType target; + const SchemaType** schema; + }; + + struct SchemaEntry { + SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {} + ~SchemaEntry() { + if (owned) { + schema->~SchemaType(); + Allocator::Free(schema); + } + } + PointerType pointer; + SchemaType* schema; + bool owned; + }; + + void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { + if (schema) + *schema = typeless_; + + if (v.GetType() == kObjectType) { + const SchemaType* s = GetSchema(pointer); + if (!s) + CreateSchema(schema, pointer, v, document); + + for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) + CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document); + } + else if (v.GetType() == kArrayType) + for (SizeType i = 0; i < v.Size(); i++) + CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document); + } + + void CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { + CEREAL_RAPIDJSON_ASSERT(pointer.IsValid()); + if (v.IsObject()) { + if (!HandleRefSchema(pointer, schema, v, document)) { + SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_); + new (schemaMap_.template Push()) SchemaEntry(pointer, s, true, allocator_); + if (schema) + *schema = s; + } + } + } + + bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document) { + static const Ch kRefString[] = { '$', 'r', 'e', 'f', '\0' }; + static const ValueType kRefValue(kRefString, 4); + + typename ValueType::ConstMemberIterator itr = v.FindMember(kRefValue); + if (itr == v.MemberEnd()) + return false; + + if (itr->value.IsString()) { + SizeType len = itr->value.GetStringLength(); + if (len > 0) { + const Ch* s = itr->value.GetString(); + SizeType i = 0; + while (i < len && s[i] != '#') // Find the first # + i++; + + if (i > 0) { // Remote reference, resolve immediately + if (remoteProvider_) { + if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i)) { + PointerType pointer(&s[i], len - i, allocator_); + if (pointer.IsValid()) { + if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) { + if (schema) + *schema = sc; + new (schemaMap_.template Push()) SchemaEntry(source, const_cast(sc), false, allocator_); + return true; + } + } + } + } + } + else if (s[i] == '#') { // Local reference, defer resolution + PointerType pointer(&s[i], len - i, allocator_); + if (pointer.IsValid()) { + if (const ValueType* nv = pointer.Get(document)) + if (HandleRefSchema(source, schema, *nv, document)) + return true; + + new (schemaRef_.template Push()) SchemaRefEntry(source, pointer, schema, allocator_); + return true; + } + } + } + } + return false; + } + + const SchemaType* GetSchema(const PointerType& pointer) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (pointer == target->pointer) + return target->schema; + return 0; + } + + PointerType GetPointer(const SchemaType* schema) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (schema == target->schema) + return target->pointer; + return PointerType(); + } + + const SchemaType* GetTypeless() const { return typeless_; } + + static const size_t kInitialSchemaMapSize = 64; + static const size_t kInitialSchemaRefSize = 64; + + IRemoteSchemaDocumentProviderType* remoteProvider_; + Allocator *allocator_; + Allocator *ownAllocator_; + const SchemaType* root_; //!< Root schema. + SchemaType* typeless_; + internal::Stack schemaMap_; // Stores created Pointer -> Schemas + internal::Stack schemaRef_; // Stores Pointer from $ref and schema which holds the $ref + URIType uri_; +}; + +//! GenericSchemaDocument using Value type. +typedef GenericSchemaDocument SchemaDocument; +//! IGenericRemoteSchemaDocumentProvider using SchemaDocument. +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaValidator + +//! JSON Schema Validator. +/*! + A SAX style JSON schema validator. + It uses a \c GenericSchemaDocument to validate SAX events. + It delegates the incoming SAX events to an output handler. + The default output handler does nothing. + It can be reused multiple times by calling \c Reset(). + + \tparam SchemaDocumentType Type of schema document. + \tparam OutputHandler Type of output handler. Default handler does nothing. + \tparam StateAllocator Allocator for storing the internal validation states. +*/ +template < + typename SchemaDocumentType, + typename OutputHandler = BaseReaderHandler, + typename StateAllocator = CrtAllocator> +class GenericSchemaValidator : + public internal::ISchemaStateFactory, + public internal::ISchemaValidator, + public internal::IValidationErrorHandler +{ +public: + typedef typename SchemaDocumentType::SchemaType SchemaType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename SchemaType::EncodingType EncodingType; + typedef typename SchemaType::SValue SValue; + typedef typename EncodingType::Ch Ch; + typedef GenericStringRef StringRefType; + typedef GenericValue ValueType; + + //! Constructor without output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(0), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true) +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Constructor with output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + OutputHandler& outputHandler, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(&outputHandler), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true) +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Destructor. + ~GenericSchemaValidator() { + Reset(); + CEREAL_RAPIDJSON_DELETE(ownStateAllocator_); + } + + //! Reset the internal states. + void Reset() { + while (!schemaStack_.Empty()) + PopSchema(); + documentStack_.Clear(); + error_.SetObject(); + currentError_.SetNull(); + missingDependents_.SetNull(); + valid_ = true; + } + + //! Checks whether the current state is valid. + // Implementation of ISchemaValidator + virtual bool IsValid() const { return valid_; } + + //! Gets the error object. + ValueType& GetError() { return error_; } + const ValueType& GetError() const { return error_; } + + //! Gets the JSON pointer pointed to the invalid schema. + PointerType GetInvalidSchemaPointer() const { + return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer(); + } + + //! Gets the keyword of invalid schema. + const Ch* GetInvalidSchemaKeyword() const { + return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword; + } + + //! Gets the JSON pointer pointed to the invalid value. + PointerType GetInvalidDocumentPointer() const { + if (documentStack_.Empty()) { + return PointerType(); + } + else { + return PointerType(documentStack_.template Bottom(), documentStack_.GetSize() / sizeof(Ch)); + } + } + + void NotMultipleOf(int64_t actual, const SValue& expected) { + AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); + } + void NotMultipleOf(uint64_t actual, const SValue& expected) { + AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); + } + void NotMultipleOf(double actual, const SValue& expected) { + AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); + } + void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void AboveMaximum(double actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + void BelowMinimum(double actual, const SValue& expected, bool exclusive) { + AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + + void TooLong(const Ch* str, SizeType length, SizeType expected) { + AddNumberError(SchemaType::GetMaxLengthString(), + ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); + } + void TooShort(const Ch* str, SizeType length, SizeType expected) { + AddNumberError(SchemaType::GetMinLengthString(), + ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); + } + void DoesNotMatch(const Ch* str, SizeType length) { + currentError_.SetObject(); + currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator()); + AddCurrentError(SchemaType::GetPatternString()); + } + + void DisallowedItem(SizeType index) { + currentError_.SetObject(); + currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator()); + AddCurrentError(SchemaType::GetAdditionalItemsString(), true); + } + void TooFewItems(SizeType actualCount, SizeType expectedCount) { + AddNumberError(SchemaType::GetMinItemsString(), + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void TooManyItems(SizeType actualCount, SizeType expectedCount) { + AddNumberError(SchemaType::GetMaxItemsString(), + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void DuplicateItems(SizeType index1, SizeType index2) { + ValueType duplicates(kArrayType); + duplicates.PushBack(index1, GetStateAllocator()); + duplicates.PushBack(index2, GetStateAllocator()); + currentError_.SetObject(); + currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator()); + AddCurrentError(SchemaType::GetUniqueItemsString(), true); + } + + void TooManyProperties(SizeType actualCount, SizeType expectedCount) { + AddNumberError(SchemaType::GetMaxPropertiesString(), + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void TooFewProperties(SizeType actualCount, SizeType expectedCount) { + AddNumberError(SchemaType::GetMinPropertiesString(), + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void StartMissingProperties() { + currentError_.SetArray(); + } + void AddMissingProperty(const SValue& name) { + currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator()); + } + bool EndMissingProperties() { + if (currentError_.Empty()) + return false; + ValueType error(kObjectType); + error.AddMember(GetMissingString(), currentError_, GetStateAllocator()); + currentError_ = error; + AddCurrentError(SchemaType::GetRequiredString()); + return true; + } + void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) { + for (SizeType i = 0; i < count; ++i) + MergeError(static_cast(subvalidators[i])->GetError()); + } + void DisallowedProperty(const Ch* name, SizeType length) { + currentError_.SetObject(); + currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator()); + AddCurrentError(SchemaType::GetAdditionalPropertiesString(), true); + } + + void StartDependencyErrors() { + currentError_.SetObject(); + } + void StartMissingDependentProperties() { + missingDependents_.SetArray(); + } + void AddMissingDependentProperty(const SValue& targetName) { + missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator()); + } + void EndMissingDependentProperties(const SValue& sourceName) { + if (!missingDependents_.Empty()) + currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), + missingDependents_, GetStateAllocator()); + } + void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) { + currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), + static_cast(subvalidator)->GetError(), GetStateAllocator()); + } + bool EndDependencyErrors() { + if (currentError_.ObjectEmpty()) + return false; + ValueType error(kObjectType); + error.AddMember(GetErrorsString(), currentError_, GetStateAllocator()); + currentError_ = error; + AddCurrentError(SchemaType::GetDependenciesString()); + return true; + } + + void DisallowedValue() { + currentError_.SetObject(); + AddCurrentError(SchemaType::GetEnumString()); + } + void StartDisallowedType() { + currentError_.SetArray(); + } + void AddExpectedType(const typename SchemaType::ValueType& expectedType) { + currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator()); + } + void EndDisallowedType(const typename SchemaType::ValueType& actualType) { + ValueType error(kObjectType); + error.AddMember(GetExpectedString(), currentError_, GetStateAllocator()); + error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator()); + currentError_ = error; + AddCurrentError(SchemaType::GetTypeString()); + } + void NotAllOf(ISchemaValidator** subvalidators, SizeType count) { + for (SizeType i = 0; i < count; ++i) { + MergeError(static_cast(subvalidators[i])->GetError()); + } + } + void NoneOf(ISchemaValidator** subvalidators, SizeType count) { + AddErrorArray(SchemaType::GetAnyOfString(), subvalidators, count); + } + void NotOneOf(ISchemaValidator** subvalidators, SizeType count) { + AddErrorArray(SchemaType::GetOneOfString(), subvalidators, count); + } + void Disallowed() { + currentError_.SetObject(); + AddCurrentError(SchemaType::GetNotString()); + } + +#define CEREAL_RAPIDJSON_STRING_(name, ...) \ + static const StringRefType& Get##name##String() {\ + static const Ch s[] = { __VA_ARGS__, '\0' };\ + static const StringRefType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1)); \ + return v;\ + } + + CEREAL_RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f') + CEREAL_RAPIDJSON_STRING_(SchemaRef, 's', 'c', 'h', 'e', 'm', 'a', 'R', 'e', 'f') + CEREAL_RAPIDJSON_STRING_(Expected, 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd') + CEREAL_RAPIDJSON_STRING_(Actual, 'a', 'c', 't', 'u', 'a', 'l') + CEREAL_RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd') + CEREAL_RAPIDJSON_STRING_(Missing, 'm', 'i', 's', 's', 'i', 'n', 'g') + CEREAL_RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's') + CEREAL_RAPIDJSON_STRING_(Duplicates, 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', 's') + +#undef CEREAL_RAPIDJSON_STRING_ + +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \ +CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN\ + *documentStack_.template Push() = '\0';\ + documentStack_.template Pop(1);\ + internal::PrintInvalidDocument(documentStack_.template Bottom());\ +CEREAL_RAPIDJSON_MULTILINEMACRO_END +#else +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() +#endif + +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\ + if (!valid_) return false; \ + if (!BeginValue() || !CurrentSchema().method arg1) {\ + CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\ + return valid_ = false;\ + } + +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\ + for (Context* context = schemaStack_.template Bottom(); context != schemaStack_.template End(); context++) {\ + if (context->hasher)\ + static_cast(context->hasher)->method arg2;\ + if (context->validators)\ + for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\ + static_cast(context->validators[i_])->method arg2;\ + if (context->patternPropertiesValidators)\ + for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\ + static_cast(context->patternPropertiesValidators[i_])->method arg2;\ + } + +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\ + return valid_ = EndValue() && (!outputHandler_ || outputHandler_->method arg2) + +#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \ + CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\ + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\ + CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2) + + bool Null() { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext()), ( )); } + bool Bool(bool b) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); } + bool Int(int i) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); } + bool Uint(unsigned u) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); } + bool Int64(int64_t i) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); } + bool Uint64(uint64_t u) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); } + bool Double(double d) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); } + bool RawNumber(const Ch* str, SizeType length, bool copy) + { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + bool String(const Ch* str, SizeType length, bool copy) + { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + + bool StartObject() { + CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext())); + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ()); + return valid_ = !outputHandler_ || outputHandler_->StartObject(); + } + + bool Key(const Ch* str, SizeType len, bool copy) { + if (!valid_) return false; + AppendToken(str, len); + if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false; + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy)); + return valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy); + } + + bool EndObject(SizeType memberCount) { + if (!valid_) return false; + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount)); + if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false; + CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount)); + } + + bool StartArray() { + CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext())); + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ()); + return valid_ = !outputHandler_ || outputHandler_->StartArray(); + } + + bool EndArray(SizeType elementCount) { + if (!valid_) return false; + CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount)); + if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false; + CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount)); + } + +#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_ +#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_ +#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ +#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_ + + // Implementation of ISchemaStateFactory + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root) { + return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom(), documentStack_.GetSize(), +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + depth_ + 1, +#endif + &GetStateAllocator()); + } + + virtual void DestroySchemaValidator(ISchemaValidator* validator) { + GenericSchemaValidator* v = static_cast(validator); + v->~GenericSchemaValidator(); + StateAllocator::Free(v); + } + + virtual void* CreateHasher() { + return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator()); + } + + virtual uint64_t GetHashCode(void* hasher) { + return static_cast(hasher)->GetHashCode(); + } + + virtual void DestroryHasher(void* hasher) { + HasherType* h = static_cast(hasher); + h->~HasherType(); + StateAllocator::Free(h); + } + + virtual void* MallocState(size_t size) { + return GetStateAllocator().Malloc(size); + } + + virtual void FreeState(void* p) { + StateAllocator::Free(p); + } + +private: + typedef typename SchemaType::Context Context; + typedef GenericValue, StateAllocator> HashCodeArray; + typedef internal::Hasher HasherType; + + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + const SchemaType& root, + const char* basePath, size_t basePathSize, +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + unsigned depth, +#endif + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(root), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(0), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true) +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + , depth_(depth) +#endif + { + if (basePath && basePathSize) + memcpy(documentStack_.template Push(basePathSize), basePath, basePathSize); + } + + StateAllocator& GetStateAllocator() { + if (!stateAllocator_) + stateAllocator_ = ownStateAllocator_ = CEREAL_RAPIDJSON_NEW(StateAllocator)(); + return *stateAllocator_; + } + + bool BeginValue() { + if (schemaStack_.Empty()) + PushSchema(root_); + else { + if (CurrentContext().inArray) + internal::TokenHelper, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex); + + if (!CurrentSchema().BeginValue(CurrentContext())) + return false; + + SizeType count = CurrentContext().patternPropertiesSchemaCount; + const SchemaType** sa = CurrentContext().patternPropertiesSchemas; + typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType; + bool valueUniqueness = CurrentContext().valueUniqueness; + CEREAL_RAPIDJSON_ASSERT(CurrentContext().valueSchema); + PushSchema(*CurrentContext().valueSchema); + + if (count > 0) { + CurrentContext().objectPatternValidatorType = patternValidatorType; + ISchemaValidator**& va = CurrentContext().patternPropertiesValidators; + SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount; + va = static_cast(MallocState(sizeof(ISchemaValidator*) * count)); + for (SizeType i = 0; i < count; i++) + va[validatorCount++] = CreateSchemaValidator(*sa[i]); + } + + CurrentContext().arrayUniqueness = valueUniqueness; + } + return true; + } + + bool EndValue() { + if (!CurrentSchema().EndValue(CurrentContext())) + return false; + +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + GenericStringBuffer sb; + schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb); + + *documentStack_.template Push() = '\0'; + documentStack_.template Pop(1); + internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom()); +#endif + + uint64_t h = CurrentContext().arrayUniqueness ? static_cast(CurrentContext().hasher)->GetHashCode() : 0; + + PopSchema(); + + if (!schemaStack_.Empty()) { + Context& context = CurrentContext(); + if (context.valueUniqueness) { + HashCodeArray* a = static_cast(context.arrayElementHashCodes); + if (!a) + CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType); + for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr) + if (itr->GetUint64() == h) { + DuplicateItems(static_cast(itr - a->Begin()), a->Size()); + CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString()); + } + a->PushBack(h, GetStateAllocator()); + } + } + + // Remove the last token of document pointer + while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/') + ; + + return true; + } + + void AppendToken(const Ch* str, SizeType len) { + documentStack_.template Reserve(1 + len * 2); // worst case all characters are escaped as two characters + *documentStack_.template PushUnsafe() = '/'; + for (SizeType i = 0; i < len; i++) { + if (str[i] == '~') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '0'; + } + else if (str[i] == '/') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '1'; + } + else + *documentStack_.template PushUnsafe() = str[i]; + } + } + + CEREAL_RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push()) Context(*this, *this, &schema); } + + CEREAL_RAPIDJSON_FORCEINLINE void PopSchema() { + Context* c = schemaStack_.template Pop(1); + if (HashCodeArray* a = static_cast(c->arrayElementHashCodes)) { + a->~HashCodeArray(); + StateAllocator::Free(a); + } + c->~Context(); + } + + void AddErrorLocation(ValueType& result, bool parent) { + GenericStringBuffer sb; + PointerType instancePointer = GetInvalidDocumentPointer(); + ((parent && instancePointer.GetTokenCount() > 0) + ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1) + : instancePointer).StringifyUriFragment(sb); + ValueType instanceRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), + GetStateAllocator()); + result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator()); + sb.Clear(); + memcpy(sb.Push(CurrentSchema().GetURI().GetStringLength()), + CurrentSchema().GetURI().GetString(), + CurrentSchema().GetURI().GetStringLength() * sizeof(Ch)); + GetInvalidSchemaPointer().StringifyUriFragment(sb); + ValueType schemaRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), + GetStateAllocator()); + result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator()); + } + + void AddError(ValueType& keyword, ValueType& error) { + typename ValueType::MemberIterator member = error_.FindMember(keyword); + if (member == error_.MemberEnd()) + error_.AddMember(keyword, error, GetStateAllocator()); + else { + if (member->value.IsObject()) { + ValueType errors(kArrayType); + errors.PushBack(member->value, GetStateAllocator()); + member->value = errors; + } + member->value.PushBack(error, GetStateAllocator()); + } + } + + void AddCurrentError(const typename SchemaType::ValueType& keyword, bool parent = false) { + AddErrorLocation(currentError_, parent); + AddError(ValueType(keyword, GetStateAllocator(), false).Move(), currentError_); + } + + void MergeError(ValueType& other) { + for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) { + AddError(it->name, it->value); + } + } + + void AddNumberError(const typename SchemaType::ValueType& keyword, ValueType& actual, const SValue& expected, + const typename SchemaType::ValueType& (*exclusive)() = 0) { + currentError_.SetObject(); + currentError_.AddMember(GetActualString(), actual, GetStateAllocator()); + currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator()); + if (exclusive) + currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator()); + AddCurrentError(keyword); + } + + void AddErrorArray(const typename SchemaType::ValueType& keyword, + ISchemaValidator** subvalidators, SizeType count) { + ValueType errors(kArrayType); + for (SizeType i = 0; i < count; ++i) + errors.PushBack(static_cast(subvalidators[i])->GetError(), GetStateAllocator()); + currentError_.SetObject(); + currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator()); + AddCurrentError(keyword); + } + + const SchemaType& CurrentSchema() const { return *schemaStack_.template Top()->schema; } + Context& CurrentContext() { return *schemaStack_.template Top(); } + const Context& CurrentContext() const { return *schemaStack_.template Top(); } + + static const size_t kDefaultSchemaStackCapacity = 1024; + static const size_t kDefaultDocumentStackCapacity = 256; + const SchemaDocumentType* schemaDocument_; + const SchemaType& root_; + StateAllocator* stateAllocator_; + StateAllocator* ownStateAllocator_; + internal::Stack schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *) + internal::Stack documentStack_; //!< stack to store the current path of validating document (Ch) + OutputHandler* outputHandler_; + ValueType error_; + ValueType currentError_; + ValueType missingDependents_; + bool valid_; +#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE + unsigned depth_; +#endif +}; + +typedef GenericSchemaValidator SchemaValidator; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidatingReader + +//! A helper class for parsing with validation. +/*! + This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate(). + + \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam SourceEncoding Encoding of the input stream. + \tparam SchemaDocumentType Type of schema document. + \tparam StackAllocator Allocator type for stack. +*/ +template < + unsigned parseFlags, + typename InputStream, + typename SourceEncoding, + typename SchemaDocumentType = SchemaDocument, + typename StackAllocator = CrtAllocator> +class SchemaValidatingReader { +public: + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename InputStream::Ch Ch; + typedef GenericValue ValueType; + + //! Constructor + /*! + \param is Input stream. + \param sd Schema document. + */ + SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), error_(kObjectType), isValid_(true) {} + + template + bool operator()(Handler& handler) { + GenericReader reader; + GenericSchemaValidator validator(sd_, handler); + parseResult_ = reader.template Parse(is_, validator); + + isValid_ = validator.IsValid(); + if (isValid_) { + invalidSchemaPointer_ = PointerType(); + invalidSchemaKeyword_ = 0; + invalidDocumentPointer_ = PointerType(); + error_.SetObject(); + } + else { + invalidSchemaPointer_ = validator.GetInvalidSchemaPointer(); + invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword(); + invalidDocumentPointer_ = validator.GetInvalidDocumentPointer(); + error_.CopyFrom(validator.GetError(), allocator_); + } + + return parseResult_; + } + + const ParseResult& GetParseResult() const { return parseResult_; } + bool IsValid() const { return isValid_; } + const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; } + const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; } + const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; } + const ValueType& GetError() const { return error_; } + +private: + InputStream& is_; + const SchemaDocumentType& sd_; + + ParseResult parseResult_; + PointerType invalidSchemaPointer_; + const Ch* invalidSchemaKeyword_; + PointerType invalidDocumentPointer_; + StackAllocator allocator_; + ValueType error_; + bool isValid_; +}; + +CEREAL_RAPIDJSON_NAMESPACE_END +CEREAL_RAPIDJSON_DIAG_POP + +#endif // CEREAL_RAPIDJSON_SCHEMA_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h new file mode 100644 index 000000000..abc0153b7 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h @@ -0,0 +1,223 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include "rapidjson.h" + +#ifndef CEREAL_RAPIDJSON_STREAM_H_ +#define CEREAL_RAPIDJSON_STREAM_H_ + +#include "encodings.h" + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Stream + +/*! \class rapidjson::Stream + \brief Concept for reading and writing characters. + + For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). + + For write-only stream, only need to implement Put() and Flush(). + +\code +concept Stream { + typename Ch; //!< Character type of the stream. + + //! Read the current character from stream without moving the read cursor. + Ch Peek() const; + + //! Read the current character from stream and moving the read cursor to next character. + Ch Take(); + + //! Get the current read cursor. + //! \return Number of characters read from start. + size_t Tell(); + + //! Begin writing operation at the current read pointer. + //! \return The begin writer pointer. + Ch* PutBegin(); + + //! Write a character. + void Put(Ch c); + + //! Flush the buffer. + void Flush(); + + //! End the writing operation. + //! \param begin The begin write pointer returned by PutBegin(). + //! \return Number of characters written. + size_t PutEnd(Ch* begin); +} +\endcode +*/ + +//! Provides additional information for stream. +/*! + By using traits pattern, this type provides a default configuration for stream. + For custom stream, this type can be specialized for other configuration. + See TEST(Reader, CustomStringStream) in readertest.cpp for example. +*/ +template +struct StreamTraits { + //! Whether to make local copy of stream for optimization during parsing. + /*! + By default, for safety, streams do not use local copy optimization. + Stream that can be copied fast should specialize this, like StreamTraits. + */ + enum { copyOptimization = 0 }; +}; + +//! Reserve n characters for writing to a stream. +template +inline void PutReserve(Stream& stream, size_t count) { + (void)stream; + (void)count; +} + +//! Write character to a stream, presuming buffer is reserved. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { + stream.Put(c); +} + +//! Put N copies of a character to a stream. +template +inline void PutN(Stream& stream, Ch c, size_t n) { + PutReserve(stream, n); + for (size_t i = 0; i < n; i++) + PutUnsafe(stream, c); +} + +/////////////////////////////////////////////////////////////////////////////// +// GenericStreamWrapper + +//! A Stream Wrapper +/*! \tThis string stream is a wrapper for any stream by just forwarding any + \treceived message to the origin stream. + \note implements Stream concept +*/ + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code +CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +template > +class GenericStreamWrapper { +public: + typedef typename Encoding::Ch Ch; + GenericStreamWrapper(InputStream& is): is_(is) {} + + Ch Peek() const { return is_.Peek(); } + Ch Take() { return is_.Take(); } + size_t Tell() { return is_.Tell(); } + Ch* PutBegin() { return is_.PutBegin(); } + void Put(Ch ch) { is_.Put(ch); } + void Flush() { is_.Flush(); } + size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); } + + // wrapper for MemoryStream + const Ch* Peek4() const { return is_.Peek4(); } + + // wrapper for AutoUTFInputStream + UTFType GetType() const { return is_.GetType(); } + bool HasBOM() const { return is_.HasBOM(); } + +protected: + InputStream& is_; +}; + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +CEREAL_RAPIDJSON_DIAG_POP +#endif + +/////////////////////////////////////////////////////////////////////////////// +// StringStream + +//! Read-only string stream. +/*! \note implements Stream concept +*/ +template +struct GenericStringStream { + typedef typename Encoding::Ch Ch; + + GenericStringStream(const Ch *src) : src_(src), head_(src) {} + + Ch Peek() const { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() const { return static_cast(src_ - head_); } + + Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } + void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } + + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! String stream with UTF8 encoding. +typedef GenericStringStream > StringStream; + +/////////////////////////////////////////////////////////////////////////////// +// InsituStringStream + +//! A read-write string stream. +/*! This string stream is particularly designed for in-situ parsing. + \note implements Stream concept +*/ +template +struct GenericInsituStringStream { + typedef typename Encoding::Ch Ch; + + GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} + + // Read + Ch Peek() { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() { return static_cast(src_ - head_); } + + // Write + void Put(Ch c) { CEREAL_RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } + + Ch* PutBegin() { return dst_ = src_; } + size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } + void Flush() {} + + Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } + void Pop(size_t count) { dst_ -= count; } + + Ch* src_; + Ch* dst_; + Ch* head_; +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! Insitu string stream with UTF8 encoding. +typedef GenericInsituStringStream > InsituStringStream; + +CEREAL_RAPIDJSON_NAMESPACE_END + +#endif // CEREAL_RAPIDJSON_STREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h new file mode 100644 index 000000000..d010477ab --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h @@ -0,0 +1,121 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_STRINGBUFFER_H_ +#define CEREAL_RAPIDJSON_STRINGBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +#include "internal/stack.h" + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output stream. +/*! + \tparam Encoding Encoding of the stream. + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +class GenericStringBuffer { +public: + typedef typename Encoding::Ch Ch; + + GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} + GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { + if (&rhs != this) + stack_ = std::move(rhs.stack_); + return *this; + } +#endif + + void Put(Ch c) { *stack_.template Push() = c; } + void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.ShrinkToFit(); + stack_.template Pop(1); + } + + void Reserve(size_t count) { stack_.template Reserve(count); } + Ch* Push(size_t count) { return stack_.template Push(count); } + Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetString() const { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.template Pop(1); + + return stack_.template Bottom(); + } + + //! Get the size of string in bytes in the string buffer. + size_t GetSize() const { return stack_.GetSize(); } + + //! Get the length of string in Ch in the string buffer. + size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; + +private: + // Prohibit copy constructor & assignment operator. + GenericStringBuffer(const GenericStringBuffer&); + GenericStringBuffer& operator=(const GenericStringBuffer&); +}; + +//! String buffer with UTF8 encoding +typedef GenericStringBuffer > StringBuffer; + +template +inline void PutReserve(GenericStringBuffer& stream, size_t count) { + stream.Reserve(count); +} + +template +inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { + stream.PutUnsafe(c); +} + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { + std::memset(stream.stack_.Push(n), c, n * sizeof(c)); +} + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_STRINGBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h new file mode 100644 index 000000000..b8da773e9 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h @@ -0,0 +1,709 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef CEREAL_RAPIDJSON_WRITER_H_ +#define CEREAL_RAPIDJSON_WRITER_H_ + +#include "stream.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strfunc.h" +#include "internal/dtoa.h" +#include "internal/itoa.h" +#include "stringbuffer.h" +#include // placement new + +#if defined(CEREAL_RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef CEREAL_RAPIDJSON_SSE42 +#include +#elif defined(CEREAL_RAPIDJSON_SSE2) +#include +#elif defined(CEREAL_RAPIDJSON_NEON) +#include +#endif + +#ifdef __clang__ +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(padded) +CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) +CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) +#elif defined(_MSC_VER) +CEREAL_RAPIDJSON_DIAG_PUSH +CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +#endif + +CEREAL_RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// WriteFlag + +/*! \def CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS + \ingroup CEREAL_RAPIDJSON_CONFIG + \brief User-defined kWriteDefaultFlags definition. + + User can define this as any \c WriteFlag combinations. +*/ +#ifndef CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS +#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags +#endif + +//! Combination of writeFlags +enum WriteFlag { + kWriteNoFlags = 0, //!< No flags are set. + kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings. + kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN. + kWriteDefaultFlags = CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS +}; + +//! JSON writer +/*! Writer implements the concept Handler. + It generates JSON text by events to an output os. + + User may programmatically calls the functions of a writer to generate JSON text. + + On the other side, a writer can also be passed to objects that generates events, + + for example Reader::Parse() and Document::Accept(). + + \tparam OutputStream Type of output stream. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. + \note implements Handler concept +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class Writer { +public: + typedef typename SourceEncoding::Ch Ch; + + static const int kDefaultMaxDecimalPlaces = 324; + + //! Constructor + /*! \param os Output stream. + \param stackAllocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit + Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + + explicit + Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + +#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS + Writer(Writer&& rhs) : + os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) { + rhs.os_ = 0; + } +#endif + + //! Reset the writer with a new stream. + /*! + This function reset the writer with a new stream and default settings, + in order to make a Writer object reusable for output multiple JSONs. + + \param os New output stream. + \code + Writer writer(os1); + writer.StartObject(); + // ... + writer.EndObject(); + + writer.Reset(os2); + writer.StartObject(); + // ... + writer.EndObject(); + \endcode + */ + void Reset(OutputStream& os) { + os_ = &os; + hasRoot_ = false; + level_stack_.Clear(); + } + + //! Checks whether the output is a complete JSON. + /*! + A complete JSON has a complete root object or array. + */ + bool IsComplete() const { + return hasRoot_ && level_stack_.Empty(); + } + + int GetMaxDecimalPlaces() const { + return maxDecimalPlaces_; + } + + //! Sets the maximum number of decimal places for double output. + /*! + This setting truncates the output with specified number of decimal places. + + For example, + + \code + writer.SetMaxDecimalPlaces(3); + writer.StartArray(); + writer.Double(0.12345); // "0.123" + writer.Double(0.0001); // "0.0" + writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent) + writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent) + writer.EndArray(); + \endcode + + The default setting does not truncate any decimal places. You can restore to this setting by calling + \code + writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces); + \endcode + */ + void SetMaxDecimalPlaces(int maxDecimalPlaces) { + maxDecimalPlaces_ = maxDecimalPlaces; + } + + /*!@name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { Prefix(kNullType); return EndValue(WriteNull()); } + bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); } + bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); } + bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); } + bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); } + bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); } + + //! Writes the given \c double value to the stream + /*! + \param d The value to be written. + \return Whether it is succeed. + */ + bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + CEREAL_RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kNumberType); + return EndValue(WriteString(str, length)); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + CEREAL_RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kStringType); + return EndValue(WriteString(str, length)); + } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + Prefix(kObjectType); + new (level_stack_.template Push()) Level(false); + return WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if CEREAL_RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) + { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + CEREAL_RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object + CEREAL_RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); // currently inside an Array, not Object + CEREAL_RAPIDJSON_ASSERT(0 == level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + level_stack_.template Pop(1); + return EndValue(WriteEndObject()); + } + + bool StartArray() { + Prefix(kArrayType); + new (level_stack_.template Push()) Level(true); + return WriteStartArray(); + } + + bool EndArray(SizeType elementCount = 0) { + (void)elementCount; + CEREAL_RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); + CEREAL_RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); + level_stack_.template Pop(1); + return EndValue(WriteEndArray()); + } + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + CEREAL_RAPIDJSON_ASSERT(json != 0); + Prefix(type); + return EndValue(WriteRawValue(json, length)); + } + + //! Flush the output stream. + /*! + Allows the user to flush the output stream immediately. + */ + void Flush() { + os_->Flush(); + } + +protected: + //! Information for each nested level + struct Level { + Level(bool inArray_) : valueCount(0), inArray(inArray_) {} + size_t valueCount; //!< number of values in this level + bool inArray; //!< true if in array, otherwise in object + }; + + static const size_t kDefaultLevelDepth = 32; + + bool WriteNull() { + PutReserve(*os_, 4); + PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true; + } + + bool WriteBool(bool b) { + if (b) { + PutReserve(*os_, 4); + PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e'); + } + else { + PutReserve(*os_, 5); + PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e'); + } + return true; + } + + bool WriteInt(int i) { + char buffer[11]; + const char* end = internal::i32toa(i, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint(unsigned u) { + char buffer[10]; + const char* end = internal::u32toa(u, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteInt64(int64_t i64) { + char buffer[21]; + const char* end = internal::i64toa(i64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint64(uint64_t u64) { + char buffer[20]; + char* end = internal::u64toa(u64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + if (!(writeFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char buffer[25]; + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteString(const Ch* str, SizeType length) { + static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + static const char escape[256] = { +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + //0 1 2 3 4 5 6 7 8 9 A B C D E F + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 + 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 + Z16, Z16, // 30~4F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF +#undef Z16 + }; + + if (TargetEncoding::supportUnicode) + PutReserve(*os_, 2 + length * 6); // "\uxxxx..." + else + PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..." + + PutUnsafe(*os_, '\"'); + GenericStringStream is(str); + while (ScanWriteUnescapedString(is, length)) { + const Ch c = is.Peek(); + if (!TargetEncoding::supportUnicode && static_cast(c) >= 0x80) { + // Unicode escaping + unsigned codepoint; + if (CEREAL_RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint))) + return false; + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { + PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint ) & 15]); + } + else { + CEREAL_RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); + // Surrogate pair + unsigned s = codepoint - 0x010000; + unsigned lead = (s >> 10) + 0xD800; + unsigned trail = (s & 0x3FF) + 0xDC00; + PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(lead ) & 15]); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(trail ) & 15]); + } + } + else if ((sizeof(Ch) == 1 || static_cast(c) < 256) && CEREAL_RAPIDJSON_UNLIKELY(escape[static_cast(c)])) { + is.Take(); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, static_cast(escape[static_cast(c)])); + if (escape[static_cast(c)] == 'u') { + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, hexDigits[static_cast(c) >> 4]); + PutUnsafe(*os_, hexDigits[static_cast(c) & 0xF]); + } + } + else if (CEREAL_RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? + Transcoder::Validate(is, *os_) : + Transcoder::TranscodeUnsafe(is, *os_)))) + return false; + } + PutUnsafe(*os_, '\"'); + return true; + } + + bool ScanWriteUnescapedString(GenericStringStream& is, size_t length) { + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); + } + + bool WriteStartObject() { os_->Put('{'); return true; } + bool WriteEndObject() { os_->Put('}'); return true; } + bool WriteStartArray() { os_->Put('['); return true; } + bool WriteEndArray() { os_->Put(']'); return true; } + + bool WriteRawValue(const Ch* json, size_t length) { + PutReserve(*os_, length); + GenericStringStream is(json); + while (CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) { + CEREAL_RAPIDJSON_ASSERT(is.Peek() != '\0'); + if (CEREAL_RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? + Transcoder::Validate(is, *os_) : + Transcoder::TranscodeUnsafe(is, *os_)))) + return false; + } + return true; + } + + void Prefix(Type type) { + (void)type; + if (CEREAL_RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root + Level* level = level_stack_.template Top(); + if (level->valueCount > 0) { + if (level->inArray) + os_->Put(','); // add comma if it is not the first element in array + else // in object + os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); + } + if (!level->inArray && level->valueCount % 2 == 0) + CEREAL_RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + CEREAL_RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. + hasRoot_ = true; + } + } + + // Flush the value if it is the top level one. + bool EndValue(bool ret) { + if (CEREAL_RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text + Flush(); + return ret; + } + + OutputStream* os_; + internal::Stack level_stack_; + int maxDecimalPlaces_; + bool hasRoot_; + +private: + // Prohibit copy constructor & assignment operator. + Writer(const Writer&); + Writer& operator=(const Writer&); +}; + +// Full specialization for StringStream to prevent memory copying + +template<> +inline bool Writer::WriteInt(int i) { + char *buffer = os_->Push(11); + const char* end = internal::i32toa(i, buffer); + os_->Pop(static_cast(11 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint(unsigned u) { + char *buffer = os_->Push(10); + const char* end = internal::u32toa(u, buffer); + os_->Pop(static_cast(10 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteInt64(int64_t i64) { + char *buffer = os_->Push(21); + const char* end = internal::i64toa(i64, buffer); + os_->Pop(static_cast(21 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint64(uint64_t u) { + char *buffer = os_->Push(20); + const char* end = internal::u64toa(u, buffer); + os_->Pop(static_cast(20 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + // Note: This code path can only be reached if (CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag). + if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char *buffer = os_->Push(25); + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + os_->Pop(static_cast(25 - (end - buffer))); + return true; +} + +#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); + + if (!CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (; p != endAligned; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType len; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + len = offset; +#else + len = static_cast(__builtin_ffs(r) - 1); +#endif + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); +} +#elif defined(CEREAL_RAPIDJSON_NEON) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); + + if (!CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (; p != endAligned; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType len = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high); + len = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low); + len = lz >> 3; + escaped = true; + } + if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + vst1q_u8(reinterpret_cast(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); +} +#endif // CEREAL_RAPIDJSON_NEON + +CEREAL_RAPIDJSON_NAMESPACE_END + +#if defined(_MSC_VER) || defined(__clang__) +CEREAL_RAPIDJSON_DIAG_POP +#endif + +#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt b/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt new file mode 100644 index 000000000..0095bc72f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt @@ -0,0 +1,52 @@ +Use of this software is granted under one of the following two licenses, +to be chosen freely by the user. + +1. Boost Software License - Version 1.0 - August 17th, 2003 +=============================================================================== + +Copyright (c) 2006, 2007 Marcin Kalicinski + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +2. The MIT License +=============================================================================== + +Copyright (c) 2006, 2007 Marcin Kalicinski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html b/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html new file mode 100644 index 000000000..4e6a5f1a9 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html @@ -0,0 +1,406 @@ +

RAPIDXML Manual

Version 1.13

Copyright (C) 2006, 2009 Marcin Kalicinski
See accompanying file
license.txt for license information.

Table of Contents

1. What is RapidXml?
1.1 Dependencies And Compatibility
1.2 Character Types And Encodings
1.3 Error Handling
1.4 Memory Allocation
1.5 W3C Compliance
1.6 API Design
1.7 Reliability
1.8 Acknowledgements
2. Two Minute Tutorial
2.1 Parsing
2.2 Accessing The DOM Tree
2.3 Modifying The DOM Tree
2.4 Printing XML
3. Differences From Regular XML Parsers
3.1 Lifetime Of Source Text
3.2 Ownership Of Strings
3.3 Destructive Vs Non-Destructive Mode
4. Performance
4.1 Comparison With Other Parsers
5. Reference

1. What is RapidXml?

RapidXml is an attempt to create the fastest XML DOM parser possible, while retaining useability, portability and reasonable W3C compatibility. It is an in-situ parser written in C++, with parsing speed approaching that of strlen() function executed on the same data.

+ Entire parser is contained in a single header file, so no building or linking is neccesary. To use it you just need to copy rapidxml.hpp file to a convenient place (such as your project directory), and include it where needed. You may also want to use printing functions contained in header rapidxml_print.hpp.

1.1 Dependencies And Compatibility

RapidXml has no dependencies other than a very small subset of standard C++ library (<cassert>, <cstdlib>, <new> and <exception>, unless exceptions are disabled). It should compile on any reasonably conformant compiler, and was tested on Visual C++ 2003, Visual C++ 2005, Visual C++ 2008, gcc 3, gcc 4, and Comeau 4.3.3. Care was taken that no warnings are produced on these compilers, even with highest warning levels enabled.

1.2 Character Types And Encodings

RapidXml is character type agnostic, and can work both with narrow and wide characters. Current version does not fully support UTF-16 or UTF-32, so use of wide characters is somewhat incapacitated. However, it should succesfully parse wchar_t strings containing UTF-16 or UTF-32 if endianness of the data matches that of the machine. UTF-8 is fully supported, including all numeric character references, which are expanded into appropriate UTF-8 byte sequences (unless you enable parse_no_utf8 flag).

+ Note that RapidXml performs no decoding - strings returned by name() and value() functions will contain text encoded using the same encoding as source file. Rapidxml understands and expands the following character references: &apos; &amp; &quot; &lt; &gt; &#...; Other character references are not expanded.

1.3 Error Handling

By default, RapidXml uses C++ exceptions to report errors. If this behaviour is undesirable, RAPIDXML_NO_EXCEPTIONS can be defined to suppress exception code. See parse_error class and parse_error_handler() function for more information.

1.4 Memory Allocation

RapidXml uses a special memory pool object to allocate nodes and attributes, because direct allocation using new operator would be far too slow. Underlying memory allocations performed by the pool can be customized by use of memory_pool::set_allocator() function. See class memory_pool for more information.

1.5 W3C Compliance

RapidXml is not a W3C compliant parser, primarily because it ignores DOCTYPE declarations. There is a number of other, minor incompatibilities as well. Still, it can successfully parse and produce complete trees of all valid XML files in W3C conformance suite (over 1000 files specially designed to find flaws in XML processors). In destructive mode it performs whitespace normalization and character entity substitution for a small set of built-in entities.

1.6 API Design

RapidXml API is minimalistic, to reduce code size as much as possible, and facilitate use in embedded environments. Additional convenience functions are provided in separate headers: rapidxml_utils.hpp and rapidxml_print.hpp. Contents of these headers is not an essential part of the library, and is currently not documented (otherwise than with comments in code).

1.7 Reliability

RapidXml is very robust and comes with a large harness of unit tests. Special care has been taken to ensure stability of the parser no matter what source text is thrown at it. One of the unit tests produces 100,000 randomly corrupted variants of XML document, which (when uncorrupted) contains all constructs recognized by RapidXml. RapidXml passes this test when it correctly recognizes that errors have been introduced, and does not crash or loop indefinitely.

+ Another unit test puts RapidXml head-to-head with another, well estabilished XML parser, and verifies that their outputs match across a wide variety of small and large documents.

+ Yet another test feeds RapidXml with over 1000 test files from W3C compliance suite, and verifies that correct results are obtained. There are also additional tests that verify each API function separately, and test that various parsing modes work as expected.

1.8 Acknowledgements

I would like to thank Arseny Kapoulkine for his work on pugixml, which was an inspiration for this project. Additional thanks go to Kristen Wegner for creating pugxml, from which pugixml was derived. Janusz Wohlfeil kindly ran RapidXml speed tests on hardware that I did not have access to, allowing me to expand performance comparison table.

2. Two Minute Tutorial

2.1 Parsing

The following code causes RapidXml to parse a zero-terminated string named text:
using namespace rapidxml;
+xml_document<> doc;    // character type defaults to char
+doc.parse<0>(text);    // 0 means default parse flags
+
doc object is now a root of DOM tree containing representation of the parsed XML. Because all RapidXml interface is contained inside namespace rapidxml, users must either bring contents of this namespace into scope, or fully qualify all the names. Class xml_document represents a root of the DOM hierarchy. By means of public inheritance, it is also an xml_node and a memory_pool. Template parameter of xml_document::parse() function is used to specify parsing flags, with which you can fine-tune behaviour of the parser. Note that flags must be a compile-time constant.

2.2 Accessing The DOM Tree

To access the DOM tree, use methods of xml_node and xml_attribute classes:
cout << "Name of my first node is: " << doc.first_node()->name() << "\n";
+xml_node<> *node = doc.first_node("foobar");
+cout << "Node foobar has value " << node->value() << "\n";
+for (xml_attribute<> *attr = node->first_attribute();
+     attr; attr = attr->next_attribute())
+{
+    cout << "Node foobar has attribute " << attr->name() << " ";
+    cout << "with value " << attr->value() << "\n";
+}
+

2.3 Modifying The DOM Tree

DOM tree produced by the parser is fully modifiable. Nodes and attributes can be added/removed, and their contents changed. The below example creates a HTML document, whose sole contents is a link to google.com website:
xml_document<> doc;
+xml_node<> *node = doc.allocate_node(node_element, "a", "Google");
+doc.append_node(node);
+xml_attribute<> *attr = doc.allocate_attribute("href", "google.com");
+node->append_attribute(attr);
+
One quirk is that nodes and attributes do not own the text of their names and values. This is because normally they only store pointers to the source text. So, when assigning a new name or value to the node, care must be taken to ensure proper lifetime of the string. The easiest way to achieve it is to allocate the string from the xml_document memory pool. In the above example this is not necessary, because we are only assigning character constants. But the code below uses memory_pool::allocate_string() function to allocate node name (which will have the same lifetime as the document), and assigns it to a new node:
xml_document<> doc;
+char *node_name = doc.allocate_string(name);        // Allocate string and copy name into it
+xml_node<> *node = doc.allocate_node(node_element, node_name);  // Set node name to node_name
+
Check Reference section for description of the entire interface.

2.4 Printing XML

You can print xml_document and xml_node objects into an XML string. Use print() function or operator <<, which are defined in rapidxml_print.hpp header.
using namespace rapidxml;
+xml_document<> doc;    // character type defaults to char
+// ... some code to fill the document
+
+// Print to stream using operator <<
+std::cout << doc;   
+
+// Print to stream using print function, specifying printing flags
+print(std::cout, doc, 0);   // 0 means default printing flags
+
+// Print to string using output iterator
+std::string s;
+print(std::back_inserter(s), doc, 0);
+
+// Print to memory buffer using output iterator
+char buffer[4096];                      // You are responsible for making the buffer large enough!
+char *end = print(buffer, doc, 0);      // end contains pointer to character after last printed character
+*end = 0;                               // Add string terminator after XML
+

3. Differences From Regular XML Parsers

RapidXml is an in-situ parser, which allows it to achieve very high parsing speed. In-situ means that parser does not make copies of strings. Instead, it places pointers to the source text in the DOM hierarchy.

3.1 Lifetime Of Source Text

In-situ parsing requires that source text lives at least as long as the document object. If source text is destroyed, names and values of nodes in DOM tree will become destroyed as well. Additionally, whitespace processing, character entity translation, and zero-termination of strings require that source text be modified during parsing (but see non-destructive mode). This makes the text useless for further processing once it was parsed by RapidXml.

+ In many cases however, these are not serious issues.

3.2 Ownership Of Strings

Nodes and attributes produced by RapidXml do not own their name and value strings. They merely hold the pointers to them. This means you have to be careful when setting these values manually, by using xml_base::name(const Ch *) or xml_base::value(const Ch *) functions. Care must be taken to ensure that lifetime of the string passed is at least as long as lifetime of the node/attribute. The easiest way to achieve it is to allocate the string from memory_pool owned by the document. Use memory_pool::allocate_string() function for this purpose.

3.3 Destructive Vs Non-Destructive Mode

By default, the parser modifies source text during the parsing process. This is required to achieve character entity translation, whitespace normalization, and zero-termination of strings.

+ In some cases this behaviour may be undesirable, for example if source text resides in read only memory, or is mapped to memory directly from file. By using appropriate parser flags (parse_non_destructive), source text modifications can be disabled. However, because RapidXml does in-situ parsing, it obviously has the following side-effects:

4. Performance

RapidXml achieves its speed through use of several techniques:
  • In-situ parsing. When building DOM tree, RapidXml does not make copies of string data, such as node names and values. Instead, it stores pointers to interior of the source text.
  • Use of template metaprogramming techniques. This allows it to move much of the work to compile time. Through magic of the templates, C++ compiler generates a separate copy of parsing code for any combination of parser flags you use. In each copy, all possible decisions are made at compile time and all unused code is omitted.
  • Extensive use of lookup tables for parsing.
  • Hand-tuned C++ with profiling done on several most popular CPUs.
This results in a very small and fast code: a parser which is custom tailored to exact needs with each invocation.

4.1 Comparison With Other Parsers

The table below compares speed of RapidXml to some other parsers, and to strlen() function executed on the same data. On a modern CPU (as of 2007), you can expect parsing throughput to be close to 1 GB/s. As a rule of thumb, parsing speed is about 50-100x faster than Xerces DOM, 30-60x faster than TinyXml, 3-12x faster than pugxml, and about 5% - 30% faster than pugixml, the fastest XML parser I know of.
  • The test file is a real-world, 50kB large, moderately dense XML file.
  • All timing is done by using RDTSC instruction present in Pentium-compatible CPUs.
  • No profile-guided optimizations are used.
  • All parsers are running in their fastest modes.
  • The results are given in CPU cycles per character, so frequency of CPUs is irrelevant.
  • The results are minimum values from a large number of runs, to minimize effects of operating system activity, task switching, interrupt handling etc.
  • A single parse of the test file takes about 1/10th of a millisecond, so with large number of runs there is a good chance of hitting at least one no-interrupt streak, and obtaining undisturbed results.
Platform
Compiler
strlen() RapidXml pugixml 0.3 pugxml TinyXml
Pentium 4
MSVC 8.0
2.5
5.4
7.0
61.7
298.8
Pentium 4
gcc 4.1.1
0.8
6.1
9.5
67.0
413.2
Core 2
MSVC 8.0
1.0
4.5
5.0
24.6
154.8
Core 2
gcc 4.1.1
0.6
4.6
5.4
28.3
229.3
Athlon XP
MSVC 8.0
3.1
7.7
8.0
25.5
182.6
Athlon XP
gcc 4.1.1
0.9
8.2
9.2
33.7
265.2
Pentium 3
MSVC 8.0
2.0
6.3
7.0
30.9
211.9
Pentium 3
gcc 4.1.1
1.0
6.7
8.9
35.3
316.0
(*) All results are in CPU cycles per character of source text

5. Reference

This section lists all classes, functions, constants etc. and describes them in detail.
class + template + rapidxml::memory_pool
+ constructor + memory_pool()
+ destructor + ~memory_pool()
function allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)
function allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)
function allocate_string(const Ch *source=0, std::size_t size=0)
function clone_node(const xml_node< Ch > *source, xml_node< Ch > *result=0)
function clear()
function set_allocator(alloc_func *af, free_func *ff)

class rapidxml::parse_error
+ constructor + parse_error(const char *what, void *where)
function what() const
function where() const

class + template + rapidxml::xml_attribute
+ constructor + xml_attribute()
function document() const
function previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const

class + template + rapidxml::xml_base
+ constructor + xml_base()
function name() const
function name_size() const
function value() const
function value_size() const
function name(const Ch *name, std::size_t size)
function name(const Ch *name)
function value(const Ch *value, std::size_t size)
function value(const Ch *value)
function parent() const

class + template + rapidxml::xml_document
+ constructor + xml_document()
function parse(Ch *text)
function clear()

class + template + rapidxml::xml_node
+ constructor + xml_node(node_type type)
function type() const
function document() const
function first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function type(node_type type)
function prepend_node(xml_node< Ch > *child)
function append_node(xml_node< Ch > *child)
function insert_node(xml_node< Ch > *where, xml_node< Ch > *child)
function remove_first_node()
function remove_last_node()
function remove_node(xml_node< Ch > *where)
function remove_all_nodes()
function prepend_attribute(xml_attribute< Ch > *attribute)
function append_attribute(xml_attribute< Ch > *attribute)
function insert_attribute(xml_attribute< Ch > *where, xml_attribute< Ch > *attribute)
function remove_first_attribute()
function remove_last_attribute()
function remove_attribute(xml_attribute< Ch > *where)
function remove_all_attributes()

namespace rapidxml
enum node_type
function parse_error_handler(const char *what, void *where)
function print(OutIt out, const xml_node< Ch > &node, int flags=0)
function print(std::basic_ostream< Ch > &out, const xml_node< Ch > &node, int flags=0)
function operator<<(std::basic_ostream< Ch > &out, const xml_node< Ch > &node)
+ constant + parse_no_data_nodes
+ constant + parse_no_element_values
+ constant + parse_no_string_terminators
+ constant + parse_no_entity_translation
+ constant + parse_no_utf8
+ constant + parse_declaration_node
+ constant + parse_comment_nodes
+ constant + parse_doctype_node
+ constant + parse_pi_nodes
+ constant + parse_validate_closing_tags
+ constant + parse_trim_whitespace
+ constant + parse_normalize_whitespace
+ constant + parse_default
+ constant + parse_non_destructive
+ constant + parse_fastest
+ constant + parse_full
+ constant + print_no_indenting


class + template + rapidxml::memory_pool

+ + Defined in rapidxml.hpp
+ Base class for + xml_document

Description

This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. In most cases, you will not need to use this class directly. However, if you need to create nodes manually or modify names/values of nodes, you are encouraged to use memory_pool of relevant xml_document to allocate the memory. Not only is this faster than allocating them by using new operator, but also their lifetime will be tied to the lifetime of document, possibly simplyfing memory management.

+ Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. You can also call allocate_string() function to allocate strings. Such strings can then be used as names or values of nodes without worrying about their lifetime. Note that there is no free() function -- all allocations are freed at once when clear() function is called, or when the pool is destroyed.

+ It is also possible to create a standalone memory_pool, and use it to allocate nodes, whose lifetime will not be tied to any document.

+ Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. Until static memory is exhausted, no dynamic memory allocations are done. When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, by using global new[] and delete[] operators. This behaviour can be changed by setting custom allocation routines. Use set_allocator() function to set them.

+ Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. This value defaults to the size of pointer on target architecture.

+ To obtain absolutely top performance from the parser, it is important that all nodes are allocated from a single, contiguous block of memory. Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT to obtain best wasted memory to performance compromise. To do it, define their values before rapidxml.hpp file is included.

Parameters

Ch
Character type of created nodes.

+ constructor + memory_pool::memory_pool

Synopsis

memory_pool(); +

Description

Constructs empty pool with default allocator functions.

+ destructor + memory_pool::~memory_pool

Synopsis

~memory_pool(); +

Description

Destroys pool and frees all the memory. This causes memory occupied by nodes allocated by the pool to be freed. Nodes allocated from the pool are no longer valid.

function memory_pool::allocate_node

Synopsis

xml_node<Ch>* allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0); +

Description

Allocates a new node from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

type
Type of node to create.
name
Name to assign to the node, or 0 to assign no name.
value
Value to assign to the node, or 0 to assign no value.
name_size
Size of name to assign, or 0 to automatically calculate size from name string.
value_size
Size of value to assign, or 0 to automatically calculate size from value string.

Returns

Pointer to allocated node. This pointer will never be NULL.

function memory_pool::allocate_attribute

Synopsis

xml_attribute<Ch>* allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0); +

Description

Allocates a new attribute from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

name
Name to assign to the attribute, or 0 to assign no name.
value
Value to assign to the attribute, or 0 to assign no value.
name_size
Size of name to assign, or 0 to automatically calculate size from name string.
value_size
Size of value to assign, or 0 to automatically calculate size from value string.

Returns

Pointer to allocated attribute. This pointer will never be NULL.

function memory_pool::allocate_string

Synopsis

Ch* allocate_string(const Ch *source=0, std::size_t size=0); +

Description

Allocates a char array of given size from the pool, and optionally copies a given string to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

source
String to initialize the allocated memory with, or 0 to not initialize it.
size
Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated.

Returns

Pointer to allocated char array. This pointer will never be NULL.

function memory_pool::clone_node

Synopsis

xml_node<Ch>* clone_node(const xml_node< Ch > *source, xml_node< Ch > *result=0); +

Description

Clones an xml_node and its hierarchy of child nodes and attributes. Nodes and attributes are allocated from this memory pool. Names and values are not cloned, they are shared between the clone and the source. Result node can be optionally specified as a second parameter, in which case its contents will be replaced with cloned source node. This is useful when you want to clone entire document.

Parameters

source
Node to clone.
result
Node to put results in, or 0 to automatically allocate result node

Returns

Pointer to cloned node. This pointer will never be NULL.

function memory_pool::clear

Synopsis

void clear(); +

Description

Clears the pool. This causes memory occupied by nodes allocated by the pool to be freed. Any nodes or strings allocated from the pool will no longer be valid.

function memory_pool::set_allocator

Synopsis

void set_allocator(alloc_func *af, free_func *ff); +

Description

Sets or resets the user-defined memory allocation functions for the pool. This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. Allocation function must not return invalid pointer on failure. It should either throw, stop the program, or use longjmp() function to pass control to other place of program. If it returns invalid pointer, results are undefined.

+ User defined allocation functions must have the following forms:

+void *allocate(std::size_t size);
+void free(void *pointer);

Parameters

af
Allocation function, or 0 to restore default function
ff
Free function, or 0 to restore default function

class rapidxml::parse_error

+ + Defined in rapidxml.hpp

Description

Parse error exception. This exception is thrown by the parser when an error occurs. Use what() function to get human-readable error message. Use where() function to get a pointer to position within source text where error was detected.

+ If throwing exceptions by the parser is undesirable, it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. This function must be defined by the user.

+ This class derives from std::exception class.

+ constructor + parse_error::parse_error

Synopsis

parse_error(const char *what, void *where); +

Description

Constructs parse error.

function parse_error::what

Synopsis

virtual const char* what() const; +

Description

Gets human readable description of error.

Returns

Pointer to null terminated description of the error.

function parse_error::where

Synopsis

Ch* where() const; +

Description

Gets pointer to character data where error happened. Ch should be the same as char type of xml_document that produced the error.

Returns

Pointer to location within the parsed string where error occured.

class + template + rapidxml::xml_attribute

+ + Defined in rapidxml.hpp
+ Inherits from + xml_base

Description

Class representing attribute node of XML document. Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). Note that after parse, both name and value of attribute will point to interior of source text used for parsing. Thus, this text must persist in memory for the lifetime of attribute.

Parameters

Ch
Character type to use.

+ constructor + xml_attribute::xml_attribute

Synopsis

xml_attribute(); +

Description

Constructs an empty attribute with the specified type. Consider using memory_pool of appropriate xml_document if allocating attributes manually.

function xml_attribute::document

Synopsis

xml_document<Ch>* document() const; +

Description

Gets document of which attribute is a child.

Returns

Pointer to document that contains this attribute, or 0 if there is no parent document.

function xml_attribute::previous_attribute

Synopsis

xml_attribute<Ch>* previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets previous attribute, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_attribute::next_attribute

Synopsis

xml_attribute<Ch>* next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets next attribute, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

class + template + rapidxml::xml_base

+ + Defined in rapidxml.hpp
+ Base class for + xml_attribute xml_node

Description

Base class for xml_node and xml_attribute implementing common functions: name(), name_size(), value(), value_size() and parent().

Parameters

Ch
Character type to use

+ constructor + xml_base::xml_base

Synopsis

xml_base(); +

function xml_base::name

Synopsis

Ch* name() const; +

Description

Gets name of the node. Interpretation of name depends on type of node. Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.

+ Use name_size() function to determine length of the name.

Returns

Name of node, or empty string if node has no name.

function xml_base::name_size

Synopsis

std::size_t name_size() const; +

Description

Gets size of node name, not including terminator character. This function works correctly irrespective of whether name is or is not zero terminated.

Returns

Size of node name, in characters.

function xml_base::value

Synopsis

Ch* value() const; +

Description

Gets value of node. Interpretation of value depends on type of node. Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.

+ Use value_size() function to determine length of the value.

Returns

Value of node, or empty string if node has no value.

function xml_base::value_size

Synopsis

std::size_t value_size() const; +

Description

Gets size of node value, not including terminator character. This function works correctly irrespective of whether value is or is not zero terminated.

Returns

Size of node value, in characters.

function xml_base::name

Synopsis

void name(const Ch *name, std::size_t size); +

Description

Sets name of node to a non zero-terminated string. See Ownership Of Strings .

+ Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.

+ Size of name must be specified separately, because name does not have to be zero terminated. Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).

Parameters

name
Name of node to set. Does not have to be zero terminated.
size
Size of name, in characters. This does not include zero terminator, if one is present.

function xml_base::name

Synopsis

void name(const Ch *name); +

Description

Sets name of node to a zero-terminated string. See also Ownership Of Strings and xml_node::name(const Ch *, std::size_t).

Parameters

name
Name of node to set. Must be zero terminated.

function xml_base::value

Synopsis

void value(const Ch *value, std::size_t size); +

Description

Sets value of node to a non zero-terminated string. See Ownership Of Strings .

+ Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.

+ Size of value must be specified separately, because it does not have to be zero terminated. Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated).

+ If an element has a child node of type node_data, it will take precedence over element value when printing. If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.

Parameters

value
value of node to set. Does not have to be zero terminated.
size
Size of value, in characters. This does not include zero terminator, if one is present.

function xml_base::value

Synopsis

void value(const Ch *value); +

Description

Sets value of node to a zero-terminated string. See also Ownership Of Strings and xml_node::value(const Ch *, std::size_t).

Parameters

value
Vame of node to set. Must be zero terminated.

function xml_base::parent

Synopsis

xml_node<Ch>* parent() const; +

Description

Gets node parent.

Returns

Pointer to parent node, or 0 if there is no parent.

class + template + rapidxml::xml_document

+ + Defined in rapidxml.hpp
+ Inherits from + xml_node memory_pool

Description

This class represents root of the DOM hierarchy. It is also an xml_node and a memory_pool through public inheritance. Use parse() function to build a DOM tree from a zero-terminated XML text string. parse() function allocates memory for nodes and attributes by using functions of xml_document, which are inherited from memory_pool. To access root node of the document, use the document itself, as if it was an xml_node.

Parameters

Ch
Character type to use.

+ constructor + xml_document::xml_document

Synopsis

xml_document(); +

Description

Constructs empty XML document.

function xml_document::parse

Synopsis

void parse(Ch *text); +

Description

Parses zero-terminated XML string according to given flags. Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. The string must persist for the lifetime of the document. In case of error, rapidxml::parse_error exception will be thrown.

+ If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. Make sure that data is zero-terminated.

+ Document can be parsed into multiple times. Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool.

Parameters

text
XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser.

function xml_document::clear

Synopsis

void clear(); +

Description

Clears the document by deleting all nodes and clearing the memory pool. All nodes owned by document pool are destroyed.

class + template + rapidxml::xml_node

+ + Defined in rapidxml.hpp
+ Inherits from + xml_base
+ Base class for + xml_document

Description

Class representing a node of XML document. Each node may have associated name and value strings, which are available through name() and value() functions. Interpretation of name and value depends on type of the node. Type of node can be determined by using type() function.

+ Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. Thus, this text must persist in the memory for the lifetime of node.

Parameters

Ch
Character type to use.

+ constructor + xml_node::xml_node

Synopsis

xml_node(node_type type); +

Description

Constructs an empty node with the specified type. Consider using memory_pool of appropriate document to allocate nodes manually.

Parameters

type
Type of node to construct.

function xml_node::type

Synopsis

node_type type() const; +

Description

Gets type of node.

Returns

Type of node.

function xml_node::document

Synopsis

xml_document<Ch>* document() const; +

Description

Gets document of which node is a child.

Returns

Pointer to document that contains this node, or 0 if there is no parent document.

function xml_node::first_node

Synopsis

xml_node<Ch>* first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets first child node, optionally matching node name.

Parameters

name
Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found child, or 0 if not found.

function xml_node::last_node

Synopsis

xml_node<Ch>* last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets last child node, optionally matching node name. Behaviour is undefined if node has no children. Use first_node() to test if node has children.

Parameters

name
Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found child, or 0 if not found.

function xml_node::previous_sibling

Synopsis

xml_node<Ch>* previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets previous sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent.

Parameters

name
Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found sibling, or 0 if not found.

function xml_node::next_sibling

Synopsis

xml_node<Ch>* next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets next sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent.

Parameters

name
Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found sibling, or 0 if not found.

function xml_node::first_attribute

Synopsis

xml_attribute<Ch>* first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets first attribute of node, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_node::last_attribute

Synopsis

xml_attribute<Ch>* last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; +

Description

Gets last attribute of node, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_node::type

Synopsis

void type(node_type type); +

Description

Sets type of node.

Parameters

type
Type of node to set.

function xml_node::prepend_node

Synopsis

void prepend_node(xml_node< Ch > *child); +

Description

Prepends a new child node. The prepended child becomes the first child, and all existing children are moved one position back.

Parameters

child
Node to prepend.

function xml_node::append_node

Synopsis

void append_node(xml_node< Ch > *child); +

Description

Appends a new child node. The appended child becomes the last child.

Parameters

child
Node to append.

function xml_node::insert_node

Synopsis

void insert_node(xml_node< Ch > *where, xml_node< Ch > *child); +

Description

Inserts a new child node at specified place inside the node. All children after and including the specified node are moved one position back.

Parameters

where
Place where to insert the child, or 0 to insert at the back.
child
Node to insert.

function xml_node::remove_first_node

Synopsis

void remove_first_node(); +

Description

Removes first child node. If node has no children, behaviour is undefined. Use first_node() to test if node has children.

function xml_node::remove_last_node

Synopsis

void remove_last_node(); +

Description

Removes last child of the node. If node has no children, behaviour is undefined. Use first_node() to test if node has children.

function xml_node::remove_node

Synopsis

void remove_node(xml_node< Ch > *where); +

Description

Removes specified child from the node.

function xml_node::remove_all_nodes

Synopsis

void remove_all_nodes(); +

Description

Removes all child nodes (but not attributes).

function xml_node::prepend_attribute

Synopsis

void prepend_attribute(xml_attribute< Ch > *attribute); +

Description

Prepends a new attribute to the node.

Parameters

attribute
Attribute to prepend.

function xml_node::append_attribute

Synopsis

void append_attribute(xml_attribute< Ch > *attribute); +

Description

Appends a new attribute to the node.

Parameters

attribute
Attribute to append.

function xml_node::insert_attribute

Synopsis

void insert_attribute(xml_attribute< Ch > *where, xml_attribute< Ch > *attribute); +

Description

Inserts a new attribute at specified place inside the node. All attributes after and including the specified attribute are moved one position back.

Parameters

where
Place where to insert the attribute, or 0 to insert at the back.
attribute
Attribute to insert.

function xml_node::remove_first_attribute

Synopsis

void remove_first_attribute(); +

Description

Removes first attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes.

function xml_node::remove_last_attribute

Synopsis

void remove_last_attribute(); +

Description

Removes last attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes.

function xml_node::remove_attribute

Synopsis

void remove_attribute(xml_attribute< Ch > *where); +

Description

Removes specified attribute from node.

Parameters

where
Pointer to attribute to be removed.

function xml_node::remove_all_attributes

Synopsis

void remove_all_attributes(); +

Description

Removes all attributes of node.

enum node_type

Description

Enumeration listing all node types produced by the parser. Use xml_node::type() function to query node type.

Values

node_document
A document node. Name and value are empty.
node_element
An element node. Name contains element name. Value contains text of first data node.
node_data
A data node. Name is empty. Value contains data text.
node_cdata
A CDATA node. Name is empty. Value contains data text.
node_comment
A comment node. Name is empty. Value contains comment text.
node_declaration
A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes.
node_doctype
A DOCTYPE node. Name is empty. Value contains DOCTYPE text.
node_pi
A PI node. Name contains target. Value contains instructions.

function parse_error_handler

Synopsis

void rapidxml::parse_error_handler(const char *what, void *where); +

Description

When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function is called to notify user about the error. It must be defined by the user.

+ This function cannot return. If it does, the results are undefined.

+ A very simple definition might look like that: + void rapidxml::parse_error_handler(const char *what, void *where) + { + std::cout << "Parse error: " << what << "\n"; + std::abort(); + } +

Parameters

what
Human readable description of the error.
where
Pointer to character data where error was detected.

function print

Synopsis

OutIt rapidxml::print(OutIt out, const xml_node< Ch > &node, int flags=0); +

Description

Prints XML to given output iterator.

Parameters

out
Output iterator to print to.
node
Node to be printed. Pass xml_document to print entire document.
flags
Flags controlling how XML is printed.

Returns

Output iterator pointing to position immediately after last character of printed text.

function print

Synopsis

std::basic_ostream<Ch>& rapidxml::print(std::basic_ostream< Ch > &out, const xml_node< Ch > &node, int flags=0); +

Description

Prints XML to given output stream.

Parameters

out
Output stream to print to.
node
Node to be printed. Pass xml_document to print entire document.
flags
Flags controlling how XML is printed.

Returns

Output stream.

function operator<<

Synopsis

std::basic_ostream<Ch>& rapidxml::operator<<(std::basic_ostream< Ch > &out, const xml_node< Ch > &node); +

Description

Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process.

Parameters

out
Output stream to print to.
node
Node to be printed.

Returns

Output stream.

+ constant + parse_no_data_nodes

Synopsis

const int parse_no_data_nodes + = 0x1; +

Description

Parse flag instructing the parser to not create data nodes. Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_no_element_values

Synopsis

const int parse_no_element_values + = 0x2; +

Description

Parse flag instructing the parser to not use text of first data node as a value of parent element. Can be combined with other flags by use of | operator. Note that child data nodes of element node take precendence over its value when printing. That is, if element has one or more child data nodes and a value, the value will be ignored. Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements.

+ See xml_document::parse() function.

+ constant + parse_no_string_terminators

Synopsis

const int parse_no_string_terminators + = 0x4; +

Description

Parse flag instructing the parser to not place zero terminators after strings in the source text. By default zero terminators are placed, modifying source text. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_no_entity_translation

Synopsis

const int parse_no_entity_translation + = 0x8; +

Description

Parse flag instructing the parser to not translate entities in the source text. By default entities are translated, modifying source text. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_no_utf8

Synopsis

const int parse_no_utf8 + = 0x10; +

Description

Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. By default, UTF-8 handling is enabled. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_declaration_node

Synopsis

const int parse_declaration_node + = 0x20; +

Description

Parse flag instructing the parser to create XML declaration node. By default, declaration node is not created. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_comment_nodes

Synopsis

const int parse_comment_nodes + = 0x40; +

Description

Parse flag instructing the parser to create comments nodes. By default, comment nodes are not created. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_doctype_node

Synopsis

const int parse_doctype_node + = 0x80; +

Description

Parse flag instructing the parser to create DOCTYPE node. By default, doctype node is not created. Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_pi_nodes

Synopsis

const int parse_pi_nodes + = 0x100; +

Description

Parse flag instructing the parser to create PI nodes. By default, PI nodes are not created. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_validate_closing_tags

Synopsis

const int parse_validate_closing_tags + = 0x200; +

Description

Parse flag instructing the parser to validate closing tag names. If not set, name inside closing tag is irrelevant to the parser. By default, closing tags are not validated. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_trim_whitespace

Synopsis

const int parse_trim_whitespace + = 0x400; +

Description

Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. By default, whitespace is not trimmed. This flag does not cause the parser to modify source text. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_normalize_whitespace

Synopsis

const int parse_normalize_whitespace + = 0x800; +

Description

Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. By default, whitespace is not normalized. If this flag is specified, source text will be modified. Can be combined with other flags by use of | operator.

+ See xml_document::parse() function.

+ constant + parse_default

Synopsis

const int parse_default + = 0; +

Description

Parse flags which represent default behaviour of the parser. This is always equal to 0, so that all other flags can be simply ored together. Normally there is no need to inconveniently disable flags by anding with their negated (~) values. This also means that meaning of each flag is a negation of the default setting. For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, and using the flag will disable it.

+ See xml_document::parse() function.

+ constant + parse_non_destructive

Synopsis

const int parse_non_destructive + = parse_no_string_terminators | parse_no_entity_translation; +

Description

A combination of parse flags that forbids any modifications of the source text. This also results in faster parsing. However, note that the following will occur:
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • entities will not be translated
  • whitespace will not be normalized
+See xml_document::parse() function.

+ constant + parse_fastest

Synopsis

const int parse_fastest + = parse_non_destructive | parse_no_data_nodes; +

Description

A combination of parse flags resulting in fastest possible parsing, without sacrificing important data.

+ See xml_document::parse() function.

+ constant + parse_full

Synopsis

const int parse_full + = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; +

Description

A combination of parse flags resulting in largest amount of data being extracted. This usually results in slowest parsing.

+ See xml_document::parse() function.

+ constant + print_no_indenting

Synopsis

const int print_no_indenting + = 0x1; +

Description

Printer flag instructing the printer to suppress indenting of XML. See print() function.

\ No newline at end of file diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp new file mode 100644 index 000000000..d82893a63 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp @@ -0,0 +1,2624 @@ +#ifndef CEREAL_RAPIDXML_HPP_INCLUDED +#define CEREAL_RAPIDXML_HPP_INCLUDED + +// Copyright (C) 2006, 2009 Marcin Kalicinski +// Version 1.13 +// Revision $DateTime: 2009/05/13 01:46:17 $ + +// If standard library is disabled, user must provide implementations of required functions and typedefs +#if !defined(CEREAL_RAPIDXML_NO_STDLIB) + #include // For std::size_t + #include // For assert + #include // For placement new +#endif + +// On MSVC, disable "conditional expression is constant" warning (level 4). +// This warning is almost impossible to avoid with certain types of templated code +#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable:4127) // Conditional expression is constant + #pragma warning(disable:4100) // unreferenced formal parameter +#endif + +/////////////////////////////////////////////////////////////////////////// +// CEREAL_RAPIDXML_PARSE_ERROR + +#if defined(CEREAL_RAPIDXML_NO_EXCEPTIONS) + +#define CEREAL_RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } + +namespace cereal { +namespace rapidxml +{ + //! When exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, + //! this function is called to notify user about the error. + //! It must be defined by the user. + //!

+ //! This function cannot return. If it does, the results are undefined. + //!

+ //! A very simple definition might look like that: + //!

+    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
+    //! {
+    //!     std::cout << "Parse error: " << what << "\n";
+    //!     std::abort();
+    //! }
+    //! 
+ //! \param what Human readable description of the error. + //! \param where Pointer to character data where error was detected. + void parse_error_handler(const char *what, void *where); +} +} // end namespace cereal + +#else + +#include // For std::exception + +#define CEREAL_RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) + +namespace cereal { +namespace rapidxml +{ + + //! Parse error exception. + //! This exception is thrown by the parser when an error occurs. + //! Use what() function to get human-readable error message. + //! Use where() function to get a pointer to position within source text where error was detected. + //!

+ //! If throwing exceptions by the parser is undesirable, + //! it can be disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. + //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. + //! This function must be defined by the user. + //!

+ //! This class derives from std::exception class. + class parse_error: public std::exception + { + + public: + + //! Constructs parse error + parse_error(const char *what_, void *where_) + : m_what(what_) + , m_where(where_) + { + } + + //! Gets human readable description of error. + //! \return Pointer to null terminated description of the error. + virtual const char *what() const CEREAL_NOEXCEPT override + { + return m_what; + } + + //! Gets pointer to character data where error happened. + //! Ch should be the same as char type of xml_document that produced the error. + //! \return Pointer to location within the parsed string where error occured. + template + Ch *where() const + { + return reinterpret_cast(m_where); + } + + private: + + const char *m_what; + void *m_where; + + }; +} +} // end namespace cereal + +#endif + +/////////////////////////////////////////////////////////////////////////// +// Pool sizes + +#ifndef CEREAL_RAPIDXML_STATIC_POOL_SIZE + // Size of static memory block of memory_pool. + // Define CEREAL_RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. + // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. + #define CEREAL_RAPIDXML_STATIC_POOL_SIZE (64 * 1024) +#endif + +#ifndef CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE + // Size of dynamic memory block of memory_pool. + // Define CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. + // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. + #define CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) +#endif + +#ifndef CEREAL_RAPIDXML_ALIGNMENT + // Memory allocation alignment. + // Define CEREAL_RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. + // All memory allocations for nodes, attributes and strings will be aligned to this value. + // This must be a power of 2 and at least 1, otherwise memory_pool will not work. + #define CEREAL_RAPIDXML_ALIGNMENT sizeof(void *) +#endif + +namespace cereal { +namespace rapidxml +{ + // Forward declarations + template class xml_node; + template class xml_attribute; + template class xml_document; + + //! Enumeration listing all node types produced by the parser. + //! Use xml_node::type() function to query node type. + enum node_type + { + node_document, //!< A document node. Name and value are empty. + node_element, //!< An element node. Name contains element name. Value contains text of first data node. + node_data, //!< A data node. Name is empty. Value contains data text. + node_cdata, //!< A CDATA node. Name is empty. Value contains data text. + node_comment, //!< A comment node. Name is empty. Value contains comment text. + node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. + node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. + node_pi //!< A PI node. Name contains target. Value contains instructions. + }; + + /////////////////////////////////////////////////////////////////////// + // Parsing flags + + //! Parse flag instructing the parser to not create data nodes. + //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_no_data_nodes = 0x1; + + //! Parse flag instructing the parser to not use text of first data node as a value of parent element. + //! Can be combined with other flags by use of | operator. + //! Note that child data nodes of element node take precendence over its value when printing. + //! That is, if element has one or more child data nodes and a value, the value will be ignored. + //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. + //!

+ //! See xml_document::parse() function. + const int parse_no_element_values = 0x2; + + //! Parse flag instructing the parser to not place zero terminators after strings in the source text. + //! By default zero terminators are placed, modifying source text. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_no_string_terminators = 0x4; + + //! Parse flag instructing the parser to not translate entities in the source text. + //! By default entities are translated, modifying source text. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_no_entity_translation = 0x8; + + //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. + //! By default, UTF-8 handling is enabled. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_no_utf8 = 0x10; + + //! Parse flag instructing the parser to create XML declaration node. + //! By default, declaration node is not created. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_declaration_node = 0x20; + + //! Parse flag instructing the parser to create comments nodes. + //! By default, comment nodes are not created. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_comment_nodes = 0x40; + + //! Parse flag instructing the parser to create DOCTYPE node. + //! By default, doctype node is not created. + //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_doctype_node = 0x80; + + //! Parse flag instructing the parser to create PI nodes. + //! By default, PI nodes are not created. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_pi_nodes = 0x100; + + //! Parse flag instructing the parser to validate closing tag names. + //! If not set, name inside closing tag is irrelevant to the parser. + //! By default, closing tags are not validated. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_validate_closing_tags = 0x200; + + //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. + //! By default, whitespace is not trimmed. + //! This flag does not cause the parser to modify source text. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_trim_whitespace = 0x400; + + //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. + //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. + //! By default, whitespace is not normalized. + //! If this flag is specified, source text will be modified. + //! Can be combined with other flags by use of | operator. + //!

+ //! See xml_document::parse() function. + const int parse_normalize_whitespace = 0x800; + + // Compound flags + + //! Parse flags which represent default behaviour of the parser. + //! This is always equal to 0, so that all other flags can be simply ored together. + //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. + //! This also means that meaning of each flag is a negation of the default setting. + //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, + //! and using the flag will disable it. + //!

+ //! See xml_document::parse() function. + const int parse_default = 0; + + //! A combination of parse flags that forbids any modifications of the source text. + //! This also results in faster parsing. However, note that the following will occur: + //!
    + //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • + //!
  • entities will not be translated
  • + //!
  • whitespace will not be normalized
  • + //!
+ //! See xml_document::parse() function. + const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; + + //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. + //!

+ //! See xml_document::parse() function. + const int parse_fastest = parse_non_destructive | parse_no_data_nodes; + + //! A combination of parse flags resulting in largest amount of data being extracted. + //! This usually results in slowest parsing. + //!

+ //! See xml_document::parse() function. + const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; + + /////////////////////////////////////////////////////////////////////// + // Internals + + //! \cond internal + namespace internal + { + + // Struct that contains lookup tables for the parser + // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). + template + struct lookup_tables + { + static const unsigned char lookup_whitespace[256]; // Whitespace table + static const unsigned char lookup_node_name[256]; // Node name table + static const unsigned char lookup_text[256]; // Text table + static const unsigned char lookup_text_pure_no_ws[256]; // Text table + static const unsigned char lookup_text_pure_with_ws[256]; // Text table + static const unsigned char lookup_attribute_name[256]; // Attribute name table + static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote + static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote + static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes + static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes + static const unsigned char lookup_digits[256]; // Digits + static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters + }; + + // Find length of the string + template + inline std::size_t measure(const Ch *p) + { + const Ch *tmp = p; + while (*tmp) + ++tmp; + return static_cast(tmp - p); + } + + // Compare strings for equality + template + inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) + { + if (size1 != size2) + return false; + if (case_sensitive) + { + for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) + if (*p1 != *p2) + return false; + } + else + { + for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) + if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) + return false; + } + return true; + } + + template + inline bool preserve_space(xml_node* node) + { + const Ch preserve_value[] = { Ch('p'), Ch('r'), Ch('e'), Ch('s'), Ch('e'), Ch('r'), Ch('v'), Ch('e') }; + const xml_attribute* space = node->first_attribute("xml:space"); + return space && internal::compare(space->value(), space->value_size(), preserve_value, sizeof(preserve_value) / sizeof(Ch), true); + } + } + //! \endcond + + /////////////////////////////////////////////////////////////////////// + // Memory pool + + //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. + //! In most cases, you will not need to use this class directly. + //! However, if you need to create nodes manually or modify names/values of nodes, + //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. + //! Not only is this faster than allocating them by using new operator, + //! but also their lifetime will be tied to the lifetime of document, + //! possibly simplyfing memory management. + //!

+ //! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. + //! You can also call allocate_string() function to allocate strings. + //! Such strings can then be used as names or values of nodes without worrying about their lifetime. + //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, + //! or when the pool is destroyed. + //!

+ //! It is also possible to create a standalone memory_pool, and use it + //! to allocate nodes, whose lifetime will not be tied to any document. + //!

+ //! Pool maintains CEREAL_RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. + //! Until static memory is exhausted, no dynamic memory allocations are done. + //! When static memory is exhausted, pool allocates additional blocks of memory of size CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE each, + //! by using global new[] and delete[] operators. + //! This behaviour can be changed by setting custom allocation routines. + //! Use set_allocator() function to set them. + //!

+ //! Allocations for nodes, attributes and strings are aligned at CEREAL_RAPIDXML_ALIGNMENT bytes. + //! This value defaults to the size of pointer on target architecture. + //!

+ //! To obtain absolutely top performance from the parser, + //! it is important that all nodes are allocated from a single, contiguous block of memory. + //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. + //! If required, you can tweak CEREAL_RAPIDXML_STATIC_POOL_SIZE, CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE and CEREAL_RAPIDXML_ALIGNMENT + //! to obtain best wasted memory to performance compromise. + //! To do it, define their values before rapidxml.hpp file is included. + //! \tparam Ch Character type of created nodes. + template + class memory_pool + { + + public: + + //! \cond internal + typedef void *(alloc_func)(std::size_t); // Type of user-defined function used to allocate memory + typedef void (free_func)(void *); // Type of user-defined function used to free memory + //! \endcond + + //! Constructs empty pool with default allocator functions. + memory_pool() + : m_alloc_func(0) + , m_free_func(0) + { + init(); + } + + //! Destroys pool and frees all the memory. + //! This causes memory occupied by nodes allocated by the pool to be freed. + //! Nodes allocated from the pool are no longer valid. + ~memory_pool() + { + clear(); + } + + //! Allocates a new node from the pool, and optionally assigns name and value to it. + //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. + //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function + //! will call rapidxml::parse_error_handler() function. + //! \param type Type of node to create. + //! \param name Name to assign to the node, or 0 to assign no name. + //! \param value Value to assign to the node, or 0 to assign no value. + //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. + //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. + //! \return Pointer to allocated node. This pointer will never be NULL. + xml_node *allocate_node(node_type type, + const Ch *name = 0, const Ch *value = 0, + std::size_t name_size = 0, std::size_t value_size = 0) + { + void *memory = allocate_aligned(sizeof(xml_node)); + xml_node *node = new(memory) xml_node(type); + if (name) + { + if (name_size > 0) + node->name(name, name_size); + else + node->name(name); + } + if (value) + { + if (value_size > 0) + node->value(value, value_size); + else + node->value(value); + } + return node; + } + + //! Allocates a new attribute from the pool, and optionally assigns name and value to it. + //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. + //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function + //! will call rapidxml::parse_error_handler() function. + //! \param name Name to assign to the attribute, or 0 to assign no name. + //! \param value Value to assign to the attribute, or 0 to assign no value. + //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. + //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. + //! \return Pointer to allocated attribute. This pointer will never be NULL. + xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, + std::size_t name_size = 0, std::size_t value_size = 0) + { + void *memory = allocate_aligned(sizeof(xml_attribute)); + xml_attribute *attribute = new(memory) xml_attribute; + if (name) + { + if (name_size > 0) + attribute->name(name, name_size); + else + attribute->name(name); + } + if (value) + { + if (value_size > 0) + attribute->value(value, value_size); + else + attribute->value(value); + } + return attribute; + } + + //! Allocates a char array of given size from the pool, and optionally copies a given string to it. + //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. + //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function + //! will call rapidxml::parse_error_handler() function. + //! \param source String to initialize the allocated memory with, or 0 to not initialize it. + //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. + //! \return Pointer to allocated char array. This pointer will never be NULL. + Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) + { + assert(source || size); // Either source or size (or both) must be specified + if (size == 0) + size = internal::measure(source) + 1; + Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); + if (source) + for (std::size_t i = 0; i < size; ++i) + result[i] = source[i]; + return result; + } + + //! Clones an xml_node and its hierarchy of child nodes and attributes. + //! Nodes and attributes are allocated from this memory pool. + //! Names and values are not cloned, they are shared between the clone and the source. + //! Result node can be optionally specified as a second parameter, + //! in which case its contents will be replaced with cloned source node. + //! This is useful when you want to clone entire document. + //! \param source Node to clone. + //! \param result Node to put results in, or 0 to automatically allocate result node + //! \return Pointer to cloned node. This pointer will never be NULL. + xml_node *clone_node(const xml_node *source, xml_node *result = 0) + { + // Prepare result node + if (result) + { + result->remove_all_attributes(); + result->remove_all_nodes(); + result->type(source->type()); + } + else + result = allocate_node(source->type()); + + // Clone name and value + result->name(source->name(), source->name_size()); + result->value(source->value(), source->value_size()); + + // Clone child nodes and attributes + for (xml_node *child = source->first_node(); child; child = child->next_sibling()) + result->append_node(clone_node(child)); + for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) + result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); + + return result; + } + + //! Clears the pool. + //! This causes memory occupied by nodes allocated by the pool to be freed. + //! Any nodes or strings allocated from the pool will no longer be valid. + void clear() + { + while (m_begin != m_static_memory) + { + char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; + if (m_free_func) + m_free_func(m_begin); + else + delete[] m_begin; + m_begin = previous_begin; + } + init(); + } + + //! Sets or resets the user-defined memory allocation functions for the pool. + //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. + //! Allocation function must not return invalid pointer on failure. It should either throw, + //! stop the program, or use longjmp() function to pass control to other place of program. + //! If it returns invalid pointer, results are undefined. + //!

+ //! User defined allocation functions must have the following forms: + //!
+ //!
void *allocate(std::size_t size); + //!
void free(void *pointer); + //!

+ //! \param af Allocation function, or 0 to restore default function + //! \param ff Free function, or 0 to restore default function + void set_allocator(alloc_func *af, free_func *ff) + { + assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet + m_alloc_func = af; + m_free_func = ff; + } + + private: + + struct header + { + char *previous_begin; + }; + + void init() + { + m_begin = m_static_memory; + m_ptr = align(m_begin); + m_end = m_static_memory + sizeof(m_static_memory); + } + + char *align(char *ptr) + { + std::size_t alignment = ((CEREAL_RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (CEREAL_RAPIDXML_ALIGNMENT - 1))) & (CEREAL_RAPIDXML_ALIGNMENT - 1)); + return ptr + alignment; + } + + char *allocate_raw(std::size_t size) + { + // Allocate + void *memory; + if (m_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] + { + memory = m_alloc_func(size); + assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp + } + else + { + memory = new char[size]; +#ifdef CEREAL_RAPIDXML_NO_EXCEPTIONS + if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc + CEREAL_RAPIDXML_PARSE_ERROR("out of memory", 0); +#endif + } + return static_cast(memory); + } + + void *allocate_aligned(std::size_t size) + { + // Calculate aligned pointer + char *result = align(m_ptr); + + // If not enough memory left in current pool, allocate a new pool + if (result + size > m_end) + { + // Calculate required pool size (may be bigger than CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE) + std::size_t pool_size = CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE; + if (pool_size < size) + pool_size = size; + + // Allocate + std::size_t alloc_size = sizeof(header) + (2 * CEREAL_RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation + char *raw_memory = allocate_raw(alloc_size); + + // Setup new pool in allocated memory + char *pool = align(raw_memory); + header *new_header = reinterpret_cast
(pool); + new_header->previous_begin = m_begin; + m_begin = raw_memory; + m_ptr = pool + sizeof(header); + m_end = raw_memory + alloc_size; + + // Calculate aligned pointer again using new pool + result = align(m_ptr); + } + + // Update pool and return aligned pointer + m_ptr = result + size; + return result; + } + + char *m_begin; // Start of raw memory making up current pool + char *m_ptr; // First free byte in current pool + char *m_end; // One past last available byte in current pool + char m_static_memory[CEREAL_RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory + alloc_func *m_alloc_func; // Allocator function, or 0 if default is to be used + free_func *m_free_func; // Free function, or 0 if default is to be used + }; + + /////////////////////////////////////////////////////////////////////////// + // XML base + + //! Base class for xml_node and xml_attribute implementing common functions: + //! name(), name_size(), value(), value_size() and parent(). + //! \tparam Ch Character type to use + template + class xml_base + { + + public: + + /////////////////////////////////////////////////////////////////////////// + // Construction & destruction + + // Construct a base with empty name, value and parent + xml_base() + : m_name(0) + , m_value(0) + , m_parent(0) + { + } + + /////////////////////////////////////////////////////////////////////////// + // Node data access + + //! Gets name of the node. + //! Interpretation of name depends on type of node. + //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. + //!

+ //! Use name_size() function to determine length of the name. + //! \return Name of node, or empty string if node has no name. + Ch *name() const + { + return m_name ? m_name : nullstr(); + } + + //! Gets size of node name, not including terminator character. + //! This function works correctly irrespective of whether name is or is not zero terminated. + //! \return Size of node name, in characters. + std::size_t name_size() const + { + return m_name ? m_name_size : 0; + } + + //! Gets value of node. + //! Interpretation of value depends on type of node. + //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. + //!

+ //! Use value_size() function to determine length of the value. + //! \return Value of node, or empty string if node has no value. + Ch *value() const + { + return m_value ? m_value : nullstr(); + } + + //! Gets size of node value, not including terminator character. + //! This function works correctly irrespective of whether value is or is not zero terminated. + //! \return Size of node value, in characters. + std::size_t value_size() const + { + return m_value ? m_value_size : 0; + } + + /////////////////////////////////////////////////////////////////////////// + // Node modification + + //! Sets name of node to a non zero-terminated string. + //! See \ref ownership_of_strings. + //!

+ //! Note that node does not own its name or value, it only stores a pointer to it. + //! It will not delete or otherwise free the pointer on destruction. + //! It is reponsibility of the user to properly manage lifetime of the string. + //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - + //! on destruction of the document the string will be automatically freed. + //!

+ //! Size of name must be specified separately, because name does not have to be zero terminated. + //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). + //! \param name_ Name of node to set. Does not have to be zero terminated. + //! \param size Size of name, in characters. This does not include zero terminator, if one is present. + void name(const Ch *name_, std::size_t size) + { + m_name = const_cast(name_); + m_name_size = size; + } + + //! Sets name of node to a zero-terminated string. + //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). + //! \param name_ Name of node to set. Must be zero terminated. + void name(const Ch *name_) + { + this->name(name_, internal::measure(name_)); + } + + //! Sets value of node to a non zero-terminated string. + //! See \ref ownership_of_strings. + //!

+ //! Note that node does not own its name or value, it only stores a pointer to it. + //! It will not delete or otherwise free the pointer on destruction. + //! It is reponsibility of the user to properly manage lifetime of the string. + //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - + //! on destruction of the document the string will be automatically freed. + //!

+ //! Size of value must be specified separately, because it does not have to be zero terminated. + //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). + //!

+ //! If an element has a child node of type node_data, it will take precedence over element value when printing. + //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. + //! \param value_ value of node to set. Does not have to be zero terminated. + //! \param size Size of value, in characters. This does not include zero terminator, if one is present. + void value(const Ch *value_, std::size_t size) + { + m_value = const_cast(value_); + m_value_size = size; + } + + //! Sets value of node to a zero-terminated string. + //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). + //! \param value_ Vame of node to set. Must be zero terminated. + void value(const Ch *value_) + { + this->value(value_, internal::measure(value_)); + } + + /////////////////////////////////////////////////////////////////////////// + // Related nodes access + + //! Gets node parent. + //! \return Pointer to parent node, or 0 if there is no parent. + xml_node *parent() const + { + return m_parent; + } + + protected: + + // Return empty string + static Ch *nullstr() + { + static Ch zero = Ch('\0'); + return &zero; + } + + Ch *m_name; // Name of node, or 0 if no name + Ch *m_value; // Value of node, or 0 if no value + std::size_t m_name_size; // Length of node name, or undefined of no name + std::size_t m_value_size; // Length of node value, or undefined if no value + xml_node *m_parent; // Pointer to parent node, or 0 if none + + }; + + //! Class representing attribute node of XML document. + //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). + //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. + //! Thus, this text must persist in memory for the lifetime of attribute. + //! \tparam Ch Character type to use. + template + class xml_attribute: public xml_base + { + + friend class xml_node; + + public: + + /////////////////////////////////////////////////////////////////////////// + // Construction & destruction + + //! Constructs an empty attribute with the specified type. + //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. + xml_attribute() + { + } + + /////////////////////////////////////////////////////////////////////////// + // Related nodes access + + //! Gets document of which attribute is a child. + //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. + xml_document *document() const + { + if (xml_node *node = this->parent()) + { + while (node->parent()) + node = node->parent(); + return node->type() == node_document ? static_cast *>(node) : 0; + } + else + return 0; + } + + //! Gets previous attribute, optionally matching attribute name. + //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found attribute, or 0 if not found. + xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const + { + if (name) + { + if (name_size == 0) + name_size = internal::measure(name); + for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) + if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) + return attribute; + return 0; + } + else + return this->m_parent ? m_prev_attribute : 0; + } + + //! Gets next attribute, optionally matching attribute name. + //! \param name_ Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found attribute, or 0 if not found. + xml_attribute *next_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const + { + if (name_) + { + if (name_size_ == 0) + name_size_ = internal::measure(name_); + for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) + if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive)) + return attribute; + return 0; + } + else + return this->m_parent ? m_next_attribute : 0; + } + + private: + + xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero + xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero + + }; + + /////////////////////////////////////////////////////////////////////////// + // XML node + + //! Class representing a node of XML document. + //! Each node may have associated name and value strings, which are available through name() and value() functions. + //! Interpretation of name and value depends on type of the node. + //! Type of node can be determined by using type() function. + //!

+ //! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. + //! Thus, this text must persist in the memory for the lifetime of node. + //! \tparam Ch Character type to use. + template + class xml_node: public xml_base + { + + public: + + /////////////////////////////////////////////////////////////////////////// + // Construction & destruction + + //! Constructs an empty node with the specified type. + //! Consider using memory_pool of appropriate document to allocate nodes manually. + //! \param type_ Type of node to construct. + xml_node(node_type type_) + : m_type(type_) + , m_first_node(0) + , m_first_attribute(0) + { + } + + /////////////////////////////////////////////////////////////////////////// + // Node data access + + //! Gets type of node. + //! \return Type of node. + node_type type() const + { + return m_type; + } + + /////////////////////////////////////////////////////////////////////////// + // Related nodes access + + //! Gets document of which node is a child. + //! \return Pointer to document that contains this node, or 0 if there is no parent document. + xml_document *document() const + { + xml_node *node = const_cast *>(this); + while (node->parent()) + node = node->parent(); + return node->type() == node_document ? static_cast *>(node) : 0; + } + + //! Gets first child node, optionally matching node name. + //! \param name_ Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found child, or 0 if not found. + xml_node *first_node(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const + { + if (name_) + { + if (name_size_ == 0) + name_size_ = internal::measure(name_); + for (xml_node *child = m_first_node; child; child = child->next_sibling()) + if (internal::compare(child->name(), child->name_size(), name_, name_size_, case_sensitive)) + return child; + return 0; + } + else + return m_first_node; + } + + //! Gets last child node, optionally matching node name. + //! Behaviour is undefined if node has no children. + //! Use first_node() to test if node has children. + //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found child, or 0 if not found. + xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const + { + assert(m_first_node); // Cannot query for last child if node has no children + if (name) + { + if (name_size == 0) + name_size = internal::measure(name); + for (xml_node *child = m_last_node; child; child = child->previous_sibling()) + if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) + return child; + return 0; + } + else + return m_last_node; + } + + //! Gets previous sibling node, optionally matching node name. + //! Behaviour is undefined if node has no parent. + //! Use parent() to test if node has a parent. + //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found sibling, or 0 if not found. + xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const + { + assert(this->m_parent); // Cannot query for siblings if node has no parent + if (name) + { + if (name_size == 0) + name_size = internal::measure(name); + for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) + if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) + return sibling; + return 0; + } + else + return m_prev_sibling; + } + + //! Gets next sibling node, optionally matching node name. + //! Behaviour is undefined if node has no parent. + //! Use parent() to test if node has a parent. + //! \param name_ Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found sibling, or 0 if not found. + xml_node *next_sibling(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const + { + assert(this->m_parent); // Cannot query for siblings if node has no parent + if (name_) + { + if (name_size_ == 0) + name_size_ = internal::measure(name_); + for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) + if (internal::compare(sibling->name(), sibling->name_size(), name_, name_size_, case_sensitive)) + return sibling; + return 0; + } + else + return m_next_sibling; + } + + //! Gets first attribute of node, optionally matching attribute name. + //! \param name_ Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found attribute, or 0 if not found. + xml_attribute *first_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const + { + if (name_) + { + if (name_size_ == 0) + name_size_ = internal::measure(name_); + for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) + if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive)) + return attribute; + return 0; + } + else + return m_first_attribute; + } + + //! Gets last attribute of node, optionally matching attribute name. + //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero + //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string + //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters + //! \return Pointer to found attribute, or 0 if not found. + xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const + { + if (name) + { + if (name_size == 0) + name_size = internal::measure(name); + for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) + if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) + return attribute; + return 0; + } + else + return m_first_attribute ? m_last_attribute : 0; + } + + /////////////////////////////////////////////////////////////////////////// + // Node modification + + //! Sets type of node. + //! \param type_ Type of node to set. + void type(node_type type_) + { + m_type = type_; + } + + /////////////////////////////////////////////////////////////////////////// + // Node manipulation + + //! Prepends a new child node. + //! The prepended child becomes the first child, and all existing children are moved one position back. + //! \param child Node to prepend. + void prepend_node(xml_node *child) + { + assert(child && !child->parent() && child->type() != node_document); + if (first_node()) + { + child->m_next_sibling = m_first_node; + m_first_node->m_prev_sibling = child; + } + else + { + child->m_next_sibling = 0; + m_last_node = child; + } + m_first_node = child; + child->m_parent = this; + child->m_prev_sibling = 0; + } + + //! Appends a new child node. + //! The appended child becomes the last child. + //! \param child Node to append. + void append_node(xml_node *child) + { + assert(child && !child->parent() && child->type() != node_document); + if (first_node()) + { + child->m_prev_sibling = m_last_node; + m_last_node->m_next_sibling = child; + } + else + { + child->m_prev_sibling = 0; + m_first_node = child; + } + m_last_node = child; + child->m_parent = this; + child->m_next_sibling = 0; + } + + //! Inserts a new child node at specified place inside the node. + //! All children after and including the specified node are moved one position back. + //! \param where Place where to insert the child, or 0 to insert at the back. + //! \param child Node to insert. + void insert_node(xml_node *where, xml_node *child) + { + assert(!where || where->parent() == this); + assert(child && !child->parent() && child->type() != node_document); + if (where == m_first_node) + prepend_node(child); + else if (where == 0) + append_node(child); + else + { + child->m_prev_sibling = where->m_prev_sibling; + child->m_next_sibling = where; + where->m_prev_sibling->m_next_sibling = child; + where->m_prev_sibling = child; + child->m_parent = this; + } + } + + //! Removes first child node. + //! If node has no children, behaviour is undefined. + //! Use first_node() to test if node has children. + void remove_first_node() + { + assert(first_node()); + xml_node *child = m_first_node; + m_first_node = child->m_next_sibling; + if (child->m_next_sibling) + child->m_next_sibling->m_prev_sibling = 0; + else + m_last_node = 0; + child->m_parent = 0; + } + + //! Removes last child of the node. + //! If node has no children, behaviour is undefined. + //! Use first_node() to test if node has children. + void remove_last_node() + { + assert(first_node()); + xml_node *child = m_last_node; + if (child->m_prev_sibling) + { + m_last_node = child->m_prev_sibling; + child->m_prev_sibling->m_next_sibling = 0; + } + else + m_first_node = 0; + child->m_parent = 0; + } + + //! Removes specified child from the node + // \param where Pointer to child to be removed. + void remove_node(xml_node *where) + { + assert(where && where->parent() == this); + assert(first_node()); + if (where == m_first_node) + remove_first_node(); + else if (where == m_last_node) + remove_last_node(); + else + { + where->m_prev_sibling->m_next_sibling = where->m_next_sibling; + where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; + where->m_parent = 0; + } + } + + //! Removes all child nodes (but not attributes). + void remove_all_nodes() + { + for (xml_node *node = first_node(); node; node = node->m_next_sibling) + node->m_parent = 0; + m_first_node = 0; + } + + //! Prepends a new attribute to the node. + //! \param attribute Attribute to prepend. + void prepend_attribute(xml_attribute *attribute) + { + assert(attribute && !attribute->parent()); + if (first_attribute()) + { + attribute->m_next_attribute = m_first_attribute; + m_first_attribute->m_prev_attribute = attribute; + } + else + { + attribute->m_next_attribute = 0; + m_last_attribute = attribute; + } + m_first_attribute = attribute; + attribute->m_parent = this; + attribute->m_prev_attribute = 0; + } + + //! Appends a new attribute to the node. + //! \param attribute Attribute to append. + void append_attribute(xml_attribute *attribute) + { + assert(attribute && !attribute->parent()); + if (first_attribute()) + { + attribute->m_prev_attribute = m_last_attribute; + m_last_attribute->m_next_attribute = attribute; + } + else + { + attribute->m_prev_attribute = 0; + m_first_attribute = attribute; + } + m_last_attribute = attribute; + attribute->m_parent = this; + attribute->m_next_attribute = 0; + } + + //! Inserts a new attribute at specified place inside the node. + //! All attributes after and including the specified attribute are moved one position back. + //! \param where Place where to insert the attribute, or 0 to insert at the back. + //! \param attribute Attribute to insert. + void insert_attribute(xml_attribute *where, xml_attribute *attribute) + { + assert(!where || where->parent() == this); + assert(attribute && !attribute->parent()); + if (where == m_first_attribute) + prepend_attribute(attribute); + else if (where == 0) + append_attribute(attribute); + else + { + attribute->m_prev_attribute = where->m_prev_attribute; + attribute->m_next_attribute = where; + where->m_prev_attribute->m_next_attribute = attribute; + where->m_prev_attribute = attribute; + attribute->m_parent = this; + } + } + + //! Removes first attribute of the node. + //! If node has no attributes, behaviour is undefined. + //! Use first_attribute() to test if node has attributes. + void remove_first_attribute() + { + assert(first_attribute()); + xml_attribute *attribute = m_first_attribute; + if (attribute->m_next_attribute) + { + attribute->m_next_attribute->m_prev_attribute = 0; + } + else + m_last_attribute = 0; + attribute->m_parent = 0; + m_first_attribute = attribute->m_next_attribute; + } + + //! Removes last attribute of the node. + //! If node has no attributes, behaviour is undefined. + //! Use first_attribute() to test if node has attributes. + void remove_last_attribute() + { + assert(first_attribute()); + xml_attribute *attribute = m_last_attribute; + if (attribute->m_prev_attribute) + { + attribute->m_prev_attribute->m_next_attribute = 0; + m_last_attribute = attribute->m_prev_attribute; + } + else + m_first_attribute = 0; + attribute->m_parent = 0; + } + + //! Removes specified attribute from node. + //! \param where Pointer to attribute to be removed. + void remove_attribute(xml_attribute *where) + { + assert(first_attribute() && where->parent() == this); + if (where == m_first_attribute) + remove_first_attribute(); + else if (where == m_last_attribute) + remove_last_attribute(); + else + { + where->m_prev_attribute->m_next_attribute = where->m_next_attribute; + where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; + where->m_parent = 0; + } + } + + //! Removes all attributes of node. + void remove_all_attributes() + { + for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) + attribute->m_parent = 0; + m_first_attribute = 0; + } + + private: + + /////////////////////////////////////////////////////////////////////////// + // Restrictions + + // No copying + xml_node(const xml_node &); + void operator =(const xml_node &); + + /////////////////////////////////////////////////////////////////////////// + // Data members + + // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. + // This is required for maximum performance, as it allows the parser to omit initialization of + // unneded/redundant values. + // + // The rules are as follows: + // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively + // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage + // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage + + node_type m_type; // Type of node; always valid + xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid + xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero + xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid + xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero + xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero + xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero + + }; + + /////////////////////////////////////////////////////////////////////////// + // XML document + + //! This class represents root of the DOM hierarchy. + //! It is also an xml_node and a memory_pool through public inheritance. + //! Use parse() function to build a DOM tree from a zero-terminated XML text string. + //! parse() function allocates memory for nodes and attributes by using functions of xml_document, + //! which are inherited from memory_pool. + //! To access root node of the document, use the document itself, as if it was an xml_node. + //! \tparam Ch Character type to use. + template + class xml_document: public xml_node, public memory_pool + { + + public: + + //! Constructs empty XML document + xml_document() + : xml_node(node_document) + { + } + + //! Parses zero-terminated XML string according to given flags. + //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. + //! The string must persist for the lifetime of the document. + //! In case of error, rapidxml::parse_error exception will be thrown. + //!

+ //! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. + //! Make sure that data is zero-terminated. + //!

+ //! Document can be parsed into multiple times. + //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. + //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. + template + void parse(Ch *text) + { + assert(text); + + // Remove current contents + this->remove_all_nodes(); + this->remove_all_attributes(); + + // Parse BOM, if any + parse_bom(text); + + // Parse children + while (1) + { + // Skip whitespace before node + skip(text); + if (*text == 0) + break; + + // Parse and append new child + if (*text == Ch('<')) + { + ++text; // Skip '<' + if (xml_node *node = parse_node(text)) + this->append_node(node); + } + else + CEREAL_RAPIDXML_PARSE_ERROR("expected <", text); + } + + } + + //! Clears the document by deleting all nodes and clearing the memory pool. + //! All nodes owned by document pool are destroyed. + void clear() + { + this->remove_all_nodes(); + this->remove_all_attributes(); + memory_pool::clear(); + } + + private: + + /////////////////////////////////////////////////////////////////////// + // Internal character utility functions + + // Detect whitespace character + struct whitespace_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; + } + }; + + // Detect node name character + struct node_name_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; + } + }; + + // Detect attribute name character + struct attribute_name_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; + } + }; + + // Detect text character (PCDATA) + struct text_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; + } + }; + + // Detect text character (PCDATA) that does not require processing + struct text_pure_no_ws_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; + } + }; + + // Detect text character (PCDATA) that does not require processing + struct text_pure_with_ws_pred + { + static unsigned char test(Ch ch) + { + return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; + } + }; + + // Detect attribute value character + template + struct attribute_value_pred + { + static unsigned char test(Ch ch) + { + if (Quote == Ch('\'')) + return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; + if (Quote == Ch('\"')) + return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; + return 0; // Should never be executed, to avoid warnings on Comeau + } + }; + + // Detect attribute value character + template + struct attribute_value_pure_pred + { + static unsigned char test(Ch ch) + { + if (Quote == Ch('\'')) + return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; + if (Quote == Ch('\"')) + return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; + return 0; // Should never be executed, to avoid warnings on Comeau + } + }; + + // Insert coded character, using UTF8 or 8-bit ASCII + template + static void insert_coded_character(Ch *&text, unsigned long code) + { + if (Flags & parse_no_utf8) + { + // Insert 8-bit ASCII character + // Todo: possibly verify that code is less than 256 and use replacement char otherwise? + text[0] = static_cast(code); + text += 1; + } + else + { + // Insert UTF8 sequence + if (code < 0x80) // 1 byte sequence + { + text[0] = static_cast(code); + text += 1; + } + else if (code < 0x800) // 2 byte sequence + { + text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[0] = static_cast(code | 0xC0); + text += 2; + } + else if (code < 0x10000) // 3 byte sequence + { + text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[0] = static_cast(code | 0xE0); + text += 3; + } + else if (code < 0x110000) // 4 byte sequence + { + text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; + text[0] = static_cast(code | 0xF0); + text += 4; + } + else // Invalid, only codes up to 0x10FFFF are allowed in Unicode + { + CEREAL_RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); + } + } + } + + // Skip characters until predicate evaluates to true + template + static void skip(Ch *&text) + { + Ch *tmp = text; + while (StopPred::test(*tmp)) + ++tmp; + text = tmp; + } + + // Skip characters until predicate evaluates to true while doing the following: + // - replacing XML character entity references with proper characters (' & " < > &#...;) + // - condensing whitespace sequences to single space character + template + static Ch *skip_and_expand_character_refs(Ch *&text, bool preserve_space) + { + // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip + if (Flags & parse_no_entity_translation && + !(Flags & parse_normalize_whitespace) && + !(Flags & parse_trim_whitespace)) + { + skip(text); + return text; + } + + // Use simple skip until first modification is detected + skip(text); + + // Use translation skip + Ch *src = text; + Ch *dest = src; + while (StopPred::test(*src)) + { + // If entity translation is enabled + if (!(Flags & parse_no_entity_translation)) + { + // Test if replacement is needed + if (src[0] == Ch('&')) + { + switch (src[1]) + { + + // & ' + case Ch('a'): + if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) + { + *dest = Ch('&'); + ++dest; + src += 5; + continue; + } + if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) + { + *dest = Ch('\''); + ++dest; + src += 6; + continue; + } + break; + + // " + case Ch('q'): + if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) + { + *dest = Ch('"'); + ++dest; + src += 6; + continue; + } + break; + + // > + case Ch('g'): + if (src[2] == Ch('t') && src[3] == Ch(';')) + { + *dest = Ch('>'); + ++dest; + src += 4; + continue; + } + break; + + // < + case Ch('l'): + if (src[2] == Ch('t') && src[3] == Ch(';')) + { + *dest = Ch('<'); + ++dest; + src += 4; + continue; + } + break; + + // &#...; - assumes ASCII + case Ch('#'): + if (src[2] == Ch('x')) + { + unsigned long code = 0; + src += 3; // Skip &#x + while (1) + { + unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; + if (digit == 0xFF) + break; + code = code * 16 + digit; + ++src; + } + insert_coded_character(dest, code); // Put character in output + } + else + { + unsigned long code = 0; + src += 2; // Skip &# + while (1) + { + unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; + if (digit == 0xFF) + break; + code = code * 10 + digit; + ++src; + } + insert_coded_character(dest, code); // Put character in output + } + if (*src == Ch(';')) + ++src; + else + CEREAL_RAPIDXML_PARSE_ERROR("expected ;", src); + continue; + + // Something else + default: + // Ignore, just copy '&' verbatim + break; + + } + } + } + + // If whitespace condensing is enabled + if ((Flags & parse_normalize_whitespace) && !preserve_space) + { + // Test if condensing is needed + if (whitespace_pred::test(*src)) + { + *dest = Ch(' '); ++dest; // Put single space in dest + ++src; // Skip first whitespace char + // Skip remaining whitespace chars + while (whitespace_pred::test(*src)) + ++src; + continue; + } + } + + // No replacement, only copy character + *dest++ = *src++; + + } + + // Return new end + text = src; + return dest; + + } + + /////////////////////////////////////////////////////////////////////// + // Internal parsing functions + + // Parse BOM, if any + template + void parse_bom(Ch *&text) + { + // UTF-8? + if (static_cast(text[0]) == 0xEF && + static_cast(text[1]) == 0xBB && + static_cast(text[2]) == 0xBF) + { + text += 3; // Skup utf-8 bom + } + } + + // Parse XML declaration ( + xml_node *parse_xml_declaration(Ch *&text) + { + // If parsing of declaration is disabled + if (!(Flags & parse_declaration_node)) + { + // Skip until end of declaration + while (text[0] != Ch('?') || text[1] != Ch('>')) + { + if (!text[0]) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + text += 2; // Skip '?>' + return 0; + } + + // Create declaration + xml_node *declaration = this->allocate_node(node_declaration); + + // Skip whitespace before attributes or ?> + skip(text); + + // Parse declaration attributes + parse_node_attributes(text, declaration); + + // Skip ?> + if (text[0] != Ch('?') || text[1] != Ch('>')) + CEREAL_RAPIDXML_PARSE_ERROR("expected ?>", text); + text += 2; + + return declaration; + } + + // Parse XML comment (' + return 0; // Do not produce comment node + } + + // Remember value start + Ch *value_ = text; + + // Skip until end of comment + while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) + { + if (!text[0]) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + + // Create comment node + xml_node *comment = this->allocate_node(node_comment); + comment->value(value_, static_cast(text - value_)); + + // Place zero terminator after comment value + if (!(Flags & parse_no_string_terminators)) + *text = Ch('\0'); + + text += 3; // Skip '-->' + return comment; + } + + // Parse DOCTYPE + template + xml_node *parse_doctype(Ch *&text) + { + // Remember value start + Ch *value_ = text; + + // Skip to > + while (*text != Ch('>')) + { + // Determine character type + switch (*text) + { + + // If '[' encountered, scan for matching ending ']' using naive algorithm with depth + // This works for all W3C test files except for 2 most wicked + case Ch('['): + { + ++text; // Skip '[' + int depth = 1; + while (depth > 0) + { + switch (*text) + { + case Ch('['): ++depth; break; + case Ch(']'): --depth; break; + case 0: CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + } + ++text; + } + break; + } + + // Error on end of text + case Ch('\0'): + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + + // Other character, skip it + default: + ++text; + + } + } + + // If DOCTYPE nodes enabled + if (Flags & parse_doctype_node) + { + // Create a new doctype node + xml_node *doctype = this->allocate_node(node_doctype); + doctype->value(value_, static_cast(text - value_)); + + // Place zero terminator after value + if (!(Flags & parse_no_string_terminators)) + *text = Ch('\0'); + + text += 1; // skip '>' + return doctype; + } + else + { + text += 1; // skip '>' + return 0; + } + + } + + // Parse PI + template + xml_node *parse_pi(Ch *&text) + { + // If creation of PI nodes is enabled + if (Flags & parse_pi_nodes) + { + // Create pi node + xml_node *pi = this->allocate_node(node_pi); + + // Extract PI target name + Ch *name_ = text; + skip(text); + if (text == name_) + CEREAL_RAPIDXML_PARSE_ERROR("expected PI target", text); + pi->name(name_, static_cast(text - name_)); + + // Skip whitespace between pi target and pi + skip(text); + + // Remember start of pi + Ch *value_ = text; + + // Skip to '?>' + while (text[0] != Ch('?') || text[1] != Ch('>')) + { + if (*text == Ch('\0')) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + + // Set pi value (verbatim, no entity expansion or whitespace normalization) + pi->value(value_, static_cast(text - value_)); + + // Place zero terminator after name and value + if (!(Flags & parse_no_string_terminators)) + { + pi->name()[pi->name_size()] = Ch('\0'); + pi->value()[pi->value_size()] = Ch('\0'); + } + + text += 2; // Skip '?>' + return pi; + } + else + { + // Skip to '?>' + while (text[0] != Ch('?') || text[1] != Ch('>')) + { + if (*text == Ch('\0')) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + text += 2; // Skip '?>' + return 0; + } + } + + // Parse and append data + // Return character that ends data. + // This is necessary because this character might have been overwritten by a terminating 0 + template + Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) + { + // Backup to contents start if whitespace trimming is disabled + if (!(Flags & parse_trim_whitespace)) + text = contents_start; + + const bool preserve_space = internal::preserve_space(node); + + // Skip until end of data + Ch *value_ = text, *end; + if ((Flags & parse_normalize_whitespace) && !preserve_space) + end = skip_and_expand_character_refs(text, false); + else + end = skip_and_expand_character_refs(text, preserve_space); + + // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > + if ((Flags & parse_trim_whitespace) && !preserve_space) + { + if (Flags & parse_normalize_whitespace) + { + // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end + if (*(end - 1) == Ch(' ')) + --end; + } + else + { + // Backup until non-whitespace character is found + while (whitespace_pred::test(*(end - 1))) + --end; + } + } + + // If characters are still left between end and value (this test is only necessary if normalization is enabled) + // Create new data node + if (!(Flags & parse_no_data_nodes)) + { + xml_node *data = this->allocate_node(node_data); + data->value(value_, static_cast(end - value_)); + node->append_node(data); + } + + // Add data to parent node if no data exists yet + if (!(Flags & parse_no_element_values)) + if (*node->value() == Ch('\0')) + node->value(value_, static_cast(end - value_)); + + // Place zero terminator after value + if (!(Flags & parse_no_string_terminators)) + { + Ch ch = *text; + *end = Ch('\0'); + return ch; // Return character that ends data; this is required because zero terminator overwritten it + } + + // Return character that ends data + return *text; + } + + // Parse CDATA + template + xml_node *parse_cdata(Ch *&text) + { + // If CDATA is disabled + if (Flags & parse_no_data_nodes) + { + // Skip until end of cdata + while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) + { + if (!text[0]) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + text += 3; // Skip ]]> + return 0; // Do not produce CDATA node + } + + // Skip until end of cdata + Ch *value_ = text; + while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) + { + if (!text[0]) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + + // Create new cdata node + xml_node *cdata = this->allocate_node(node_cdata); + cdata->value(value_, static_cast(text - value_)); + + // Place zero terminator after value + if (!(Flags & parse_no_string_terminators)) + *text = Ch('\0'); + + text += 3; // Skip ]]> + return cdata; + } + + // Parse element node + template + xml_node *parse_element(Ch *&text) + { + // Create element node + xml_node *element = this->allocate_node(node_element); + + // Extract element name + Ch *name_ = text; + skip(text); + if (text == name_) + CEREAL_RAPIDXML_PARSE_ERROR("expected element name", text); + element->name(name_, static_cast(text - name_)); + + // Skip whitespace between element name and attributes or > + skip(text); + + // Parse attributes, if any + parse_node_attributes(text, element); + + // Determine ending type + if (*text == Ch('>')) + { + ++text; + parse_node_contents(text, element); + } + else if (*text == Ch('/')) + { + ++text; + if (*text != Ch('>')) + CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); + ++text; + } + else + CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); + + // Place zero terminator after name + if (!(Flags & parse_no_string_terminators)) + element->name()[element->name_size()] = Ch('\0'); + + // Return parsed element + return element; + } + + // Determine node type, and parse it + template + xml_node *parse_node(Ch *&text) + { + // Parse proper node type + switch (text[0]) + { + + // <... + default: + // Parse and append element node + return parse_element(text); + + // (text); + } + else + { + // Parse PI + return parse_pi(text); + } + + // (text); + } + break; + + // (text); + } + break; + + // (text); + } + + } // switch + + // Attempt to skip other, unrecognized node types starting with ')) + { + if (*text == 0) + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + ++text; + } + ++text; // Skip '>' + return 0; // No node recognized + + } + } + + // Parse contents of the node - children, data etc. + template + void parse_node_contents(Ch *&text, xml_node *node) + { + // For all children and text + while (1) + { + // Skip whitespace between > and node contents + Ch *contents_start = text; // Store start of node contents before whitespace is skipped + skip(text); + Ch next_char = *text; + + // After data nodes, instead of continuing the loop, control jumps here. + // This is because zero termination inside parse_and_append_data() function + // would wreak havoc with the above code. + // Also, skipping whitespace after data nodes is unnecessary. + after_data_node: + + // Determine what comes next: node closing, child node, data node, or 0? + switch (next_char) + { + + // Node closing or child node + case Ch('<'): + if (text[1] == Ch('/')) + { + Ch *contents_end = 0; + if (internal::preserve_space(node)) + { + contents_end = text; + } + + // Node closing + text += 2; // Skip '(text); + if (!internal::compare(node->name(), node->name_size(), closing_name, static_cast(text - closing_name), true)) + CEREAL_RAPIDXML_PARSE_ERROR("invalid closing tag name", text); + } + else + { + // No validation, just skip name + skip(text); + } + // Skip remaining whitespace after node name + skip(text); + if (*text != Ch('>')) + CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); + ++text; // Skip '>' + + if (contents_end && contents_end != contents_start) + { + node->value(contents_start, static_cast(contents_end - contents_start)); + node->value()[node->value_size()] = Ch('\0'); + } + return; // Node closed, finished parsing contents + } + else + { + // Child node + ++text; // Skip '<' + if (xml_node *child = parse_node(text)) + node->append_node(child); + } + break; + + // End of data - error + case Ch('\0'): + CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); + + // Data node + default: + next_char = parse_and_append_data(node, text, contents_start); + goto after_data_node; // Bypass regular processing after data nodes + + } + } + } + + // Parse XML attributes of the node + template + void parse_node_attributes(Ch *&text, xml_node *node) + { + // For all attributes + while (attribute_name_pred::test(*text)) + { + // Extract attribute name + Ch *name_ = text; + ++text; // Skip first character of attribute name + skip(text); + if (text == name_) + CEREAL_RAPIDXML_PARSE_ERROR("expected attribute name", name_); + + // Create new attribute + xml_attribute *attribute = this->allocate_attribute(); + attribute->name(name_, static_cast(text - name_)); + node->append_attribute(attribute); + + // Skip whitespace after attribute name + skip(text); + + // Skip = + if (*text != Ch('=')) + CEREAL_RAPIDXML_PARSE_ERROR("expected =", text); + ++text; + + // Add terminating zero after name + if (!(Flags & parse_no_string_terminators)) + attribute->name()[attribute->name_size()] = 0; + + // Skip whitespace after = + skip(text); + + // Skip quote and remember if it was ' or " + Ch quote = *text; + if (quote != Ch('\'') && quote != Ch('"')) + CEREAL_RAPIDXML_PARSE_ERROR("expected ' or \"", text); + ++text; + + // Extract attribute value and expand char refs in it + Ch *value_ = text, *end; + const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes + if (quote == Ch('\'')) + end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text, false); + else + end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text, false); + + // Set attribute value + attribute->value(value_, static_cast(end - value_)); + + // Make sure that end quote is present + if (*text != quote) + CEREAL_RAPIDXML_PARSE_ERROR("expected ' or \"", text); + ++text; // Skip quote + + // Add terminating zero after value + if (!(Flags & parse_no_string_terminators)) + attribute->value()[attribute->value_size()] = 0; + + // Skip whitespace after attribute value + skip(text); + } + } + + }; + + //! \cond internal + namespace internal + { + + // Whitespace (space \n \r \t) + template + const unsigned char lookup_tables::lookup_whitespace[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F + }; + + // Node name (anything but space \n \r \t / > ? \0) + template + const unsigned char lookup_tables::lookup_node_name[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Text (i.e. PCDATA) (anything but < \0) + template + const unsigned char lookup_tables::lookup_text[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled + // (anything but < \0 &) + template + const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled + // (anything but < \0 & space \n \r \t) + template + const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Attribute name (anything but space \n \r \t / < > = ? ! \0) + template + const unsigned char lookup_tables::lookup_attribute_name[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Attribute data with single quote (anything but ' \0) + template + const unsigned char lookup_tables::lookup_attribute_data_1[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Attribute data with single quote that does not require processing (anything but ' \0 &) + template + const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Attribute data with double quote (anything but " \0) + template + const unsigned char lookup_tables::lookup_attribute_data_2[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Attribute data with double quote that does not require processing (anything but " \0 &) + template + const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 + 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F + }; + + // Digits (dec and hex, 255 denotes end of numeric character reference) + template + const unsigned char lookup_tables::lookup_digits[256] = + { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 + 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 + 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F + }; + + // Upper case conversion + template + const unsigned char lookup_tables::lookup_upcase[256] = + { + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F + }; + } + //! \endcond + +} +} // end namespace cereal + +// Undefine internal macros +#undef CEREAL_RAPIDXML_PARSE_ERROR + +// On MSVC, restore warnings state +#ifdef _MSC_VER + #pragma warning(pop) +#endif + +#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp new file mode 100644 index 000000000..736d46c39 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp @@ -0,0 +1,175 @@ +#ifndef CEREAL_RAPIDXML_ITERATORS_HPP_INCLUDED +#define CEREAL_RAPIDXML_ITERATORS_HPP_INCLUDED + +// Copyright (C) 2006, 2009 Marcin Kalicinski +// Version 1.13 +// Revision $DateTime: 2009/05/13 01:46:17 $ + +#include "rapidxml.hpp" + +namespace cereal { +namespace rapidxml +{ + + //! Iterator of child nodes of xml_node + template + class node_iterator + { + + public: + + typedef typename xml_node value_type; + typedef typename xml_node &reference; + typedef typename xml_node *pointer; + typedef std::ptrdiff_t difference_type; + typedef std::bidirectional_iterator_tag iterator_category; + + node_iterator() + : m_node(0) + { + } + + node_iterator(xml_node *node) + : m_node(node->first_node()) + { + } + + reference operator *() const + { + assert(m_node); + return *m_node; + } + + pointer operator->() const + { + assert(m_node); + return m_node; + } + + node_iterator& operator++() + { + assert(m_node); + m_node = m_node->next_sibling(); + return *this; + } + + node_iterator operator++(int) + { + node_iterator tmp = *this; + ++this; + return tmp; + } + + node_iterator& operator--() + { + assert(m_node && m_node->previous_sibling()); + m_node = m_node->previous_sibling(); + return *this; + } + + node_iterator operator--(int) + { + node_iterator tmp = *this; + ++this; + return tmp; + } + + bool operator ==(const node_iterator &rhs) + { + return m_node == rhs.m_node; + } + + bool operator !=(const node_iterator &rhs) + { + return m_node != rhs.m_node; + } + + private: + + xml_node *m_node; + + }; + + //! Iterator of child attributes of xml_node + template + class attribute_iterator + { + + public: + + typedef typename xml_attribute value_type; + typedef typename xml_attribute &reference; + typedef typename xml_attribute *pointer; + typedef std::ptrdiff_t difference_type; + typedef std::bidirectional_iterator_tag iterator_category; + + attribute_iterator() + : m_attribute(0) + { + } + + attribute_iterator(xml_node *node) + : m_attribute(node->first_attribute()) + { + } + + reference operator *() const + { + assert(m_attribute); + return *m_attribute; + } + + pointer operator->() const + { + assert(m_attribute); + return m_attribute; + } + + attribute_iterator& operator++() + { + assert(m_attribute); + m_attribute = m_attribute->next_attribute(); + return *this; + } + + attribute_iterator operator++(int) + { + attribute_iterator tmp = *this; + ++this; + return tmp; + } + + attribute_iterator& operator--() + { + assert(m_attribute && m_attribute->previous_attribute()); + m_attribute = m_attribute->previous_attribute(); + return *this; + } + + attribute_iterator operator--(int) + { + attribute_iterator tmp = *this; + ++this; + return tmp; + } + + bool operator ==(const attribute_iterator &rhs) + { + return m_attribute == rhs.m_attribute; + } + + bool operator !=(const attribute_iterator &rhs) + { + return m_attribute != rhs.m_attribute; + } + + private: + + xml_attribute *m_attribute; + + }; + +} +} // namespace cereal + +#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp new file mode 100644 index 000000000..7fbb962e1 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp @@ -0,0 +1,428 @@ +#ifndef CEREAL_RAPIDXML_PRINT_HPP_INCLUDED +#define CEREAL_RAPIDXML_PRINT_HPP_INCLUDED + +// Copyright (C) 2006, 2009 Marcin Kalicinski +// Version 1.13 +// Revision $DateTime: 2009/05/13 01:46:17 $ + +#include "rapidxml.hpp" + +// Only include streams if not disabled +#ifndef CEREAL_RAPIDXML_NO_STREAMS + #include + #include +#endif + +namespace cereal { +namespace rapidxml +{ + + /////////////////////////////////////////////////////////////////////// + // Printing flags + + const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. + + /////////////////////////////////////////////////////////////////////// + // Internal + + //! \cond internal + namespace internal + { + + /////////////////////////////////////////////////////////////////////////// + // Internal character operations + + // Copy characters from given range to given output iterator + template + inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) + { + while (begin != end) + *out++ = *begin++; + return out; + } + + // Copy characters from given range to given output iterator and expand + // characters into references (< > ' " &) + template + inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) + { + while (begin != end) + { + if (*begin == noexpand) + { + *out++ = *begin; // No expansion, copy character + } + else + { + switch (*begin) + { + case Ch('<'): + *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); + break; + case Ch('>'): + *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); + break; + case Ch('\''): + *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); + break; + case Ch('"'): + *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); + break; + case Ch('&'): + *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); + break; + default: + *out++ = *begin; // No expansion, copy character + } + } + ++begin; // Step to next character + } + return out; + } + + // Fill given output iterator with repetitions of the same character + template + inline OutIt fill_chars(OutIt out, int n, Ch ch) + { + for (int i = 0; i < n; ++i) + *out++ = ch; + return out; + } + + // Find character + template + inline bool find_char(const Ch *begin, const Ch *end) + { + while (begin != end) + if (*begin++ == ch) + return true; + return false; + } + + /////////////////////////////////////////////////////////////////////////// + // Internal printing operations + + // Print node + template + inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); + + // Print children of the node + template + inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) + { + for (xml_node *child = node->first_node(); child; child = child->next_sibling()) + out = print_node(out, child, flags, indent); + return out; + } + + // Print attributes of the node + template + inline OutIt print_attributes(OutIt out, const xml_node *node, int /*flags*/) + { + for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) + { + if (attribute->name() && attribute->value()) + { + // Print attribute name + *out = Ch(' '), ++out; + out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); + *out = Ch('='), ++out; + // Print attribute value using appropriate quote type + if (find_char(attribute->value(), attribute->value() + attribute->value_size())) + { + *out = Ch('\''), ++out; + out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); + *out = Ch('\''), ++out; + } + else + { + *out = Ch('"'), ++out; + out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); + *out = Ch('"'), ++out; + } + } + } + return out; + } + + // Print data node + template + inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_data); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); + return out; + } + + // Print data node + template + inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_cdata); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'); ++out; + *out = Ch('!'); ++out; + *out = Ch('['); ++out; + *out = Ch('C'); ++out; + *out = Ch('D'); ++out; + *out = Ch('A'); ++out; + *out = Ch('T'); ++out; + *out = Ch('A'); ++out; + *out = Ch('['); ++out; + out = copy_chars(node->value(), node->value() + node->value_size(), out); + *out = Ch(']'); ++out; + *out = Ch(']'); ++out; + *out = Ch('>'); ++out; + return out; + } + + // Print element node + template + inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_element); + + // Print element name and attributes, if any + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'), ++out; + out = copy_chars(node->name(), node->name() + node->name_size(), out); + out = print_attributes(out, node, flags); + + // If node is childless + if (node->value_size() == 0 && !node->first_node()) + { + // Print childless node tag ending + *out = Ch('/'), ++out; + *out = Ch('>'), ++out; + } + else + { + // Print normal node tag ending + *out = Ch('>'), ++out; + + // Test if node contains a single data node only (and no other nodes) + xml_node *child = node->first_node(); + if (!child) + { + // If node has no children, only print its value without indenting + out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); + } + else if (child->next_sibling() == 0 && child->type() == node_data) + { + // If node has a sole data child, only print its value without indenting + out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); + } + else + { + // Print all children with full indenting + if (!(flags & print_no_indenting)) + *out = Ch('\n'), ++out; + out = print_children(out, node, flags, indent + 1); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + } + + // Print node end + *out = Ch('<'), ++out; + *out = Ch('/'), ++out; + out = copy_chars(node->name(), node->name() + node->name_size(), out); + *out = Ch('>'), ++out; + } + return out; + } + + // Print declaration node + template + inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) + { + // Print declaration start + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'), ++out; + *out = Ch('?'), ++out; + *out = Ch('x'), ++out; + *out = Ch('m'), ++out; + *out = Ch('l'), ++out; + + // Print attributes + out = print_attributes(out, node, flags); + + // Print declaration end + *out = Ch('?'), ++out; + *out = Ch('>'), ++out; + + return out; + } + + // Print comment node + template + inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_comment); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'), ++out; + *out = Ch('!'), ++out; + *out = Ch('-'), ++out; + *out = Ch('-'), ++out; + out = copy_chars(node->value(), node->value() + node->value_size(), out); + *out = Ch('-'), ++out; + *out = Ch('-'), ++out; + *out = Ch('>'), ++out; + return out; + } + + // Print doctype node + template + inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_doctype); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'), ++out; + *out = Ch('!'), ++out; + *out = Ch('D'), ++out; + *out = Ch('O'), ++out; + *out = Ch('C'), ++out; + *out = Ch('T'), ++out; + *out = Ch('Y'), ++out; + *out = Ch('P'), ++out; + *out = Ch('E'), ++out; + *out = Ch(' '), ++out; + out = copy_chars(node->value(), node->value() + node->value_size(), out); + *out = Ch('>'), ++out; + return out; + } + + // Print pi node + template + inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) + { + assert(node->type() == node_pi); + if (!(flags & print_no_indenting)) + out = fill_chars(out, indent, Ch('\t')); + *out = Ch('<'), ++out; + *out = Ch('?'), ++out; + out = copy_chars(node->name(), node->name() + node->name_size(), out); + *out = Ch(' '), ++out; + out = copy_chars(node->value(), node->value() + node->value_size(), out); + *out = Ch('?'), ++out; + *out = Ch('>'), ++out; + return out; + } + + // Print node + template + inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) + { + // Print proper node type + switch (node->type()) + { + + // Document + case node_document: + out = print_children(out, node, flags, indent); + break; + + // Element + case node_element: + out = print_element_node(out, node, flags, indent); + break; + + // Data + case node_data: + out = print_data_node(out, node, flags, indent); + break; + + // CDATA + case node_cdata: + out = print_cdata_node(out, node, flags, indent); + break; + + // Declaration + case node_declaration: + out = print_declaration_node(out, node, flags, indent); + break; + + // Comment + case node_comment: + out = print_comment_node(out, node, flags, indent); + break; + + // Doctype + case node_doctype: + out = print_doctype_node(out, node, flags, indent); + break; + + // Pi + case node_pi: + out = print_pi_node(out, node, flags, indent); + break; + +#ifndef __GNUC__ + // Unknown + default: + assert(0); + break; +#endif + } + + // If indenting not disabled, add line break after node + if (!(flags & print_no_indenting)) + *out = Ch('\n'), ++out; + + // Return modified iterator + return out; + } + + } + //! \endcond + + /////////////////////////////////////////////////////////////////////////// + // Printing + + //! Prints XML to given output iterator. + //! \param out Output iterator to print to. + //! \param node Node to be printed. Pass xml_document to print entire document. + //! \param flags Flags controlling how XML is printed. + //! \return Output iterator pointing to position immediately after last character of printed text. + template + inline OutIt print(OutIt out, const xml_node &node, int flags = 0) + { + return internal::print_node(out, &node, flags, 0); + } + +#ifndef CEREAL_RAPIDXML_NO_STREAMS + + //! Prints XML to given output stream. + //! \param out Output stream to print to. + //! \param node Node to be printed. Pass xml_document to print entire document. + //! \param flags Flags controlling how XML is printed. + //! \return Output stream. + template + inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) + { + print(std::ostream_iterator(out), node, flags); + return out; + } + + //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. + //! \param out Output stream to print to. + //! \param node Node to be printed. + //! \return Output stream. + template + inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) + { + return print(out, node); + } + +#endif + +} +} // namespace cereal + +#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp new file mode 100644 index 000000000..e11ecf319 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp @@ -0,0 +1,123 @@ +#ifndef CEREAL_RAPIDXML_UTILS_HPP_INCLUDED +#define CEREAL_RAPIDXML_UTILS_HPP_INCLUDED + +// Copyright (C) 2006, 2009 Marcin Kalicinski +// Version 1.13 +// Revision $DateTime: 2009/05/13 01:46:17 $ +//! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. + +#include "rapidxml.hpp" +#include +#include +#include +#include + +namespace cereal { +namespace rapidxml +{ + + //! Represents data loaded from a file + template + class file + { + + public: + + //! Loads file into the memory. Data will be automatically destroyed by the destructor. + //! \param filename Filename to load. + file(const char *filename) + { + using namespace std; + + // Open stream + basic_ifstream stream(filename, ios::binary); + if (!stream) + throw runtime_error(string("cannot open file ") + filename); + stream.unsetf(ios::skipws); + + // Determine stream size + stream.seekg(0, ios::end); + size_t size = stream.tellg(); + stream.seekg(0); + + // Load data and add terminating 0 + m_data.resize(size + 1); + stream.read(&m_data.front(), static_cast(size)); + m_data[size] = 0; + } + + //! Loads file into the memory. Data will be automatically destroyed by the destructor + //! \param stream Stream to load from + file(std::basic_istream &stream) + { + using namespace std; + + // Load data and add terminating 0 + stream.unsetf(ios::skipws); + m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); + if (stream.fail() || stream.bad()) + throw runtime_error("error reading stream"); + m_data.push_back(0); + } + + //! Gets file data. + //! \return Pointer to data of file. + Ch *data() + { + return &m_data.front(); + } + + //! Gets file data. + //! \return Pointer to data of file. + const Ch *data() const + { + return &m_data.front(); + } + + //! Gets file data size. + //! \return Size of file data, in characters. + std::size_t size() const + { + return m_data.size(); + } + + private: + + std::vector m_data; // File data + + }; + + //! Counts children of node. Time complexity is O(n). + //! \return Number of children of node + template + inline std::size_t count_children(xml_node *node) + { + xml_node *child = node->first_node(); + std::size_t count = 0; + while (child) + { + ++count; + child = child->next_sibling(); + } + return count; + } + + //! Counts attributes of node. Time complexity is O(n). + //! \return Number of attributes of node + template + inline std::size_t count_attributes(xml_node *node) + { + xml_attribute *attr = node->first_attribute(); + std::size_t count = 0; + while (attr) + { + ++count; + attr = attr->next_attribute(); + } + return count; + } + +} +} // namespace cereal + +#endif diff --git a/cpp/src/cylon/thridparty/cereal/macros.hpp b/cpp/src/cylon/thridparty/cereal/macros.hpp new file mode 100644 index 000000000..85cf9b58c --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/macros.hpp @@ -0,0 +1,156 @@ +/*! \file macros.hpp + \brief Preprocessor macros that can customise the cereal library + + By default, cereal looks for serialization functions with very + specific names, that is: serialize, load, save, load_minimal, + or save_minimal. + + This file allows an advanced user to change these names to conform + to some other style or preference. This is implemented using + preprocessor macros. + + As a result of this, in internal cereal code you will see macros + used for these function names. In user code, you should name + the functions like you normally would and not use the macros + to improve readability. + \ingroup utility */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CEREAL_MACROS_HPP_ +#define CEREAL_MACROS_HPP_ + +#ifndef CEREAL_THREAD_SAFE +//! Whether cereal should be compiled for a threaded environment +/*! This macro causes cereal to use mutexes to control access to + global internal state in a thread safe manner. + + Note that even with this enabled you must still ensure that + archives are accessed by only one thread at a time; it is safe + to use multiple archives in parallel, but not to access one archive + from many places simultaneously. */ +#define CEREAL_THREAD_SAFE 0 +#endif // CEREAL_THREAD_SAFE + +#ifndef CEREAL_SIZE_TYPE +//! Determines the data type used for size_type +/*! cereal uses size_type to ensure that the serialized size of + dynamic containers is compatible across different architectures + (e.g. 32 vs 64 bit), which may use different underlying types for + std::size_t. + + More information can be found in cereal/details/helpers.hpp. + + If you choose to modify this type, ensure that you use a fixed + size type (e.g. uint32_t). */ +#define CEREAL_SIZE_TYPE uint64_t +#endif // CEREAL_SIZE_TYPE + +// ###################################################################### +#ifndef CEREAL_SERIALIZE_FUNCTION_NAME +//! The serialization/deserialization function name to search for. +/*! You can define @c CEREAL_SERIALIZE_FUNCTION_NAME to be different assuming + you do so before this file is included. */ +#define CEREAL_SERIALIZE_FUNCTION_NAME serialize +#endif // CEREAL_SERIALIZE_FUNCTION_NAME + +#ifndef CEREAL_LOAD_FUNCTION_NAME +//! The deserialization (load) function name to search for. +/*! You can define @c CEREAL_LOAD_FUNCTION_NAME to be different assuming you do so + before this file is included. */ +#define CEREAL_LOAD_FUNCTION_NAME load +#endif // CEREAL_LOAD_FUNCTION_NAME + +#ifndef CEREAL_SAVE_FUNCTION_NAME +//! The serialization (save) function name to search for. +/*! You can define @c CEREAL_SAVE_FUNCTION_NAME to be different assuming you do so + before this file is included. */ +#define CEREAL_SAVE_FUNCTION_NAME save +#endif // CEREAL_SAVE_FUNCTION_NAME + +#ifndef CEREAL_LOAD_MINIMAL_FUNCTION_NAME +//! The deserialization (load_minimal) function name to search for. +/*! You can define @c CEREAL_LOAD_MINIMAL_FUNCTION_NAME to be different assuming you do so + before this file is included. */ +#define CEREAL_LOAD_MINIMAL_FUNCTION_NAME load_minimal +#endif // CEREAL_LOAD_MINIMAL_FUNCTION_NAME + +#ifndef CEREAL_SAVE_MINIMAL_FUNCTION_NAME +//! The serialization (save_minimal) function name to search for. +/*! You can define @c CEREAL_SAVE_MINIMAL_FUNCTION_NAME to be different assuming you do so + before this file is included. */ +#define CEREAL_SAVE_MINIMAL_FUNCTION_NAME save_minimal +#endif // CEREAL_SAVE_MINIMAL_FUNCTION_NAME + +// ###################################################################### +//! Defines the CEREAL_NOEXCEPT macro to use instead of noexcept +/*! If a compiler we support does not support noexcept, this macro + will detect this and define CEREAL_NOEXCEPT as a no-op + @internal */ +#if !defined(CEREAL_HAS_NOEXCEPT) + #if defined(__clang__) + #if __has_feature(cxx_noexcept) + #define CEREAL_HAS_NOEXCEPT + #endif + #else // NOT clang + #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \ + defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 + #define CEREAL_HAS_NOEXCEPT + #endif // end GCC/MSVC check + #endif // end NOT clang block + + #ifndef CEREAL_NOEXCEPT + #ifdef CEREAL_HAS_NOEXCEPT + #define CEREAL_NOEXCEPT noexcept + #else + #define CEREAL_NOEXCEPT + #endif // end CEREAL_HAS_NOEXCEPT + #endif // end !defined(CEREAL_HAS_NOEXCEPT) +#endif // ifndef CEREAL_NOEXCEPT + +// ###################################################################### +//! Checks if C++17 is available +//! NOTE: clang v5 has a bug with inline variables, so disable C++17 on that compiler +#if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) \ + && (!defined(__clang__) || __clang_major__ > 5) +#define CEREAL_HAS_CPP17 +#endif + +//! Checks if C++14 is available +#if __cplusplus >= 201402L +#define CEREAL_HAS_CPP14 +#endif + +// ###################################################################### +//! Defines the CEREAL_ALIGNOF macro to use instead of alignof +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define CEREAL_ALIGNOF __alignof +#else // not MSVC 2013 or older +#define CEREAL_ALIGNOF alignof +#endif // end MSVC check + +#endif // CEREAL_MACROS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/specialize.hpp b/cpp/src/cylon/thridparty/cereal/specialize.hpp new file mode 100644 index 000000000..da9c9a5a8 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/specialize.hpp @@ -0,0 +1,139 @@ +/*! \file specialize.hpp + \brief Serialization disambiguation */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CEREAL_SPECIALIZE_HPP_ +#define CEREAL_SPECIALIZE_HPP_ + +namespace cereal +{ + // Forward declaration of access class that users can become friends with + class access; + + // ###################################################################### + //! A specifier used in conjunction with cereal::specialize to disambiguate + //! serialization in special cases + /*! @relates specialize + @ingroup Access */ + enum class specialization + { + member_serialize, //!< Force the use of a member serialize function + member_load_save, //!< Force the use of a member load/save pair + member_load_save_minimal, //!< Force the use of a member minimal load/save pair + non_member_serialize, //!< Force the use of a non-member serialize function + non_member_load_save, //!< Force the use of a non-member load/save pair + non_member_load_save_minimal //!< Force the use of a non-member minimal load/save pair + }; + + //! A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class + /*! cereal attempts to figure out which method of serialization (member vs. non-member serialize + or load/save pair) at compile time. If for some reason cereal cannot find a non-ambiguous way + of serializing a type, it will produce a static assertion complaining about this. + + This can happen because you have both a serialize and load/save pair, or even because a base + class has a serialize (public or private with friend access) and a derived class does not + overwrite this due to choosing some other serialization type. + + Specializing this class will tell cereal to explicitly use the serialization type you specify + and it will not complain about ambiguity in its compile time selection. However, if cereal detects + an ambiguity in specializations, it will continue to issue a static assertion. + + @code{.cpp} + class MyParent + { + friend class cereal::access; + template + void serialize( Archive & ar ) {} + }; + + // Although serialize is private in MyParent, to cereal::access it will look public, + // even through MyDerived + class MyDerived : public MyParent + { + public: + template + void load( Archive & ar ) {} + + template + void save( Archive & ar ) {} + }; + + // The load/save pair in MyDerived is ambiguous because serialize in MyParent can + // be accessed from cereal::access. This looks the same as making serialize public + // in MyParent, making it seem as though MyDerived has both a serialize and a load/save pair. + // cereal will complain about this at compile time unless we disambiguate: + + namespace cereal + { + // This struct specialization will tell cereal which is the right way to serialize the ambiguity + template struct specialize {}; + + // If we only had a disambiguation for a specific archive type, it would look something like this + template <> struct specialize {}; + } + @endcode + + You can also choose to use the macros CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES or + CEREAL_SPECIALIZE_FOR_ARCHIVE if you want to type a little bit less. + + @tparam T The type to specialize the serialization for + @tparam S The specialization type to use for T + @ingroup Access */ + template + struct specialize : public std::false_type {}; + + //! Convenient macro for performing specialization for all archive types + /*! This performs specialization for the specific type for all types of archives. + This macro should be placed at the global namespace. + + @code{cpp} + struct MyType {}; + CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( MyType, cereal::specialization::member_load_save ); + @endcode + + @relates specialize + @ingroup Access */ + #define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( Type, Specialization ) \ + namespace cereal { template struct specialize {}; } + + //! Convenient macro for performing specialization for a single archive type + /*! This performs specialization for the specific type for a single type of archive. + This macro should be placed at the global namespace. + + @code{cpp} + struct MyType {}; + CEREAL_SPECIALIZE_FOR_ARCHIVE( cereal::XMLInputArchive, MyType, cereal::specialization::member_load_save ); + @endcode + + @relates specialize + @ingroup Access */ + #define CEREAL_SPECIALIZE_FOR_ARCHIVE( Archive, Type, Specialization ) \ + namespace cereal { template <> struct specialize {}; } +} + +#endif diff --git a/cpp/src/cylon/thridparty/cereal/types/array.hpp b/cpp/src/cylon/thridparty/cereal/types/array.hpp new file mode 100644 index 000000000..f9d941dbc --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/array.hpp @@ -0,0 +1,79 @@ +/*! \file array.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_ARRAY_HPP_ +#define CEREAL_TYPES_ARRAY_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Saving for std::array primitive types + //! using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array const & array ) + { + ar( binary_data( array.data(), sizeof(array) ) ); + } + + //! Loading for std::array primitive types + //! using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array & array ) + { + ar( binary_data( array.data(), sizeof(array) ) ); + } + + //! Saving for std::array all other types + template inline + typename std::enable_if, Archive>::value + || !std::is_arithmetic::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array const & array ) + { + for( auto const & i : array ) + ar( i ); + } + + //! Loading for std::array all other types + template inline + typename std::enable_if, Archive>::value + || !std::is_arithmetic::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array & array ) + { + for( auto & i : array ) + ar( i ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_ARRAY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/atomic.hpp b/cpp/src/cylon/thridparty/cereal/types/atomic.hpp new file mode 100644 index 000000000..22809a8f0 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/atomic.hpp @@ -0,0 +1,55 @@ +/*! \file atomic.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_ATOMIC_HPP_ +#define CEREAL_TYPES_ATOMIC_HPP_ + +#include +#include + +namespace cereal +{ + //! Serializing (save) for std::atomic + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::atomic const & a ) + { + ar( CEREAL_NVP_("atomic_data", a.load()) ); + } + + //! Serializing (load) for std::atomic + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::atomic & a ) + { + T tmp; + ar( CEREAL_NVP_("atomic_data", tmp) ); + a.store( tmp ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_ATOMIC_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/base_class.hpp b/cpp/src/cylon/thridparty/cereal/types/base_class.hpp new file mode 100644 index 000000000..81130a373 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/base_class.hpp @@ -0,0 +1,203 @@ +/*! \file base_class.hpp + \brief Support for base classes (virtual and non-virtual) + \ingroup OtherTypes */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_BASE_CLASS_HPP_ +#define CEREAL_TYPES_BASE_CLASS_HPP_ + +#include "cylon/thridparty/cereal/details/traits.hpp" +#include "cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp" + +namespace cereal +{ + namespace base_class_detail + { + //! Used to register polymorphic relations and avoid the need to include + //! polymorphic.hpp when no polymorphism is used + /*! @internal */ + template ::value> + struct RegisterPolymorphicBaseClass + { + static void bind() + { } + }; + + //! Polymorphic version + /*! @internal */ + template + struct RegisterPolymorphicBaseClass + { + static void bind() + { detail::RegisterPolymorphicCaster::bind(); } + }; + } + + //! Casts a derived class to its non-virtual base class in a way that safely supports abstract classes + /*! This should be used in cases when a derived type needs to serialize its base type. This is better than directly + using static_cast, as it allows for serialization of pure virtual (abstract) base classes. + + This also automatically registers polymorphic relation between the base and derived class, assuming they + are indeed polymorphic. Note this is not the same as polymorphic type registration. For more information + see the documentation on polymorphism. If using a polymorphic class, be sure to include support for + polymorphism (cereal/types/polymorphic.hpp). + + \sa virtual_base_class + + @code{.cpp} + struct MyBase + { + int x; + + virtual void foo() = 0; + + template + void serialize( Archive & ar ) + { + ar( x ); + } + }; + + struct MyDerived : public MyBase //<-- Note non-virtual inheritance + { + int y; + + virtual void foo() {}; + + template + void serialize( Archive & ar ) + { + ar( cereal::base_class(this) ); + ar( y ); + } + }; + @endcode */ + template + struct base_class : private traits::detail::BaseCastBase + { + template + base_class(Derived const * derived) : + base_ptr(const_cast(static_cast(derived))) + { + static_assert( std::is_base_of::value, "Can only use base_class on a valid base class" ); + base_class_detail::RegisterPolymorphicBaseClass::bind(); + } + + Base * base_ptr; + }; + + //! Casts a derived class to its virtual base class in a way that allows cereal to track inheritance + /*! This should be used in cases when a derived type features virtual inheritance from some + base type. This allows cereal to track the inheritance and to avoid making duplicate copies + during serialization. + + It is safe to use virtual_base_class in all circumstances for serializing base classes, even in cases + where virtual inheritance does not take place, though it may be slightly faster to utilize + cereal::base_class<> if you do not need to worry about virtual inheritance. + + This also automatically registers polymorphic relation between the base and derived class, assuming they + are indeed polymorphic. Note this is not the same as polymorphic type registration. For more information + see the documentation on polymorphism. If using a polymorphic class, be sure to include support for + polymorphism (cereal/types/polymorphic.hpp). + + \sa base_class + + @code{.cpp} + struct MyBase + { + int x; + + template + void serialize( Archive & ar ) + { + ar( x ); + } + }; + + struct MyLeft : virtual MyBase //<-- Note the virtual inheritance + { + int y; + + template + void serialize( Archive & ar ) + { + ar( cereal::virtual_base_class( this ) ); + ar( y ); + } + }; + + struct MyRight : virtual MyBase + { + int z; + + template + void serialize( Archive & ar ) + { + ar( cereal::virtual_base_clas( this ) ); + ar( z ); + } + }; + + // diamond virtual inheritance; contains one copy of each base class + struct MyDerived : virtual MyLeft, virtual MyRight + { + int a; + + template + void serialize( Archive & ar ) + { + ar( cereal::virtual_base_class( this ) ); // safely serialize data members in MyLeft + ar( cereal::virtual_base_class( this ) ); // safely serialize data members in MyRight + ar( a ); + + // Because we used virtual_base_class, cereal will ensure that only one instance of MyBase is + // serialized as we traverse the inheritance heirarchy. This means that there will be one copy + // each of the variables x, y, z, and a + + // If we had chosen to use static_cast<> instead, cereal would perform no tracking and + // assume that every base class should be serialized (in this case leading to a duplicate + // serialization of MyBase due to diamond inheritance + }; + } + @endcode */ + template + struct virtual_base_class : private traits::detail::BaseCastBase + { + template + virtual_base_class(Derived const * derived) : + base_ptr(const_cast(static_cast(derived))) + { + static_assert( std::is_base_of::value, "Can only use virtual_base_class on a valid base class" ); + base_class_detail::RegisterPolymorphicBaseClass::bind(); + } + + Base * base_ptr; + }; + +} // namespace cereal + +#endif // CEREAL_TYPES_BASE_CLASS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/bitset.hpp b/cpp/src/cylon/thridparty/cereal/types/bitset.hpp new file mode 100644 index 000000000..619d9f9d6 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/bitset.hpp @@ -0,0 +1,176 @@ +/*! \file bitset.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_BITSET_HPP_ +#define CEREAL_TYPES_BITSET_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include "cylon/thridparty/cereal/types/string.hpp" +#include + +namespace cereal +{ + namespace bitset_detail + { + //! The type the bitset is encoded with + /*! @internal */ + enum class type : uint8_t + { + ulong, + ullong, + string, + bits + }; + } + + //! Serializing (save) for std::bitset when BinaryData optimization supported + template , Archive>::value> + = traits::sfinae> inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::bitset const & bits ) + { + ar( CEREAL_NVP_("type", bitset_detail::type::bits) ); + + // Serialize 8 bit chunks + std::uint8_t chunk = 0; + std::uint8_t mask = 0x80; + + // Set each chunk using a rotating mask for the current bit + for( std::size_t i = 0; i < N; ++i ) + { + if( bits[i] ) + chunk |= mask; + + mask = static_cast(mask >> 1); + + // output current chunk when mask is empty (8 bits) + if( mask == 0 ) + { + ar( chunk ); + chunk = 0; + mask = 0x80; + } + } + + // serialize remainder, if it exists + if( mask != 0x80 ) + ar( chunk ); + } + + //! Serializing (save) for std::bitset when BinaryData is not supported + template , Archive>::value> + = traits::sfinae> inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::bitset const & bits ) + { + try + { + auto const b = bits.to_ulong(); + ar( CEREAL_NVP_("type", bitset_detail::type::ulong) ); + ar( CEREAL_NVP_("data", b) ); + } + catch( std::overflow_error const & ) + { + try + { + auto const b = bits.to_ullong(); + ar( CEREAL_NVP_("type", bitset_detail::type::ullong) ); + ar( CEREAL_NVP_("data", b) ); + } + catch( std::overflow_error const & ) + { + ar( CEREAL_NVP_("type", bitset_detail::type::string) ); + ar( CEREAL_NVP_("data", bits.to_string()) ); + } + } + } + + //! Serializing (load) for std::bitset + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::bitset & bits ) + { + bitset_detail::type t; + ar( CEREAL_NVP_("type", t) ); + + switch( t ) + { + case bitset_detail::type::ulong: + { + unsigned long b; + ar( CEREAL_NVP_("data", b) ); + bits = std::bitset( b ); + break; + } + case bitset_detail::type::ullong: + { + unsigned long long b; + ar( CEREAL_NVP_("data", b) ); + bits = std::bitset( b ); + break; + } + case bitset_detail::type::string: + { + std::string b; + ar( CEREAL_NVP_("data", b) ); + bits = std::bitset( b ); + break; + } + case bitset_detail::type::bits: + { + // Normally we would use BinaryData to route this at compile time, + // but doing this at runtime doesn't break any old serialization + std::uint8_t chunk = 0; + std::uint8_t mask = 0; + + bits.reset(); + + // Load one chunk at a time, rotating through the chunk + // to set bits in the bitset + for( std::size_t i = 0; i < N; ++i ) + { + if( mask == 0 ) + { + ar( chunk ); + mask = 0x80; + } + + if( chunk & mask ) + bits[i] = 1; + + mask = static_cast(mask >> 1); + } + break; + } + default: + throw Exception("Invalid bitset data representation"); + } + } +} // namespace cereal + +#endif // CEREAL_TYPES_BITSET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp b/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp new file mode 100644 index 000000000..fe7747375 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp @@ -0,0 +1,164 @@ +/*! \file boost_variant.hpp + \brief Support for boost::variant + \ingroup OtherTypes */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_BOOST_VARIANT_HPP_ +#define CEREAL_TYPES_BOOST_VARIANT_HPP_ + +//! @internal +#if defined(_MSC_VER) && _MSC_VER < 1911 +#define CEREAL_CONSTEXPR_LAMBDA +#else // MSVC 2017 or newer, all other compilers +#define CEREAL_CONSTEXPR_LAMBDA constexpr +#endif + +#include "cylon/thridparty/cereal/cereal.hpp" +#include +#include + +namespace cereal +{ + namespace boost_variant_detail + { + //! @internal + template + struct variant_save_visitor : boost::static_visitor<> + { + variant_save_visitor(Archive & ar_) : ar(ar_) {} + + template + void operator()(T const & value) const + { + ar( CEREAL_NVP_("data", value) ); + } + + Archive & ar; + }; + + //! @internal + template + struct LoadAndConstructLoadWrapper + { + using ST = typename std::aligned_storage::type; + + LoadAndConstructLoadWrapper() : + construct( reinterpret_cast( &st ) ) + { } + + ~LoadAndConstructLoadWrapper() + { + if (construct.itsValid) + { + construct->~T(); + } + } + + void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar ) + { + ::cereal::detail::Construct::load_andor_construct( ar, construct ); + } + + ST st; + ::cereal::construct construct; + }; + + //! @internal + template struct load_variant_wrapper; + + //! Avoid serializing variant void_ type + /*! @internal */ + template <> + struct load_variant_wrapper + { + template + static void load_variant( Archive &, Variant & ) + { } + }; + + //! @internal + template + struct load_variant_wrapper + { + // default constructible + template + static void load_variant_impl( Archive & ar, Variant & variant, std::true_type ) + { + T value; + ar( CEREAL_NVP_("data", value) ); + variant = std::move(value); + } + + // not default constructible + template + static void load_variant_impl(Archive & ar, Variant & variant, std::false_type ) + { + LoadAndConstructLoadWrapper loadWrapper; + + ar( CEREAL_NVP_("data", loadWrapper) ); + variant = std::move(*loadWrapper.construct.ptr()); + } + + //! @internal + template + static void load_variant(Archive & ar, Variant & variant) + { + load_variant_impl( ar, variant, typename std::is_default_constructible::type() ); + } + }; + } // namespace boost_variant_detail + + //! Saving for boost::variant + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, boost::variant const & variant ) + { + int32_t which = variant.which(); + ar( CEREAL_NVP_("which", which) ); + boost_variant_detail::variant_save_visitor visitor(ar); + variant.apply_visitor(visitor); + } + + //! Loading for boost::variant + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, boost::variant & variant ) + { + int32_t which; + ar( CEREAL_NVP_("which", which) ); + + using LoadFuncType = void(*)(Archive &, boost::variant &); + CEREAL_CONSTEXPR_LAMBDA LoadFuncType loadFuncArray[] = {&boost_variant_detail::load_variant_wrapper::load_variant...}; + + if(which >= int32_t(sizeof(loadFuncArray)/sizeof(loadFuncArray[0]))) + throw Exception("Invalid 'which' selector when deserializing boost::variant"); + + loadFuncArray[which](ar, variant); + } +} // namespace cereal + +#undef CEREAL_CONSTEXPR_LAMBDA + +#endif // CEREAL_TYPES_BOOST_VARIANT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/chrono.hpp b/cpp/src/cylon/thridparty/cereal/types/chrono.hpp new file mode 100644 index 000000000..da1ef42c0 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/chrono.hpp @@ -0,0 +1,72 @@ +/*! \file chrono.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_CHRONO_HPP_ +#define CEREAL_TYPES_CHRONO_HPP_ + +#include + +namespace cereal +{ + //! Saving std::chrono::duration + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::chrono::duration const & dur ) + { + ar( CEREAL_NVP_("count", dur.count()) ); + } + + //! Loading std::chrono::duration + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::chrono::duration & dur ) + { + R count; + ar( CEREAL_NVP_("count", count) ); + + dur = std::chrono::duration{count}; + } + + //! Saving std::chrono::time_point + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::chrono::time_point const & dur ) + { + ar( CEREAL_NVP_("time_since_epoch", dur.time_since_epoch()) ); + } + + //! Loading std::chrono::time_point + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::chrono::time_point & dur ) + { + D elapsed; + ar( CEREAL_NVP_("time_since_epoch", elapsed) ); + + dur = std::chrono::time_point{elapsed}; + } +} // namespace cereal + +#endif // CEREAL_TYPES_CHRONO_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/common.hpp b/cpp/src/cylon/thridparty/cereal/types/common.hpp new file mode 100644 index 000000000..d9524a17a --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/common.hpp @@ -0,0 +1,129 @@ +/*! \file common.hpp + \brief Support common types - always included automatically + \ingroup OtherTypes */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_COMMON_HPP_ +#define CEREAL_TYPES_COMMON_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" + +namespace cereal +{ + namespace common_detail + { + //! Serialization for arrays if BinaryData is supported and we are arithmetic + /*! @internal */ + template inline + void serializeArray( Archive & ar, T & array, std::true_type /* binary_supported */ ) + { + ar( binary_data( array, sizeof(array) ) ); + } + + //! Serialization for arrays if BinaryData is not supported or we are not arithmetic + /*! @internal */ + template inline + void serializeArray( Archive & ar, T & array, std::false_type /* binary_supported */ ) + { + for( auto & i : array ) + ar( i ); + } + + namespace + { + //! Gets the underlying type of an enum + /*! @internal */ + template + struct enum_underlying_type : std::false_type {}; + + //! Gets the underlying type of an enum + /*! Specialization for when we actually have an enum + @internal */ + template + struct enum_underlying_type { using type = typename std::underlying_type::type; }; + } // anon namespace + + //! Checks if a type is an enum + /*! This is needed over simply calling std::is_enum because the type + traits checking at compile time will attempt to call something like + load_minimal with a special NoConvertRef struct that wraps up the true type. + + This will strip away any of that and also expose the true underlying type. + @internal */ + template + class is_enum + { + private: + using DecayedT = typename std::decay::type; + using StrippedT = typename ::cereal::traits::strip_minimal::type; + + public: + static const bool value = std::is_enum::value; + using type = StrippedT; + using base_type = typename enum_underlying_type::type; + }; + } + + //! Saving for enum types + template inline + typename std::enable_if::value, + typename common_detail::is_enum::base_type>::type + CEREAL_SAVE_MINIMAL_FUNCTION_NAME( Archive const &, T const & t ) + { + return static_cast::base_type>(t); + } + + //! Loading for enum types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_MINIMAL_FUNCTION_NAME( Archive const &, T && t, + typename common_detail::is_enum::base_type const & value ) + { + t = reinterpret_cast::type const &>( value ); + } + + //! Serialization for raw pointers + /*! This exists only to throw a static_assert to let users know we don't support raw pointers. */ + template inline + void CEREAL_SERIALIZE_FUNCTION_NAME( Archive &, T * & ) + { + static_assert(cereal::traits::detail::delay_static_assert::value, + "Cereal does not support serializing raw pointers - please use a smart pointer"); + } + + //! Serialization for C style arrays + template inline + typename std::enable_if::value, void>::type + CEREAL_SERIALIZE_FUNCTION_NAME(Archive & ar, T & array) + { + common_detail::serializeArray( ar, array, + std::integral_constant, Archive>::value && + std::is_arithmetic::type>::value>() ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_COMMON_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/complex.hpp b/cpp/src/cylon/thridparty/cereal/types/complex.hpp new file mode 100644 index 000000000..b9b86918e --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/complex.hpp @@ -0,0 +1,56 @@ +/*! \file complex.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_COMPLEX_HPP_ +#define CEREAL_TYPES_COMPLEX_HPP_ + +#include + +namespace cereal +{ + //! Serializing (save) for std::complex + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::complex const & comp ) + { + ar( CEREAL_NVP_("real", comp.real()), + CEREAL_NVP_("imag", comp.imag()) ); + } + + //! Serializing (load) for std::complex + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::complex & bits ) + { + T real, imag; + ar( CEREAL_NVP_("real", real), + CEREAL_NVP_("imag", imag) ); + bits = {real, imag}; + } +} // namespace cereal + +#endif // CEREAL_TYPES_COMPLEX_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp b/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp new file mode 100644 index 000000000..7ad39e69e --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp @@ -0,0 +1,73 @@ +/*! \file pair_associative_container.hpp + \brief Support for the PairAssociativeContainer refinement of the + AssociativeContainer concept. + \ingroup TypeConcepts */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ +#define CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" + +namespace cereal +{ + //! Saving for std-like pair associative containers + template class Map, typename... Args, typename = typename Map::mapped_type> inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, Map const & map ) + { + ar( make_size_tag( static_cast(map.size()) ) ); + + for( const auto & i : map ) + ar( make_map_item(i.first, i.second) ); + } + + //! Loading for std-like pair associative containers + template class Map, typename... Args, typename = typename Map::mapped_type> inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, Map & map ) + { + size_type size; + ar( make_size_tag( size ) ); + + map.clear(); + + auto hint = map.begin(); + for( size_t i = 0; i < size; ++i ) + { + typename Map::key_type key; + typename Map::mapped_type value; + + ar( make_map_item(key, value) ); + #ifdef CEREAL_OLDER_GCC + hint = map.insert( hint, std::make_pair(std::move(key), std::move(value)) ); + #else // NOT CEREAL_OLDER_GCC + hint = map.emplace_hint( hint, std::move( key ), std::move( value ) ); + #endif // NOT CEREAL_OLDER_GCC + } + } +} // namespace cereal + +#endif // CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/deque.hpp b/cpp/src/cylon/thridparty/cereal/types/deque.hpp new file mode 100644 index 000000000..0eb8d1e62 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/deque.hpp @@ -0,0 +1,62 @@ +/*! \file deque.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_DEQUE_HPP_ +#define CEREAL_TYPES_DEQUE_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Saving for std::deque + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::deque const & deque ) + { + ar( make_size_tag( static_cast(deque.size()) ) ); + + for( auto const & i : deque ) + ar( i ); + } + + //! Loading for std::deque + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::deque & deque ) + { + size_type size; + ar( make_size_tag( size ) ); + + deque.resize( static_cast( size ) ); + + for( auto & i : deque ) + ar( i ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_DEQUE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp b/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp new file mode 100644 index 000000000..22aa7262f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp @@ -0,0 +1,68 @@ +/*! \file forward_list.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_FORWARD_LIST_HPP_ +#define CEREAL_TYPES_FORWARD_LIST_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Saving for std::forward_list all other types + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::forward_list const & forward_list ) + { + // write the size - note that this is slow because we need to traverse + // the entire list. there are ways we could avoid this but this was chosen + // since it works in the most general fashion with any archive type + size_type const size = std::distance( forward_list.begin(), forward_list.end() ); + + ar( make_size_tag( size ) ); + + // write the list + for( const auto & i : forward_list ) + ar( i ); + } + + //! Loading for std::forward_list all other types from + template + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::forward_list & forward_list ) + { + size_type size; + ar( make_size_tag( size ) ); + + forward_list.resize( static_cast( size ) ); + + for( auto & i : forward_list ) + ar( i ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_FORWARD_LIST_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/functional.hpp b/cpp/src/cylon/thridparty/cereal/types/functional.hpp new file mode 100644 index 000000000..0b9cdf3fc --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/functional.hpp @@ -0,0 +1,43 @@ +/*! \file functional.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2016, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_FUNCTIONAL_HPP_ +#define CEREAL_TYPES_FUNCTIONAL_HPP_ + +#include + +namespace cereal +{ + //! Saving for std::less + template inline + void serialize( Archive &, std::less & ) + { } +} // namespace cereal + +#endif // CEREAL_TYPES_FUNCTIONAL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/list.hpp b/cpp/src/cylon/thridparty/cereal/types/list.hpp new file mode 100644 index 000000000..36143ab25 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/list.hpp @@ -0,0 +1,62 @@ +/*! \file list.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_LIST_HPP_ +#define CEREAL_TYPES_LIST_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Saving for std::list + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::list const & list ) + { + ar( make_size_tag( static_cast(list.size()) ) ); + + for( auto const & i : list ) + ar( i ); + } + + //! Loading for std::list + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::list & list ) + { + size_type size; + ar( make_size_tag( size ) ); + + list.resize( static_cast( size ) ); + + for( auto & i : list ) + ar( i ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_LIST_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/map.hpp b/cpp/src/cylon/thridparty/cereal/types/map.hpp new file mode 100644 index 000000000..1ef4910f1 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/map.hpp @@ -0,0 +1,36 @@ +/*! \file map.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_MAP_HPP_ +#define CEREAL_TYPES_MAP_HPP_ + +#include "cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp" +#include + +#endif // CEREAL_TYPES_MAP_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/memory.hpp b/cpp/src/cylon/thridparty/cereal/types/memory.hpp new file mode 100644 index 000000000..31d0095b0 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/memory.hpp @@ -0,0 +1,425 @@ +/*! \file memory.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_SHARED_PTR_HPP_ +#define CEREAL_TYPES_SHARED_PTR_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include +#include + +namespace cereal +{ + namespace memory_detail + { + //! A wrapper class to notify cereal that it is ok to serialize the contained pointer + /*! This mechanism allows us to intercept and properly handle polymorphic pointers + @internal */ + template + struct PtrWrapper + { + PtrWrapper(T && p) : ptr(std::forward(p)) {} + T & ptr; + + PtrWrapper( PtrWrapper const & ) = default; + PtrWrapper & operator=( PtrWrapper const & ) = delete; + }; + + //! Make a PtrWrapper + /*! @internal */ + template inline + PtrWrapper make_ptr_wrapper(T && t) + { + return {std::forward(t)}; + } + + //! A struct that acts as a wrapper around calling load_andor_construct + /*! The purpose of this is to allow a load_and_construct call to properly enter into the + 'data' NVP of the ptr_wrapper + @internal */ + template + struct LoadAndConstructLoadWrapper + { + LoadAndConstructLoadWrapper( T * ptr ) : + construct( ptr ) + { } + + //! Constructor for embedding an early call for restoring shared_from_this + template + LoadAndConstructLoadWrapper( T * ptr, F && sharedFromThisFunc ) : + construct( ptr, sharedFromThisFunc ) + { } + + inline void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar ) + { + ::cereal::detail::Construct::load_andor_construct( ar, construct ); + } + + ::cereal::construct construct; + }; + + //! A helper struct for saving and restoring the state of types that derive from + //! std::enable_shared_from_this + /*! This special struct is necessary because when a user uses load_and_construct, + the weak_ptr (or whatever implementation defined variant) that allows + enable_shared_from_this to function correctly will not be initialized properly. + + This internal weak_ptr can also be modified by the shared_ptr that is created + during the serialization of a polymorphic pointer, where cereal creates a + wrapper shared_ptr out of a void pointer to the real data. + + In the case of load_and_construct, this happens because it is the allocation + of shared_ptr that perform this initialization, which we let happen on a buffer + of memory (aligned_storage). This buffer is then used for placement new + later on, effectively overwriting any initialized weak_ptr with a default + initialized one, eventually leading to issues when the user calls shared_from_this. + + To get around these issues, we will store the memory for the enable_shared_from_this + portion of the class and replace it after whatever happens to modify it (e.g. the + user performing construction or the wrapper shared_ptr in saving). + + Note that this goes into undefined behavior territory, but as of the initial writing + of this, all standard library implementations of std::enable_shared_from_this are + compatible with this memory manipulation. It is entirely possible that this may someday + break or may not work with convoluted use cases. + + Example usage: + + @code{.cpp} + T * myActualPointer; + { + EnableSharedStateHelper helper( myActualPointer ); // save the state + std::shared_ptr myPtr( myActualPointer ); // modifies the internal weak_ptr + // helper restores state when it goes out of scope + } + @endcode + + When possible, this is designed to be used in an RAII fashion - it will save state on + construction and restore it on destruction. The restore can be done at an earlier time + (e.g. after construct() is called in load_and_construct) in which case the destructor will + do nothing. Performing the restore immediately following construct() allows a user to call + shared_from_this within their load_and_construct function. + + @tparam T Type pointed to by shared_ptr + @internal */ + template + class EnableSharedStateHelper + { + // typedefs for parent type and storage type + using BaseType = typename ::cereal::traits::get_shared_from_this_base::type; + using ParentType = std::enable_shared_from_this; + using StorageType = typename std::aligned_storage::type; + + public: + //! Saves the state of some type inheriting from enable_shared_from_this + /*! @param ptr The raw pointer held by the shared_ptr */ + inline EnableSharedStateHelper( T * ptr ) : + itsPtr( static_cast( ptr ) ), + itsState(), + itsRestored( false ) + { + std::memcpy( &itsState, itsPtr, sizeof(ParentType) ); + } + + //! Restores the state of the held pointer (can only be done once) + inline void restore() + { + if( !itsRestored ) + { + // void * cast needed when type has no trivial copy-assignment + std::memcpy( static_cast(itsPtr), &itsState, sizeof(ParentType) ); + itsRestored = true; + } + } + + //! Restores the state of the held pointer if not done previously + inline ~EnableSharedStateHelper() + { + restore(); + } + + private: + ParentType * itsPtr; + StorageType itsState; + bool itsRestored; + }; // end EnableSharedStateHelper + + //! Performs loading and construction for a shared pointer that is derived from + //! std::enable_shared_from_this + /*! @param ar The archive + @param ptr Raw pointer held by the shared_ptr + @internal */ + template inline + void loadAndConstructSharedPtr( Archive & ar, T * ptr, std::true_type /* has_shared_from_this */ ) + { + memory_detail::EnableSharedStateHelper state( ptr ); + memory_detail::LoadAndConstructLoadWrapper loadWrapper( ptr, [&](){ state.restore(); } ); + + // let the user perform their initialization, shared state will be restored as soon as construct() + // is called + ar( CEREAL_NVP_("data", loadWrapper) ); + } + + //! Performs loading and construction for a shared pointer that is NOT derived from + //! std::enable_shared_from_this + /*! This is the typical case, where we simply pass the load wrapper to the + archive. + + @param ar The archive + @param ptr Raw pointer held by the shared_ptr + @internal */ + template inline + void loadAndConstructSharedPtr( Archive & ar, T * ptr, std::false_type /* has_shared_from_this */ ) + { + memory_detail::LoadAndConstructLoadWrapper loadWrapper( ptr ); + ar( CEREAL_NVP_("data", loadWrapper) ); + } + } // end namespace memory_detail + + //! Saving std::shared_ptr for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); + } + + //! Loading std::shared_ptr, case when no user load and construct for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::shared_ptr & ptr ) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); + } + + //! Saving std::weak_ptr for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::weak_ptr const & ptr ) + { + auto const sptr = ptr.lock(); + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( sptr )) ); + } + + //! Loading std::weak_ptr for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::weak_ptr & ptr ) + { + std::shared_ptr sptr; + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( sptr )) ); + ptr = sptr; + } + + //! Saving std::unique_ptr for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); + } + + //! Loading std::unique_ptr, case when user provides load_and_construct for non polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unique_ptr & ptr ) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); + } + + // ###################################################################### + // Pointer wrapper implementations follow below + + //! Saving std::shared_ptr (wrapper implementation) + /*! @internal */ + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper const &> const & wrapper ) + { + auto & ptr = wrapper.ptr; + + uint32_t id = ar.registerSharedPointer( ptr ); + ar( CEREAL_NVP_("id", id) ); + + if( id & detail::msb_32bit ) + { + ar( CEREAL_NVP_("data", *ptr) ); + } + } + + //! Loading std::shared_ptr, case when user load and construct (wrapper implementation) + /*! @internal */ + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) + { + uint32_t id; + + ar( CEREAL_NVP_("id", id) ); + + if( id & detail::msb_32bit ) + { + // Storage type for the pointer - since we can't default construct this type, + // we'll allocate it using std::aligned_storage and use a custom deleter + using AlignedStorage = typename std::aligned_storage::type; + + // Valid flag - set to true once construction finishes + // This prevents us from calling the destructor on + // uninitialized data. + auto valid = std::make_shared( false ); + + // Allocate our storage, which we will treat as + // uninitialized until initialized with placement new + using NonConstT = typename std::remove_const::type; + std::shared_ptr ptr(reinterpret_cast(new AlignedStorage()), + [=]( NonConstT * t ) + { + if( *valid ) + t->~T(); + + delete reinterpret_cast( t ); + } ); + + // Register the pointer + ar.registerSharedPointer( id, ptr ); + + // Perform the actual loading and allocation + memory_detail::loadAndConstructSharedPtr( ar, ptr.get(), typename ::cereal::traits::has_shared_from_this::type() ); + + // Mark pointer as valid (initialized) + *valid = true; + wrapper.ptr = std::move(ptr); + } + else + wrapper.ptr = std::static_pointer_cast(ar.getSharedPointer(id)); + } + + //! Loading std::shared_ptr, case when no user load and construct (wrapper implementation) + /*! @internal */ + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) + { + uint32_t id; + + ar( CEREAL_NVP_("id", id) ); + + if( id & detail::msb_32bit ) + { + using NonConstT = typename std::remove_const::type; + std::shared_ptr ptr( detail::Construct::load_andor_construct() ); + ar.registerSharedPointer( id, ptr ); + ar( CEREAL_NVP_("data", *ptr) ); + wrapper.ptr = std::move(ptr); + } + else + wrapper.ptr = std::static_pointer_cast(ar.getSharedPointer(id)); + } + + //! Saving std::unique_ptr (wrapper implementation) + /*! @internal */ + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper const &> const & wrapper ) + { + auto & ptr = wrapper.ptr; + + // unique_ptr get one byte of metadata which signifies whether they were a nullptr + // 0 == nullptr + // 1 == not null + + if( !ptr ) + ar( CEREAL_NVP_("valid", uint8_t(0)) ); + else + { + ar( CEREAL_NVP_("valid", uint8_t(1)) ); + ar( CEREAL_NVP_("data", *ptr) ); + } + } + + //! Loading std::unique_ptr, case when user provides load_and_construct (wrapper implementation) + /*! @internal */ + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) + { + uint8_t isValid; + ar( CEREAL_NVP_("valid", isValid) ); + + auto & ptr = wrapper.ptr; + + if( isValid ) + { + using NonConstT = typename std::remove_const::type; + // Storage type for the pointer - since we can't default construct this type, + // we'll allocate it using std::aligned_storage + using AlignedStorage = typename std::aligned_storage::type; + + // Allocate storage - note the AlignedStorage type so that deleter is correct if + // an exception is thrown before we are initialized + std::unique_ptr stPtr( new AlignedStorage() ); + + // Use wrapper to enter into "data" nvp of ptr_wrapper + memory_detail::LoadAndConstructLoadWrapper loadWrapper( reinterpret_cast( stPtr.get() ) ); + + // Initialize storage + ar( CEREAL_NVP_("data", loadWrapper) ); + + // Transfer ownership to correct unique_ptr type + ptr.reset( reinterpret_cast( stPtr.release() ) ); + } + else + ptr.reset( nullptr ); + } + + //! Loading std::unique_ptr, case when no load_and_construct (wrapper implementation) + /*! @internal */ + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) + { + uint8_t isValid; + ar( CEREAL_NVP_("valid", isValid) ); + + if( isValid ) + { + using NonConstT = typename std::remove_const::type; + std::unique_ptr ptr( detail::Construct::load_andor_construct() ); + ar( CEREAL_NVP_( "data", *ptr ) ); + wrapper.ptr = std::move(ptr); + } + else + { + wrapper.ptr.reset( nullptr ); + } + } +} // namespace cereal + +// automatically include polymorphic support +#include "cereal/types/polymorphic.hpp" + +#endif // CEREAL_TYPES_SHARED_PTR_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/optional.hpp b/cpp/src/cylon/thridparty/cereal/types/optional.hpp new file mode 100644 index 000000000..402ce0abd --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/optional.hpp @@ -0,0 +1,65 @@ +/*! \file optional.hpp + \brief Support for std::optional + \ingroup STLSupport */ +/* + Copyright (c) 2017, Juan Pedro Bolivar Puente + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_STD_OPTIONAL_ +#define CEREAL_TYPES_STD_OPTIONAL_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal { + //! Saving for std::optional + template inline + void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, const std::optional& optional) + { + if(!optional) { + ar(CEREAL_NVP_("nullopt", true)); + } else { + ar(CEREAL_NVP_("nullopt", false), + CEREAL_NVP_("data", *optional)); + } + } + + //! Loading for std::optional + template inline + void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, std::optional& optional) + { + bool nullopt; + ar(CEREAL_NVP_("nullopt", nullopt)); + + if (nullopt) { + optional = std::nullopt; + } else { + optional.emplace(); + ar(CEREAL_NVP_("data", *optional)); + } + } +} // namespace cereal + +#endif // CEREAL_TYPES_STD_OPTIONAL_ diff --git a/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp b/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp new file mode 100644 index 000000000..c41a1e8ff --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp @@ -0,0 +1,483 @@ +/*! \file polymorphic.hpp + \brief Support for pointers to polymorphic base classes + \ingroup OtherTypes */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_POLYMORPHIC_HPP_ +#define CEREAL_TYPES_POLYMORPHIC_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include "cylon/thridparty/cereal/types/memory.hpp" + +#include "cylon/thridparty/cereal/details/util.hpp" +#include "cylon/thridparty/cereal/details/helpers.hpp" +#include "cylon/thridparty/cereal/details/traits.hpp" +#include "cylon/thridparty/cereal/details/polymorphic_impl.hpp" + +#if defined(_MSC_VER) && _MSC_VER < 1916 +#define CEREAL_STATIC_CONSTEXPR static +#else +#define CEREAL_STATIC_CONSTEXPR static constexpr +#endif + +//! Registers a derived polymorphic type with cereal +/*! Polymorphic types must be registered before smart + pointers to them can be serialized. Note that base + classes do not need to be registered. + + Registering a type lets cereal know how to properly + serialize it when a smart pointer to a base object is + used in conjunction with a derived class. + + This assumes that all relevant archives have also + previously been registered. Registration for archives + is usually done in the header file in which they are + defined. This means that type registration needs to + happen after specific archives to be used are included. + + It is recommended that type registration be done in + the header file in which the type is declared. + + Registration can also be placed in a source file, + but this may require the use of the + CEREAL_REGISTER_DYNAMIC_INIT macro (see below). + + Registration may be called repeatedly for the same + type in different translation units to add support + for additional archives if they are not initially + available (included and registered). + + When building serialization support as a DLL on + Windows, registration must happen in the header file. + On Linux and Mac things should still work properly + if placed in a source file, but see the above comments + on registering in source files. + + Polymorphic support in cereal requires RTTI to be + enabled */ +#define CEREAL_REGISTER_TYPE(...) \ + namespace cereal { \ + namespace detail { \ + template <> \ + struct binding_name<__VA_ARGS__> \ + { \ + CEREAL_STATIC_CONSTEXPR char const * name() { return #__VA_ARGS__; } \ + }; \ + } } /* end namespaces */ \ + CEREAL_BIND_TO_ARCHIVES(__VA_ARGS__) + +//! Registers a polymorphic type with cereal, giving it a +//! user defined name +/*! In some cases the default name used with + CEREAL_REGISTER_TYPE (the name of the type) may not be + suitable. This macro allows any name to be associated + with the type. The name should be unique */ +#define CEREAL_REGISTER_TYPE_WITH_NAME(T, Name) \ + namespace cereal { \ + namespace detail { \ + template <> \ + struct binding_name \ + { CEREAL_STATIC_CONSTEXPR char const * name() { return Name; } }; \ + } } /* end namespaces */ \ + CEREAL_BIND_TO_ARCHIVES(T) + +//! Registers the base-derived relationship for a polymorphic type +/*! When polymorphic serialization occurs, cereal needs to know how to + properly cast between derived and base types for the polymorphic + type. Normally this happens automatically whenever cereal::base_class + or cereal::virtual_base_class are used to serialize a base class. In + cases where neither of these is ever called but a base class still + exists, this explicit registration is required. + + The Derived class should be the most derived type that will be serialized, + and the Base type any possible base that has not been covered under a base + class serialization that will be used to store a Derived pointer. + + Placement of this is the same as for CEREAL_REGISTER_TYPE. */ +#define CEREAL_REGISTER_POLYMORPHIC_RELATION(Base, Derived) \ + namespace cereal { \ + namespace detail { \ + template <> \ + struct PolymorphicRelation \ + { static void bind() { RegisterPolymorphicCaster::bind(); } }; \ + } } /* end namespaces */ + +//! Adds a way to force initialization of a translation unit containing +//! calls to CEREAL_REGISTER_TYPE +/*! In C++, dynamic initialization of non-local variables of a translation + unit may be deferred until "the first odr-use of any function or variable + defined in the same translation unit as the variable to be initialized." + + Informally, odr-use means that your program takes the address of or binds + a reference directly to an object, which must have a definition. + + Since polymorphic type support in cereal relies on the dynamic + initialization of certain global objects happening before + serialization is performed, it is important to ensure that something + from files that call CEREAL_REGISTER_TYPE is odr-used before serialization + occurs, otherwise the registration will never take place. This may often + be the case when serialization is built as a shared library external from + your main program. + + This macro, with any name of your choosing, should be placed into the + source file that contains calls to CEREAL_REGISTER_TYPE. + + Its counterpart, CEREAL_FORCE_DYNAMIC_INIT, should be placed in its + associated header file such that it is included in the translation units + (source files) in which you want the registration to appear. + + @relates CEREAL_FORCE_DYNAMIC_INIT + */ +#define CEREAL_REGISTER_DYNAMIC_INIT(LibName) \ + namespace cereal { \ + namespace detail { \ + void CEREAL_DLL_EXPORT dynamic_init_dummy_##LibName() {} \ + } } /* end namespaces */ + +//! Forces dynamic initialization of polymorphic support in a +//! previously registered source file +/*! @sa CEREAL_REGISTER_DYNAMIC_INIT + + See CEREAL_REGISTER_DYNAMIC_INIT for detailed explanation + of how this macro should be used. The name used should + match that for CEREAL_REGISTER_DYNAMIC_INIT. */ +#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \ + namespace cereal { \ + namespace detail { \ + void CEREAL_DLL_EXPORT dynamic_init_dummy_##LibName(); \ + } /* end detail */ \ + } /* end cereal */ \ + namespace { \ + struct dynamic_init_##LibName { \ + dynamic_init_##LibName() { \ + ::cereal::detail::dynamic_init_dummy_##LibName(); \ + } \ + } dynamic_init_instance_##LibName; \ + } /* end anonymous namespace */ + +namespace cereal +{ + namespace polymorphic_detail + { + //! Error message used for unregistered polymorphic types + /*! @internal */ + #define UNREGISTERED_POLYMORPHIC_EXCEPTION(LoadSave, Name) \ + throw cereal::Exception("Trying to " #LoadSave " an unregistered polymorphic type (" + Name + ").\n" \ + "Make sure your type is registered with CEREAL_REGISTER_TYPE and that the archive " \ + "you are using was included (and registered with CEREAL_REGISTER_ARCHIVE) prior to calling CEREAL_REGISTER_TYPE.\n" \ + "If your type is already registered and you still see this error, you may need to use CEREAL_REGISTER_DYNAMIC_INIT."); + + //! Get an input binding from the given archive by deserializing the type meta data + /*! @internal */ + template inline + typename ::cereal::detail::InputBindingMap::Serializers getInputBinding(Archive & ar, std::uint32_t const nameid) + { + // If the nameid is zero, we serialized a null pointer + if(nameid == 0) + { + typename ::cereal::detail::InputBindingMap::Serializers emptySerializers; + emptySerializers.shared_ptr = [](void*, std::shared_ptr & ptr, std::type_info const &) { ptr.reset(); }; + emptySerializers.unique_ptr = [](void*, std::unique_ptr> & ptr, std::type_info const &) { ptr.reset( nullptr ); }; + return emptySerializers; + } + + std::string name; + if(nameid & detail::msb_32bit) + { + ar( CEREAL_NVP_("polymorphic_name", name) ); + ar.registerPolymorphicName(nameid, name); + } + else + name = ar.getPolymorphicName(nameid); + + auto const & bindingMap = detail::StaticObject>::getInstance().map; + + auto binding = bindingMap.find(name); + if(binding == bindingMap.end()) + UNREGISTERED_POLYMORPHIC_EXCEPTION(load, name) + return binding->second; + } + + //! Serialize a shared_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee + /*! This check lets us try and skip doing polymorphic machinery if we can get away with + using the derived class serialize function + + Note that on MSVC 2013 preview, is_default_constructible returns true for abstract classes with + default constructors, but on clang/gcc this will return false. So we also need to check for that here. + @internal */ + template inline + typename std::enable_if<(traits::is_default_constructible::value + || traits::has_load_and_construct::value) + && !std::is_abstract::value, bool>::type + serialize_wrapper(Archive & ar, std::shared_ptr & ptr, std::uint32_t const nameid) + { + if(nameid & detail::msb2_32bit) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); + return true; + } + return false; + } + + //! Serialize a unique_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee + /*! This check lets us try and skip doing polymorphic machinery if we can get away with + using the derived class serialize function + @internal */ + template inline + typename std::enable_if<(traits::is_default_constructible::value + || traits::has_load_and_construct::value) + && !std::is_abstract::value, bool>::type + serialize_wrapper(Archive & ar, std::unique_ptr & ptr, std::uint32_t const nameid) + { + if(nameid & detail::msb2_32bit) + { + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); + return true; + } + return false; + } + + //! Serialize a shared_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee + /*! This case is for when we can't actually construct the shared pointer. Normally this would be caught + as the pointer itself is serialized, but since this is a polymorphic pointer, if we tried to serialize + the pointer we'd end up back here recursively. So we have to catch the error here as well, if + this was a polymorphic type serialized by its proper pointer type + @internal */ + template inline + typename std::enable_if<(!traits::is_default_constructible::value + && !traits::has_load_and_construct::value) + || std::is_abstract::value, bool>::type + serialize_wrapper(Archive &, std::shared_ptr &, std::uint32_t const nameid) + { + if(nameid & detail::msb2_32bit) + throw cereal::Exception("Cannot load a polymorphic type that is not default constructable and does not have a load_and_construct function"); + return false; + } + + //! Serialize a unique_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee + /*! This case is for when we can't actually construct the unique pointer. Normally this would be caught + as the pointer itself is serialized, but since this is a polymorphic pointer, if we tried to serialize + the pointer we'd end up back here recursively. So we have to catch the error here as well, if + this was a polymorphic type serialized by its proper pointer type + @internal */ + template inline + typename std::enable_if<(!traits::is_default_constructible::value + && !traits::has_load_and_construct::value) + || std::is_abstract::value, bool>::type + serialize_wrapper(Archive &, std::unique_ptr &, std::uint32_t const nameid) + { + if(nameid & detail::msb2_32bit) + throw cereal::Exception("Cannot load a polymorphic type that is not default constructable and does not have a load_and_construct function"); + return false; + } + } // polymorphic_detail + + // ###################################################################### + // Pointer serialization for polymorphic types + + //! Saving std::shared_ptr for polymorphic types, abstract + template inline + typename std::enable_if::value && std::is_abstract::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) + { + if(!ptr) + { + // same behavior as nullptr in memory implementation + ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); + return; + } + + std::type_info const & ptrinfo = typeid(*ptr.get()); + static std::type_info const & tinfo = typeid(T); + // ptrinfo can never be equal to T info since we can't have an instance + // of an abstract object + // this implies we need to do the lookup + + auto const & bindingMap = detail::StaticObject>::getInstance().map; + + auto binding = bindingMap.find(std::type_index(ptrinfo)); + if(binding == bindingMap.end()) + UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) + + binding->second.shared_ptr(&ar, ptr.get(), tinfo); + } + + //! Saving std::shared_ptr for polymorphic types, not abstract + template inline + typename std::enable_if::value && !std::is_abstract::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) + { + if(!ptr) + { + // same behavior as nullptr in memory implementation + ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); + return; + } + + std::type_info const & ptrinfo = typeid(*ptr.get()); + static std::type_info const & tinfo = typeid(T); + + if(ptrinfo == tinfo) + { + // The 2nd msb signals that the following pointer does not need to be + // cast with our polymorphic machinery + ar( CEREAL_NVP_("polymorphic_id", detail::msb2_32bit) ); + + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); + + return; + } + + auto const & bindingMap = detail::StaticObject>::getInstance().map; + + auto binding = bindingMap.find(std::type_index(ptrinfo)); + if(binding == bindingMap.end()) + UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) + + binding->second.shared_ptr(&ar, ptr.get(), tinfo); + } + + //! Loading std::shared_ptr for polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::shared_ptr & ptr ) + { + std::uint32_t nameid; + ar( CEREAL_NVP_("polymorphic_id", nameid) ); + + // Check to see if we can skip all of this polymorphism business + if(polymorphic_detail::serialize_wrapper(ar, ptr, nameid)) + return; + + auto binding = polymorphic_detail::getInputBinding(ar, nameid); + std::shared_ptr result; + binding.shared_ptr(&ar, result, typeid(T)); + ptr = std::static_pointer_cast(result); + } + + //! Saving std::weak_ptr for polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::weak_ptr const & ptr ) + { + auto const sptr = ptr.lock(); + ar( CEREAL_NVP_("locked_ptr", sptr) ); + } + + //! Loading std::weak_ptr for polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::weak_ptr & ptr ) + { + std::shared_ptr sptr; + ar( CEREAL_NVP_("locked_ptr", sptr) ); + ptr = sptr; + } + + //! Saving std::unique_ptr for polymorphic types that are abstract + template inline + typename std::enable_if::value && std::is_abstract::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) + { + if(!ptr) + { + // same behavior as nullptr in memory implementation + ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); + return; + } + + std::type_info const & ptrinfo = typeid(*ptr.get()); + static std::type_info const & tinfo = typeid(T); + // ptrinfo can never be equal to T info since we can't have an instance + // of an abstract object + // this implies we need to do the lookup + + auto const & bindingMap = detail::StaticObject>::getInstance().map; + + auto binding = bindingMap.find(std::type_index(ptrinfo)); + if(binding == bindingMap.end()) + UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) + + binding->second.unique_ptr(&ar, ptr.get(), tinfo); + } + + //! Saving std::unique_ptr for polymorphic types, not abstract + template inline + typename std::enable_if::value && !std::is_abstract::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) + { + if(!ptr) + { + // same behavior as nullptr in memory implementation + ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); + return; + } + + std::type_info const & ptrinfo = typeid(*ptr.get()); + static std::type_info const & tinfo = typeid(T); + + if(ptrinfo == tinfo) + { + // The 2nd msb signals that the following pointer does not need to be + // cast with our polymorphic machinery + ar( CEREAL_NVP_("polymorphic_id", detail::msb2_32bit) ); + + ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); + + return; + } + + auto const & bindingMap = detail::StaticObject>::getInstance().map; + + auto binding = bindingMap.find(std::type_index(ptrinfo)); + if(binding == bindingMap.end()) + UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) + + binding->second.unique_ptr(&ar, ptr.get(), tinfo); + } + + //! Loading std::unique_ptr, case when user provides load_and_construct for polymorphic types + template inline + typename std::enable_if::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unique_ptr & ptr ) + { + std::uint32_t nameid; + ar( CEREAL_NVP_("polymorphic_id", nameid) ); + + // Check to see if we can skip all of this polymorphism business + if(polymorphic_detail::serialize_wrapper(ar, ptr, nameid)) + return; + + auto binding = polymorphic_detail::getInputBinding(ar, nameid); + std::unique_ptr> result; + binding.unique_ptr(&ar, result, typeid(T)); + ptr.reset(static_cast(result.release())); + } + + #undef UNREGISTERED_POLYMORPHIC_EXCEPTION +} // namespace cereal +#endif // CEREAL_TYPES_POLYMORPHIC_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/queue.hpp b/cpp/src/cylon/thridparty/cereal/types/queue.hpp new file mode 100644 index 000000000..3b602ac99 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/queue.hpp @@ -0,0 +1,132 @@ +/*! \file queue.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_QUEUE_HPP_ +#define CEREAL_TYPES_QUEUE_HPP_ + +#include "cylon/thridparty/cereal/details/helpers.hpp" +#include + +// The default container for queue is deque, so let's include that too +#include "cereal/types/deque.hpp" +// The default comparator for queue is less +#include "cereal/types/functional.hpp" + +namespace cereal +{ + namespace queue_detail + { + //! Allows access to the protected container in queue + /*! @internal */ + template inline + C const & container( std::queue const & queue ) + { + struct H : public std::queue + { + static C const & get( std::queue const & q ) + { + return q.*(&H::c); + } + }; + + return H::get( queue ); + } + + //! Allows access to the protected container in priority queue + /*! @internal */ + template inline + C const & container( std::priority_queue const & priority_queue ) + { + struct H : public std::priority_queue + { + static C const & get( std::priority_queue const & pq ) + { + return pq.*(&H::c); + } + }; + + return H::get( priority_queue ); + } + + //! Allows access to the protected comparator in priority queue + /*! @internal */ + template inline + Comp const & comparator( std::priority_queue const & priority_queue ) + { + struct H : public std::priority_queue + { + static Comp const & get( std::priority_queue const & pq ) + { + return pq.*(&H::comp); + } + }; + + return H::get( priority_queue ); + } + } + + //! Saving for std::queue + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::queue const & queue ) + { + ar( CEREAL_NVP_("container", queue_detail::container( queue )) ); + } + + //! Loading for std::queue + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::queue & queue ) + { + C container; + ar( CEREAL_NVP_("container", container) ); + queue = std::queue( std::move( container ) ); + } + + //! Saving for std::priority_queue + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::priority_queue const & priority_queue ) + { + ar( CEREAL_NVP_("comparator", queue_detail::comparator( priority_queue )) ); + ar( CEREAL_NVP_("container", queue_detail::container( priority_queue )) ); + } + + //! Loading for std::priority_queue + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::priority_queue & priority_queue ) + { + Comp comparator; + ar( CEREAL_NVP_("comparator", comparator) ); + + C container; + ar( CEREAL_NVP_("container", container) ); + + priority_queue = std::priority_queue( comparator, std::move( container ) ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_QUEUE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/set.hpp b/cpp/src/cylon/thridparty/cereal/types/set.hpp new file mode 100644 index 000000000..f00034311 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/set.hpp @@ -0,0 +1,103 @@ +/*! \file set.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_SET_HPP_ +#define CEREAL_TYPES_SET_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + namespace set_detail + { + //! @internal + template inline + void save( Archive & ar, SetT const & set ) + { + ar( make_size_tag( static_cast(set.size()) ) ); + + for( const auto & i : set ) + ar( i ); + } + + //! @internal + template inline + void load( Archive & ar, SetT & set ) + { + size_type size; + ar( make_size_tag( size ) ); + + set.clear(); + + auto hint = set.begin(); + for( size_type i = 0; i < size; ++i ) + { + typename SetT::key_type key; + + ar( key ); + #ifdef CEREAL_OLDER_GCC + hint = set.insert( hint, std::move( key ) ); + #else // NOT CEREAL_OLDER_GCC + hint = set.emplace_hint( hint, std::move( key ) ); + #endif // NOT CEREAL_OLDER_GCC + } + } + } + + //! Saving for std::set + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::set const & set ) + { + set_detail::save( ar, set ); + } + + //! Loading for std::set + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::set & set ) + { + set_detail::load( ar, set ); + } + + //! Saving for std::multiset + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::multiset const & multiset ) + { + set_detail::save( ar, multiset ); + } + + //! Loading for std::multiset + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::multiset & multiset ) + { + set_detail::load( ar, multiset ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_SET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/stack.hpp b/cpp/src/cylon/thridparty/cereal/types/stack.hpp new file mode 100644 index 000000000..564a5520f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/stack.hpp @@ -0,0 +1,76 @@ +/*! \file stack.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_STACK_HPP_ +#define CEREAL_TYPES_STACK_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +// The default container for stack is deque, so let's include that too +#include "cylon/thridparty/cereal/types/deque.hpp" + +namespace cereal +{ + namespace stack_detail + { + //! Allows access to the protected container in stack + template inline + C const & container( std::stack const & stack ) + { + struct H : public std::stack + { + static C const & get( std::stack const & s ) + { + return s.*(&H::c); + } + }; + + return H::get( stack ); + } + } + + //! Saving for std::stack + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::stack const & stack ) + { + ar( CEREAL_NVP_("container", stack_detail::container( stack )) ); + } + + //! Loading for std::stack + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::stack & stack ) + { + C container; + ar( CEREAL_NVP_("container", container) ); + stack = std::stack( std::move( container ) ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_STACK_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/string.hpp b/cpp/src/cylon/thridparty/cereal/types/string.hpp new file mode 100644 index 000000000..72480f365 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/string.hpp @@ -0,0 +1,61 @@ +/*! \file string.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_STRING_HPP_ +#define CEREAL_TYPES_STRING_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Serialization for basic_string types, if binary data is supported + template inline + typename std::enable_if, Archive>::value, void>::type + CEREAL_SAVE_FUNCTION_NAME(Archive & ar, std::basic_string const & str) + { + // Save number of chars + the data + ar( make_size_tag( static_cast(str.size()) ) ); + ar( binary_data( str.data(), str.size() * sizeof(CharT) ) ); + } + + //! Serialization for basic_string types, if binary data is supported + template inline + typename std::enable_if, Archive>::value, void>::type + CEREAL_LOAD_FUNCTION_NAME(Archive & ar, std::basic_string & str) + { + size_type size; + ar( make_size_tag( size ) ); + str.resize(static_cast(size)); + ar( binary_data( const_cast( str.data() ), static_cast(size) * sizeof(CharT) ) ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_STRING_HPP_ + diff --git a/cpp/src/cylon/thridparty/cereal/types/tuple.hpp b/cpp/src/cylon/thridparty/cereal/types/tuple.hpp new file mode 100644 index 000000000..4dac862c7 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/tuple.hpp @@ -0,0 +1,123 @@ +/*! \file tuple.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_TUPLE_HPP_ +#define CEREAL_TYPES_TUPLE_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + namespace tuple_detail + { + //! Creates a c string from a sequence of characters + /*! The c string created will always be prefixed by "tuple_element" + Based on code from: http://stackoverflow/a/20973438/710791 + @internal */ + template + struct char_seq_to_c_str + { + static const int size = 14;// Size of array for the word: tuple_element + typedef const char (&arr_type)[sizeof...(Cs) + size]; + static const char str[sizeof...(Cs) + size]; + }; + + // the word tuple_element plus a number + //! @internal + template + const char char_seq_to_c_str::str[sizeof...(Cs) + size] = + {'t','u','p','l','e','_','e','l','e','m','e','n','t', Cs..., '\0'}; + + //! Converts a number into a sequence of characters + /*! @tparam Q The quotient of dividing the original number by 10 + @tparam R The remainder of dividing the original number by 10 + @tparam C The sequence built so far + @internal */ + template + struct to_string_impl + { + using type = typename to_string_impl(R+std::size_t{'0'}), C...>::type; + }; + + //! Base case with no quotient + /*! @internal */ + template + struct to_string_impl<0, R, C...> + { + using type = char_seq_to_c_str(R+std::size_t{'0'}), C...>; + }; + + //! Generates a c string for a given index of a tuple + /*! Example use: + @code{cpp} + tuple_element_name<3>::c_str();// returns "tuple_element3" + @endcode + @internal */ + template + struct tuple_element_name + { + using type = typename to_string_impl::type; + static const typename type::arr_type c_str(){ return type::str; } + }; + + // unwinds a tuple to save it + //! @internal + template + struct serialize + { + template inline + static void apply( Archive & ar, std::tuple & tuple ) + { + serialize::template apply( ar, tuple ); + ar( CEREAL_NVP_(tuple_element_name::c_str(), + std::get( tuple )) ); + } + }; + + // Zero height specialization - nothing to do here + //! @internal + template <> + struct serialize<0> + { + template inline + static void apply( Archive &, std::tuple & ) + { } + }; + } + + //! Serializing for std::tuple + template inline + void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::tuple & tuple ) + { + tuple_detail::serialize>::value>::template apply( ar, tuple ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_TUPLE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp b/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp new file mode 100644 index 000000000..b70a0be4e --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp @@ -0,0 +1,36 @@ +/*! \file unordered_map.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_UNORDERED_MAP_HPP_ +#define CEREAL_TYPES_UNORDERED_MAP_HPP_ + +#include "cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp" +#include + +#endif // CEREAL_TYPES_UNORDERED_MAP_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp b/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp new file mode 100644 index 000000000..6334ac727 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp @@ -0,0 +1,99 @@ +/*! \file unordered_set.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_UNORDERED_SET_HPP_ +#define CEREAL_TYPES_UNORDERED_SET_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + namespace unordered_set_detail + { + //! @internal + template inline + void save( Archive & ar, SetT const & set ) + { + ar( make_size_tag( static_cast(set.size()) ) ); + + for( const auto & i : set ) + ar( i ); + } + + //! @internal + template inline + void load( Archive & ar, SetT & set ) + { + size_type size; + ar( make_size_tag( size ) ); + + set.clear(); + set.reserve( static_cast( size ) ); + + for( size_type i = 0; i < size; ++i ) + { + typename SetT::key_type key; + + ar( key ); + set.emplace( std::move( key ) ); + } + } + } + + //! Saving for std::unordered_set + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unordered_set const & unordered_set ) + { + unordered_set_detail::save( ar, unordered_set ); + } + + //! Loading for std::unordered_set + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unordered_set & unordered_set ) + { + unordered_set_detail::load( ar, unordered_set ); + } + + //! Saving for std::unordered_multiset + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unordered_multiset const & unordered_multiset ) + { + unordered_set_detail::save( ar, unordered_multiset ); + } + + //! Loading for std::unordered_multiset + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unordered_multiset & unordered_multiset ) + { + unordered_set_detail::load( ar, unordered_multiset ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_UNORDERED_SET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/utility.hpp b/cpp/src/cylon/thridparty/cereal/types/utility.hpp new file mode 100644 index 000000000..82ce0559f --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/utility.hpp @@ -0,0 +1,47 @@ +/*! \file utility.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_UTILITY_HPP_ +#define CEREAL_TYPES_UTILITY_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Serializing for std::pair + template inline + void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::pair & pair ) + { + ar( CEREAL_NVP_("first", pair.first), + CEREAL_NVP_("second", pair.second) ); + } +} // namespace cereal + +#endif // CEREAL_TYPES_UTILITY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/valarray.hpp b/cpp/src/cylon/thridparty/cereal/types/valarray.hpp new file mode 100644 index 000000000..546840993 --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/valarray.hpp @@ -0,0 +1,89 @@ +/*! \file valarray.hpp +\brief Support for types found in \ +\ingroup STLSupport */ + +/* +Copyright (c) 2014, Randolph Voorhies, Shane Grant +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +* Neither the name of cereal nor the +names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CEREAL_TYPES_VALARRAY_HPP_ +#define CEREAL_TYPES_VALARRAY_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Saving for std::valarray arithmetic types, using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::valarray const & valarray ) + { + ar( make_size_tag( static_cast(valarray.size()) ) ); // number of elements + ar( binary_data( &valarray[0], valarray.size() * sizeof(T) ) ); // &valarray[0] ok since guaranteed contiguous + } + + //! Loading for std::valarray arithmetic types, using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::valarray & valarray ) + { + size_type valarraySize; + ar( make_size_tag( valarraySize ) ); + + valarray.resize( static_cast( valarraySize ) ); + ar( binary_data( &valarray[0], static_cast( valarraySize ) * sizeof(T) ) ); + } + + //! Saving for std::valarray all other types + template inline + typename std::enable_if, Archive>::value + || !std::is_arithmetic::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::valarray const & valarray ) + { + ar( make_size_tag( static_cast(valarray.size()) ) ); // number of elements + for(auto && v : valarray) + ar(v); + } + + //! Loading for std::valarray all other types + template inline + typename std::enable_if, Archive>::value + || !std::is_arithmetic::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::valarray & valarray ) + { + size_type valarraySize; + ar( make_size_tag( valarraySize ) ); + + valarray.resize( static_cast( valarraySize ) ); + for(auto && v : valarray) + ar(v); + } +} // namespace cereal + +#endif // CEREAL_TYPES_VALARRAY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/variant.hpp b/cpp/src/cylon/thridparty/cereal/types/variant.hpp new file mode 100644 index 000000000..e67c76f3e --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/variant.hpp @@ -0,0 +1,108 @@ +/*! \file variant.hpp + \brief Support for std::variant + \ingroup STLSupport */ +/* + Copyright (c) 2014, 2017, Randolph Voorhies, Shane Grant, Juan Pedro + Bolivar Puente. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_STD_VARIANT_HPP_ +#define CEREAL_TYPES_STD_VARIANT_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include +#include + +namespace cereal +{ + namespace variant_detail + { + //! @internal + template + struct variant_save_visitor + { + variant_save_visitor(Archive & ar_) : ar(ar_) {} + + template + void operator()(T const & value) const + { + ar( CEREAL_NVP_("data", value) ); + } + + Archive & ar; + }; + + //! @internal + template + typename std::enable_if, void>::type + load_variant(Archive & /*ar*/, int /*target*/, Variant & /*variant*/) + { + throw ::cereal::Exception("Error traversing variant during load"); + } + //! @internal + template + typename std::enable_if, void>::type + load_variant(Archive & ar, int target, Variant & variant) + { + if(N == target) + { + variant.template emplace(); + ar( CEREAL_NVP_("data", std::get(variant)) ); + } + else + load_variant(ar, target, variant); + } + + } // namespace variant_detail + + //! Saving for std::variant + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::variant const & variant ) + { + std::int32_t index = static_cast(variant.index()); + ar( CEREAL_NVP_("index", index) ); + variant_detail::variant_save_visitor visitor(ar); + std::visit(visitor, variant); + } + + //! Loading for std::variant + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::variant & variant ) + { + using variant_t = typename std::variant; + + std::int32_t index; + ar( CEREAL_NVP_("index", index) ); + if(index >= static_cast(std::variant_size_v)) + throw Exception("Invalid 'index' selector when deserializing std::variant"); + + variant_detail::load_variant<0>(ar, index, variant); + } + + //! Serializing a std::monostate + template + void CEREAL_SERIALIZE_FUNCTION_NAME( Archive &, std::monostate const & ) {} +} // namespace cereal + +#endif // CEREAL_TYPES_STD_VARIANT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/vector.hpp b/cpp/src/cylon/thridparty/cereal/types/vector.hpp new file mode 100644 index 000000000..1374be40c --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/types/vector.hpp @@ -0,0 +1,112 @@ +/*! \file vector.hpp + \brief Support for types found in \ + \ingroup STLSupport */ +/* + Copyright (c) 2014, Randolph Voorhies, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef CEREAL_TYPES_VECTOR_HPP_ +#define CEREAL_TYPES_VECTOR_HPP_ + +#include "cylon/thridparty/cereal/cereal.hpp" +#include + +namespace cereal +{ + //! Serialization for std::vectors of arithmetic (but not bool) using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value && !std::is_same::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) + { + ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements + ar( binary_data( vector.data(), vector.size() * sizeof(T) ) ); + } + + //! Serialization for std::vectors of arithmetic (but not bool) using binary serialization, if supported + template inline + typename std::enable_if, Archive>::value + && std::is_arithmetic::value && !std::is_same::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) + { + size_type vectorSize; + ar( make_size_tag( vectorSize ) ); + + vector.resize( static_cast( vectorSize ) ); + ar( binary_data( vector.data(), static_cast( vectorSize ) * sizeof(T) ) ); + } + + //! Serialization for non-arithmetic vector types + template inline + typename std::enable_if<(!traits::is_output_serializable, Archive>::value + || !std::is_arithmetic::value) && !std::is_same::value, void>::type + CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) + { + ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements + for(auto && v : vector) + ar( v ); + } + + //! Serialization for non-arithmetic vector types + template inline + typename std::enable_if<(!traits::is_input_serializable, Archive>::value + || !std::is_arithmetic::value) && !std::is_same::value, void>::type + CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) + { + size_type size; + ar( make_size_tag( size ) ); + + vector.resize( static_cast( size ) ); + for(auto && v : vector) + ar( v ); + } + + //! Serialization for bool vector types + template inline + void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) + { + ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements + for(const auto v : vector) + ar( static_cast(v) ); + } + + //! Serialization for bool vector types + template inline + void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) + { + size_type size; + ar( make_size_tag( size ) ); + + vector.resize( static_cast( size ) ); + for(auto && v : vector) + { + bool b; + ar( b ); + v = b; + } + } +} // namespace cereal + +#endif // CEREAL_TYPES_VECTOR_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/version.hpp b/cpp/src/cylon/thridparty/cereal/version.hpp new file mode 100644 index 000000000..0ad7d41cf --- /dev/null +++ b/cpp/src/cylon/thridparty/cereal/version.hpp @@ -0,0 +1,52 @@ +/*! \file version.hpp + \brief Macros to detect cereal version + + These macros can assist in determining the version of cereal. Be + warned that cereal is not guaranteed to be compatible across + different versions. For more information on releases of cereal, + see https://github.com/USCiLab/cereal/releases. + + \ingroup utility */ +/* + Copyright (c) 2018, Shane Grant + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CEREAL_VERSION_HPP_ +#define CEREAL_VERSION_HPP_ + +//! The major version +#define CEREAL_VERSION_MAJOR 1 +//! The minor version +#define CEREAL_VERSION_MINOR 3 +//! The patch version +#define CEREAL_VERSION_PATCH 2 + +//! The full version as a single number +#define CEREAL_VERSION (CEREAL_VERSION_MAJOR * 10000 \ + + CEREAL_VERSION_MINOR * 100 \ + + CEREAL_VERSION_PATCH) + +#endif // CEREAL_VERSION_HPP_ diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile new file mode 100644 index 000000000..3c30ed1c0 --- /dev/null +++ b/docker/aws/Dockerfile @@ -0,0 +1,90 @@ +FROM --platform=linux/amd64 ubuntu:22.04 +MAINTAINER cylondata@googlegroups.com + +ARG DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 +ENV PATH /opt/conda/bin:$PATH + +ENV CYLON_HOME=/cylon +ENV CYLON_PREFIX=/cylon/install +ENV UCC_HOME=/ucc + +#give ARG EXPOSE_ENV a default value +ARG EXPOSE_ENV=33000 + +#assign the EXPOSE_ENV arg to the EXPOSE_ENV ENV so that it can be accessed +#by the subsequent RUN call within the container +ENV EXPOSE_ENV $EXPOSE_ENV + + +WORKDIR $CYLON_HOME + +RUN DEBIAN_FRONTEND=noninteractive apt-get update -y --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git build-essential && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + #/opt/conda/bin/conda clean -a && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate cylon_dev" >> ~/.bashrc && \ + echo "export LD_LIBRARY_PATH=$CYLON_PREFIX"/lib >> ~/.bashrc + + + + +RUN git clone https://github.com/mstaylor/cylon.git $CYLON_HOME +RUN cd $CYLON_HOME && git checkout -b aws-docker-support origin/aws-docker-support + + + +SHELL ["/bin/bash", "--login", "-c"] + +RUN conda env create -f $CYLON_HOME/conda/environments/cylon.yml + +RUN . /opt/conda/etc/profile.d/conda.sh && \ + conda activate cylon_dev && \ + conda install -n base conda-libmamba-solver && conda config --set solver libmamba && \ + conda install -c anaconda boto3 -y && pip install cloudmesh-openstack &&\ + conda install -c conda-forge redis-py -y + + + +RUN apt-get update && apt-get install autoconf -y && apt-get install libtool -y && apt-get install cmake -y && \ + apt-get install libnuma-dev -y + +#UCC install + +RUN git clone --single-branch -b master https://github.com/openucx/ucc.git $UCC_HOME +RUN cd $UCC_HOME && \ + ./autogen.sh && \ + ./configure --prefix=$UCC_HOME/install --with-ucx=/opt/conda/envs/cylon_dev && \ + make install + +#REDIS install +RUN git clone https://github.com/redis/hiredis.git /hiredis && \ + cd /hiredis && \ + make && \ + make install && \ + git clone https://github.com/sewenew/redis-plus-plus.git /redis-plus-plus && \ + cd /redis-plus-plus && \ + mkdir build && \ + cd build && \ + cmake -DREDIS_PLUS_PLUS_CXX_STANDARD=11 .. && \ + make && make install + + +RUN . /opt/conda/etc/profile.d/conda.sh && \ + conda activate cylon_dev && \ + cd $CYLON_HOME && \ + python build.py -cmake-flags="-DCYLON_UCX=1 -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_HOME/install -DCYLON_USE_REDIS=1 " -ipath="$CYLON_PREFIX" --cpp --python --test --pytest + +RUN chmod 0755 /cylon/aws/scripts/runCylon.sh + +EXPOSE $EXPOSE_ENV + +ENTRYPOINT ["/cylon/aws/scripts/runCylon.sh"] diff --git a/docker/aws/README.md b/docker/aws/README.md new file mode 100644 index 000000000..7a8ea6a61 --- /dev/null +++ b/docker/aws/README.md @@ -0,0 +1,36 @@ +# Cylon Docker Image + +## Instructions + +- To build the Docker image, +```bash +docker build --shm-size 8589934592 -t cylondata/cylon-ucc . +``` + +- To run a container +```bash +docker run -it --name cylon1 -p 22:22 -d cylon-ucc-redis +``` + +- To attach to a container +```bash + docker attach cylon1 +``` + + + +Cylon will be installed in `/cylon/` directory. A container would have the following environment +variables and commands. +- `$CYLON_HOME` points to `/cylon` +- `$CYLON_BUILD` points to c++ build directory +- `$CYLON_ENV` points to python virtual environment + +UCX will be installed in `/opt/conda/envs/cylon_dev/` directory as part of the environment creation. + +UCC with be installed into `/ucc/` directory. A container would have the following environment +variables and commands. +- `$UCC_HOME` points to `/ucc` + +Hiredis will be be installed in '/hiredis' directory. + +Redis Plus Plus will be installed in `/redis-plus-plus` directory. \ No newline at end of file diff --git a/docker/ucc-redis/Dockerfile b/docker/ucc-redis/Dockerfile new file mode 100644 index 000000000..1c86b3805 --- /dev/null +++ b/docker/ucc-redis/Dockerfile @@ -0,0 +1,68 @@ +FROM --platform=linux/amd64 ubuntu:22.04 +MAINTAINER cylondata@googlegroups.com + +ARG DEBIAN_FRONTEND=noninteractive + +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 +ENV PATH /opt/conda/bin:$PATH + +RUN DEBIAN_FRONTEND=noninteractive apt-get update -y --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git build-essential && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + #/opt/conda/bin/conda clean -a && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate cylon_dev" >> ~/.bashrc + + +ENV CYLON_HOME=/cylon +ENV CYLON_PREFIX=/cylon/install +ENV UCC_HOME=/ucc + +WORKDIR $CYLON_HOME + +RUN git clone https://github.com/mstaylor/cylon.git $CYLON_HOME +RUN cd $CYLON_HOME && git checkout -b aws-docker-support origin/aws-docker-support + +RUN conda install -n base conda-libmamba-solver && conda config --set solver libmamba + +RUN conda env create -f $CYLON_HOME/conda/environments/cylon.yml + +SHELL ["/bin/bash", "--login", "-c"] + +RUN apt-get update && apt-get install autoconf -y && apt-get install libtool -y && apt-get install cmake -y && \ + apt-get install libnuma-dev -y + +#UCC install + +RUN git clone --single-branch -b master https://github.com/openucx/ucc.git $UCC_HOME +RUN cd $UCC_HOME && \ + ./autogen.sh && \ + ./configure --prefix=$UCC_HOME/install --with-ucx=/opt/conda/envs/cylon_dev && \ + make install + +#REDIS install +RUN git clone https://github.com/redis/hiredis.git /hiredis && \ + cd /hiredis && \ + make && \ + make install && \ + git clone https://github.com/sewenew/redis-plus-plus.git /redis-plus-plus && \ + cd /redis-plus-plus && \ + mkdir build && \ + cd build && \ + cmake -DREDIS_PLUS_PLUS_CXX_STANDARD=11 .. && \ + make && make install + + +RUN . /opt/conda/etc/profile.d/conda.sh && \ + conda activate cylon_dev && \ + cd $CYLON_HOME && \ + python build.py -cmake-flags="-DCYLON_UCX=1 -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_HOME/install -DCYLON_USE_REDIS=1 " -ipath="$CYLON_PREFIX" --cpp --python --test --pytest + + +ENTRYPOINT ["/bin/bash"] diff --git a/docker/ucc-redis/README.md b/docker/ucc-redis/README.md new file mode 100644 index 000000000..ccd742042 --- /dev/null +++ b/docker/ucc-redis/README.md @@ -0,0 +1,36 @@ +# Cylon Docker Image + +## Instructions + +- To build the Docker image, +```bash +docker build -t cylon-ucc-redis . +``` + +- To run a container +```bash +docker run -it --name cylon1 -p 22:22 -d cylon-ucc-redis +``` + +- To attach to a container +```bash + docker attach cylon1 +``` + + + +Cylon will be installed in `/cylon/` directory. A container would have the following environment +variables and commands. +- `$CYLON_HOME` points to `/cylon` +- `$CYLON_BUILD` points to c++ build directory +- `$CYLON_ENV` points to python virtual environment + +UCX will be installed in `/opt/conda/envs/cylon_dev/` directory as part of the environment creation. + +UCC with be installed into `/ucc/` directory. A container would have the following environment +variables and commands. +- `$UCC_HOME` points to `/ucc` + +Hiredis will be be installed in '/hiredis' directory. + +Redis Plus Plus will be installed in `/redis-plus-plus` directory. \ No newline at end of file diff --git a/python/pycylon/examples/redis_example.py b/python/pycylon/examples/redis_example.py index 1136a2599..80d065541 100644 --- a/python/pycylon/examples/redis_example.py +++ b/python/pycylon/examples/redis_example.py @@ -10,7 +10,7 @@ parser = argparse.ArgumentParser() parser.add_argument('--world_size', "-n", type=int, help="world size") - parser.add_argument("--redis_host", "-h", type=str, help="redis address, default to 127.0.0.1", + parser.add_argument("--redis_host", "-r", type=str, help="redis address, default to 127.0.0.1", default="127.0.0.1") parser.add_argument("--port", "-p", type=int, help="name of redis port", default=6379) args = parser.parse_args() diff --git a/python/pycylon/pycylon/api/lib.pxd b/python/pycylon/pycylon/api/lib.pxd index dc08539dc..2918b8eac 100644 --- a/python/pycylon/pycylon/api/lib.pxd +++ b/python/pycylon/pycylon/api/lib.pxd @@ -29,16 +29,20 @@ IF CYTHON_GLOO: IF CYTHON_UCX & CYTHON_UCC: from pycylon.net.ucx_config cimport CUCXConfig from pycylon.net.ucc_config cimport CUCCConfig + from pycylon.net.ucc_ucx_communicator cimport CUCXUCCCommunicator +IF CYTHON_UCX: + from pycylon.net.ucx_communicator cimport CUCXCommunicator +from pycylon.net.mpi_communicator cimport CMPICommunicator from pycylon.io.csv_read_config cimport CCSVReadOptions from pycylon.io.csv_read_config import CSVReadOptions from pycylon.io.csv_read_config cimport CSVReadOptions from pycylon.io.csv_write_config cimport CCSVWriteOptions from pycylon.io.csv_write_config import CSVWriteOptions from pycylon.io.csv_write_config cimport CSVWriteOptions -from pycylon.data.data_type cimport CType -from pycylon.data.data_type import Type -from pycylon.data.data_type cimport CLayout -from pycylon.data.data_type import Layout +from pycylon.data.ctype cimport CType +from pycylon.data.ctype import Type +from pycylon.data.layout cimport CLayout +from pycylon.data.layout import Layout from pycylon.data.data_type cimport CDataType from pycylon.data.data_type import DataType from pycylon.common.status cimport CStatus @@ -69,8 +73,12 @@ IF CYTHON_UCX & CYTHON_UCC: cdef api shared_ptr[CUCXConfig] pycylon_unwrap_ucx_config(object config) cdef api shared_ptr[CUCCConfig] pycylon_unwrap_ucc_config(object config) + cdef api object pycylon_wrap_ucc_ucx_communicator(const shared_ptr[CUCXUCCCommunicator] & ccommunicator) +IF CYTHON_UCX: + cdef api object pycylon_wrap_ucx_communicator(const shared_ptr[CUCXCommunicator] & ccommunicator) +cdef api object pycylon_wrap_mci_communicator(const shared_ptr[CMPICommunicator] & ccomunicator) cdef api shared_ptr[CTable] pycylon_unwrap_table(object table) diff --git a/python/pycylon/pycylon/api/lib.pyx b/python/pycylon/pycylon/api/lib.pyx index dc44c03ed..1f30433a1 100644 --- a/python/pycylon/pycylon/api/lib.pyx +++ b/python/pycylon/pycylon/api/lib.pyx @@ -33,16 +33,21 @@ IF CYTHON_UCX & CYTHON_UCC: from pycylon.net.ucx_config import UCXConfig from pycylon.net.ucx_config cimport CUCXConfig, UCXConfig from pycylon.net.ucc_config cimport CUCCConfig, UCCConfig + from pycylon.net.ucc_ucx_communicator cimport CUCXUCCCommunicator, UCXUCCCommunicator +IF CYTHON_UCX: + from pycylon.net.ucx_communicator cimport CUCXCommunicator, UCXCommunicator + +from pycylon.net.mpi_communicator cimport CMPICommunicator, MPICommunicator from pycylon.io.csv_read_config cimport CCSVReadOptions from pycylon.io.csv_read_config import CSVReadOptions from pycylon.io.csv_read_config cimport CSVReadOptions from pycylon.io.csv_write_config cimport CCSVWriteOptions from pycylon.io.csv_write_config import CSVWriteOptions from pycylon.io.csv_write_config cimport CSVWriteOptions -from pycylon.data.data_type cimport CType -from pycylon.data.data_type import Type -from pycylon.data.data_type cimport CLayout -from pycylon.data.data_type import Layout +from pycylon.data.ctype cimport CType +from pycylon.data.ctype import Type +from pycylon.data.layout cimport CLayout +from pycylon.data.layout import Layout from pycylon.data.data_type cimport CDataType from pycylon.data.data_type import DataType from pycylon.data.data_type cimport DataType @@ -137,6 +142,23 @@ IF CYTHON_UCX & CYTHON_UCC: return ( config).ucc_config_shd_ptr else: raise ValueError('Passed object is not an instance of UccConfig') + + cdef api object pycylon_wrap_ucc_ucx_communicator(const shared_ptr[CUCXUCCCommunicator] & ccommunicator): + cdef UCXUCCCommunicator communicator = UCXUCCCommunicator.__new__(UCXUCCCommunicator) + communicator.init(ccommunicator) + return communicator + + +IF CYTHON_UCX: + cdef api object pycylon_wrap_ucx_communicator(const shared_ptr[CUCXCommunicator] & ccomunicator): + cdef UCXCommunicator communicator = UCXCommunicator.__new__(UCXCommunicator) + communicator.init(ccomunicator) + return communicator + +cdef api object pycylon_wrap_mci_communicator(const shared_ptr[CMPICommunicator] & ccomunicator): + cdef MPICommunicator communicator = MPICommunicator.__new__(MPICommunicator) + communicator.init(ccomunicator) + return communicator cdef api CCSVReadOptions pycylon_unwrap_csv_read_options(object csv_read_options): cdef CSVReadOptions csvrdopt if pyclon_is_csv_read_options(csv_read_options): diff --git a/python/pycylon/pycylon/ctx/context.pxd b/python/pycylon/pycylon/ctx/context.pxd index 75ee35723..d1156f649 100644 --- a/python/pycylon/pycylon/ctx/context.pxd +++ b/python/pycylon/pycylon/ctx/context.pxd @@ -47,7 +47,7 @@ cdef extern from "../../../../cpp/src/cylon/ctx/cylon_context.hpp" namespace "cy string GetConfig(const string &key, const string &defn) - shared_ptr[CCommunicator] GetCommunicator() const + shared_ptr[CCommunicator] & GetCommunicator() const int GetRank() diff --git a/python/pycylon/pycylon/ctx/context.pyx b/python/pycylon/pycylon/ctx/context.pyx index 86e691e68..8ccdd6e2d 100644 --- a/python/pycylon/pycylon/ctx/context.pyx +++ b/python/pycylon/pycylon/ctx/context.pyx @@ -12,7 +12,7 @@ # limitations under the License. ## -from libcpp.memory cimport shared_ptr +from libcpp.memory cimport shared_ptr, dynamic_pointer_cast from libcpp.vector cimport vector from libcpp.string cimport string from libcpp cimport bool @@ -22,13 +22,22 @@ IF CYTHON_GLOO: from pycylon.api.lib cimport pycylon_unwrap_gloo_config IF CYTHON_UCX & CYTHON_UCC: - from pycylon.api.lib cimport pycylon_unwrap_ucx_config, pycylon_unwrap_ucc_config + from pycylon.api.lib cimport pycylon_unwrap_ucx_config, pycylon_unwrap_ucc_config, pycylon_wrap_ucc_ucx_communicator + from pycylon.net.ucc_ucx_communicator cimport CUCXUCCCommunicator, UCXUCCCommunicator +IF CYTHON_UCX: + from pycylon.api.lib cimport pycylon_wrap_ucx_communicator + from pycylon.net.ucx_communicator cimport CUCXCommunicator, UCXCommunicator +from pycylon.net.mpi_communicator cimport CMPICommunicator, MPICommunicator +from pycylon.api.lib cimport pycylon_wrap_mci_communicator from pycylon.net import CommType from pycylon.net.mpi_config cimport CMPIConfig from pycylon.net.mpi_config import MPIConfig from pycylon.net.comm_config cimport CCommConfig from pycylon.net.comm_config import CommConfig from pycylon.net.comm_config cimport CommConfig +from pycylon.net.communicator import Communicator +from pycylon.net.communicator cimport CCommunicator + cdef class CylonContext: """ @@ -128,6 +137,14 @@ cdef class CylonContext: ''' return self.ctx_shd_ptr.get().GetWorldSize() + def get_communicator(self): + IF CYTHON_UCX & CYTHON_UCC: + return pycylon_wrap_ucc_ucx_communicator(dynamic_pointer_cast[CUCXUCCCommunicator, CCommunicator](self.ctx_shd_ptr.get().GetCommunicator())) + ELIF CYTHON_UCX: + return pycylon_wrap_ucx_communicator( + dynamic_pointer_cast[CUCXCommunicator, CCommunicator](self.ctx_shd_ptr.get().GetCommunicator())) + return pycylon_wrap_mci_communicator(dynamic_pointer_cast[CMPICommunicator, CCommunicator](self.ctx_shd_ptr.get().GetCommunicator())) + def finalize(self): ''' Gracefully shuts down the context by closing any distributed processes initialization ,etc diff --git a/python/pycylon/pycylon/data/ctype.pxd b/python/pycylon/pycylon/data/ctype.pxd new file mode 100644 index 000000000..a0fd90548 --- /dev/null +++ b/python/pycylon/pycylon/data/ctype.pxd @@ -0,0 +1,75 @@ +## +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + + + +cdef extern from "../../../../cpp/src/cylon/data_types.hpp" namespace "cylon": + cdef cppclass CType 'cylon::Type': + enum ctype 'type': + # Boolean as 1 bit, LSB bit-packed ordering + CBOOL 'cylon::Type::BOOL' + # Unsigned 8-bit little-endian integer + CUINT8 'cylon::Type::UINT8' + # Signed 8-bit little-endian integer + CINT8 'cylon::Type::INT8' + # Unsigned 16-bit little-endian integer + CUINT16 'cylon::Type::UINT16' + # Signed 16-bit little-endian integer + CINT16 'cylon::Type::INT16' + # Unsigned 32-bit little-endian integer + CUINT32 'cylon::Type::UINT32' + # Signed 32-bit little-endian integer + CINT32 'cylon::Type::INT32' + # Unsigned 64-bit little-endian integer + CUINT64 'cylon::Type::UINT64' + # Signed 64-bit little-endian integer + CINT64 'cylon::Type::INT64' + # 2-byte floating point value + CHALF_FLOAT 'cylon::Type::HALF_FLOAT' + # 4-byte floating point value + CFLOAT 'cylon::Type::FLOAT' + # 8-byte floating point value + CDOUBLE 'cylon::Type::DOUBLE' + # UTF8 variable-length string as List + CSTRING 'cylon::Type::STRING' + # Variable-length bytes (no guarantee of UTF8-ness) + CBINARY 'cylon::Type::BINARY' + # Fixed-size binary. Each value occupies the same number of bytes + CFIXED_SIZE_BINARY 'cylon::Type::FIXED_SIZE_BINARY' + # int32_t days since the UNIX epoch + CDATE32 'cylon::Type::DATE32' + # int64_t milliseconds since the UNIX epoch + CDATE64 'cylon::Type::DATE64' + # Exact timestamp encoded with int64 since UNIX epoch + # Default unit millisecond + CTIMESTAMP 'cylon::Type::TIMESTAMP' + # Time as signed 32-bit integer, representing either seconds or + # milliseconds since midnight + CTIME32 'cylon::Type::TIME32' + # Time as signed 64-bit integer, representing either microseconds or + # nanoseconds since midnight + CTIME64 'cylon::Type::TIME64' + # YEAR_MONTH or DAY_TIME interval in SQL style + CINTERVAL 'cylon::Type::INTERVAL' + # Precision- and scale-based decimal type. Storage type depends on the + # parameters. + CDECIMAL 'cylon::Type::DECIMAL' + # A list of some logical data type + CLIST 'cylon::Type::LIST' + # Custom data type, implemented by user + CEXTENSION 'cylon::Type::EXTENSION' + # Fixed size list of some logical type + CFIXED_SIZE_LIST 'cylon::Type::FIXED_SIZE_LIST' + # or nanoseconds. + CDURATION 'cylon::Type::DURATION' diff --git a/python/pycylon/pycylon/data/ctype.pyx b/python/pycylon/pycylon/data/ctype.pyx new file mode 100644 index 000000000..84805895c --- /dev/null +++ b/python/pycylon/pycylon/data/ctype.pyx @@ -0,0 +1,73 @@ +## +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + + + +cpdef enum Type: + # Boolean as 1 bit, LSB bit-packed ordering + BOOL = CType.ctype.CBOOL + # Unsigned 8-bit little-endian integer + UINT8 = CType.ctype.CUINT8 + # Signed 8-bit little-endian integer + INT8 = CType.ctype.CINT8 + # Unsigned 16-bit little-endian integer + UINT16 = CType.ctype.CUINT16 + # Signed 16-bit little-endian integer + INT16 = CType.ctype.CINT16 + # Unsigned 32-bit little-endian integer + UINT32 = CType.ctype.CUINT32 + # Signed 32-bit little-endian integer + INT32 = CType.ctype.CINT32 + # Unsigned 64-bit little-endian integer + UINT64 = CType.ctype.CUINT64 + # Signed 64-bit little-endian integer + INT64 = CType.ctype.CINT64 + # 2-byte floating point value + HALF_FLOAT = CType.ctype.CHALF_FLOAT + # 4-byte floating point value + FLOAT = CType.ctype.CFLOAT + # 8-byte floating point value + DOUBLE = CType.ctype.CDOUBLE + # UTF8 variable-length string as List + STRING = CType.ctype.CSTRING + # Variable-length bytes (no guarantee of UTF8-ness) + BINARY = CType.ctype.CBINARY + # Fixed-size binary. Each value occupies the same number of bytes + FIXED_SIZE_BINARY = CType.ctype.CFIXED_SIZE_BINARY + # int32_t days since the UNIX epoch + DATE32 = CType.ctype.CDATE32 + # int64_t milliseconds since the UNIX epoch + DATE64 = CType.ctype.CDATE64 + # Exact timestamp encoded with int64 since UNIX epoch + # Default unit millisecond + TIMESTAMP = CType.ctype.CTIMESTAMP + # Time as signed 32-bit integer, representing either seconds or + # milliseconds since midnight + TIME32 = CType.ctype.CTIME32 + # Time as signed 64-bit integer, representing either microseconds or + # nanoseconds since midnight + TIME64 = CType.ctype.CTIME64 + # YEAR_MONTH or DAY_TIME interval in SQL style + INTERVAL = CType.ctype.CINTERVAL + # Precision- and scale-based decimal type. Storage type depends on the + # parameters. + DECIMAL = CType.ctype.CDECIMAL + # A list of some logical data type + LIST = CType.ctype.CLIST + # Custom data type, implemented by user + EXTENSION = CType.ctype.CEXTENSION + # Fixed size list of some logical type + FIXED_SIZE_LIST = CType.ctype.CFIXED_SIZE_LIST + # or nanoseconds. + DURATION = CType.ctype.CDURATION \ No newline at end of file diff --git a/python/pycylon/pycylon/data/data_type.pxd b/python/pycylon/pycylon/data/data_type.pxd index 6375779aa..0913bed8f 100644 --- a/python/pycylon/pycylon/data/data_type.pxd +++ b/python/pycylon/pycylon/data/data_type.pxd @@ -20,75 +20,10 @@ from libcpp.memory cimport shared_ptr from libcpp.vector cimport vector from pycylon.ctx.context cimport CCylonContext from pycylon.ctx.context import CylonContext +from pycylon.data.ctype cimport CType +from pycylon.data.layout cimport CLayout -cdef extern from "../../../../cpp/src/cylon/data_types.hpp" namespace "cylon": - cdef cppclass CType 'cylon::Type': - enum ctype 'type': - # Boolean as 1 bit, LSB bit-packed ordering - CBOOL 'cylon::Type::BOOL' - # Unsigned 8-bit little-endian integer - CUINT8 'cylon::Type::UINT8' - # Signed 8-bit little-endian integer - CINT8 'cylon::Type::INT8' - # Unsigned 16-bit little-endian integer - CUINT16 'cylon::Type::UINT16' - # Signed 16-bit little-endian integer - CINT16 'cylon::Type::INT16' - # Unsigned 32-bit little-endian integer - CUINT32 'cylon::Type::UINT32' - # Signed 32-bit little-endian integer - CINT32 'cylon::Type::INT32' - # Unsigned 64-bit little-endian integer - CUINT64 'cylon::Type::UINT64' - # Signed 64-bit little-endian integer - CINT64 'cylon::Type::INT64' - # 2-byte floating point value - CHALF_FLOAT 'cylon::Type::HALF_FLOAT' - # 4-byte floating point value - CFLOAT 'cylon::Type::FLOAT' - # 8-byte floating point value - CDOUBLE 'cylon::Type::DOUBLE' - # UTF8 variable-length string as List - CSTRING 'cylon::Type::STRING' - # Variable-length bytes (no guarantee of UTF8-ness) - CBINARY 'cylon::Type::BINARY' - # Fixed-size binary. Each value occupies the same number of bytes - CFIXED_SIZE_BINARY 'cylon::Type::FIXED_SIZE_BINARY' - # int32_t days since the UNIX epoch - CDATE32 'cylon::Type::DATE32' - # int64_t milliseconds since the UNIX epoch - CDATE64 'cylon::Type::DATE64' - # Exact timestamp encoded with int64 since UNIX epoch - # Default unit millisecond - CTIMESTAMP 'cylon::Type::TIMESTAMP' - # Time as signed 32-bit integer, representing either seconds or - # milliseconds since midnight - CTIME32 'cylon::Type::TIME32' - # Time as signed 64-bit integer, representing either microseconds or - # nanoseconds since midnight - CTIME64 'cylon::Type::TIME64' - # YEAR_MONTH or DAY_TIME interval in SQL style - CINTERVAL 'cylon::Type::INTERVAL' - # Precision- and scale-based decimal type. Storage type depends on the - # parameters. - CDECIMAL 'cylon::Type::DECIMAL' - # A list of some logical data type - CLIST 'cylon::Type::LIST' - # Custom data type, implemented by user - CEXTENSION 'cylon::Type::EXTENSION' - # Fixed size list of some logical type - CFIXED_SIZE_LIST 'cylon::Type::FIXED_SIZE_LIST' - # or nanoseconds. - CDURATION 'cylon::Type::DURATION' - - -cdef extern from "../../../../cpp/src/cylon/data_types.hpp" namespace "cylon": - cdef cppclass CLayout 'cylon::Layout': - enum clayout 'layout': - CFIXED_WIDTH 'cylon::Layout::FIXED_WIDTH' - CVARIABLE_WIDTH 'cylon::Layout::VARIABLE_WIDTH' - cdef extern from "../../../../cpp/src/cylon/data_types.hpp" namespace "cylon": cdef cppclass CDataType "cylon::DataType": diff --git a/python/pycylon/pycylon/data/data_type.pyx b/python/pycylon/pycylon/data/data_type.pyx index 90c65b032..c4eb1bf84 100644 --- a/python/pycylon/pycylon/data/data_type.pyx +++ b/python/pycylon/pycylon/data/data_type.pyx @@ -15,74 +15,18 @@ from libcpp.memory cimport shared_ptr, make_shared from pycylon.data.data_type cimport CDataType -from pycylon.data.data_type cimport CType -from pycylon.data.data_type cimport CLayout +from pycylon.data.ctype cimport CType +from pycylon.data.ctype import Type +from pycylon.data.layout cimport CLayout +from pycylon.data.layout import Layout + import pyarrow as pa -cpdef enum Type: - # Boolean as 1 bit, LSB bit-packed ordering - BOOL = CType.ctype.CBOOL - # Unsigned 8-bit little-endian integer - UINT8 = CType.ctype.CUINT8 - # Signed 8-bit little-endian integer - INT8 = CType.ctype.CINT8 - # Unsigned 16-bit little-endian integer - UINT16 = CType.ctype.CUINT16 - # Signed 16-bit little-endian integer - INT16 = CType.ctype.CINT16 - # Unsigned 32-bit little-endian integer - UINT32 = CType.ctype.CUINT32 - # Signed 32-bit little-endian integer - INT32 = CType.ctype.CINT32 - # Unsigned 64-bit little-endian integer - UINT64 = CType.ctype.CUINT64 - # Signed 64-bit little-endian integer - INT64 = CType.ctype.CINT64 - # 2-byte floating point value - HALF_FLOAT = CType.ctype.CHALF_FLOAT - # 4-byte floating point value - FLOAT = CType.ctype.CFLOAT - # 8-byte floating point value - DOUBLE = CType.ctype.CDOUBLE - # UTF8 variable-length string as List - STRING = CType.ctype.CSTRING - # Variable-length bytes (no guarantee of UTF8-ness) - BINARY = CType.ctype.CBINARY - # Fixed-size binary. Each value occupies the same number of bytes - FIXED_SIZE_BINARY = CType.ctype.CFIXED_SIZE_BINARY - # int32_t days since the UNIX epoch - DATE32 = CType.ctype.CDATE32 - # int64_t milliseconds since the UNIX epoch - DATE64 = CType.ctype.CDATE64 - # Exact timestamp encoded with int64 since UNIX epoch - # Default unit millisecond - TIMESTAMP = CType.ctype.CTIMESTAMP - # Time as signed 32-bit integer, representing either seconds or - # milliseconds since midnight - TIME32 = CType.ctype.CTIME32 - # Time as signed 64-bit integer, representing either microseconds or - # nanoseconds since midnight - TIME64 = CType.ctype.CTIME64 - # YEAR_MONTH or DAY_TIME interval in SQL style - INTERVAL = CType.ctype.CINTERVAL - # Precision- and scale-based decimal type. Storage type depends on the - # parameters. - DECIMAL = CType.ctype.CDECIMAL - # A list of some logical data type - LIST = CType.ctype.CLIST - # Custom data type, implemented by user - EXTENSION = CType.ctype.CEXTENSION - # Fixed size list of some logical type - FIXED_SIZE_LIST = CType.ctype.CFIXED_SIZE_LIST - # or nanoseconds. - DURATION = CType.ctype.CDURATION -cpdef enum Layout: - FIXED_WIDTH = CLayout.clayout.CFIXED_WIDTH - VARIABLE_WIDTH = CLayout.clayout.CVARIABLE_WIDTH + cdef class DataType: diff --git a/python/pycylon/pycylon/data/layout.pxd b/python/pycylon/pycylon/data/layout.pxd new file mode 100644 index 000000000..4dd749f9a --- /dev/null +++ b/python/pycylon/pycylon/data/layout.pxd @@ -0,0 +1,21 @@ +## +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + + + +cdef extern from "../../../../cpp/src/cylon/data_types.hpp" namespace "cylon": + cdef cppclass CLayout 'cylon::Layout': + enum clayout 'layout': + CFIXED_WIDTH 'cylon::Layout::FIXED_WIDTH' + CVARIABLE_WIDTH 'cylon::Layout::VARIABLE_WIDTH' \ No newline at end of file diff --git a/python/pycylon/pycylon/data/layout.pyx b/python/pycylon/pycylon/data/layout.pyx new file mode 100644 index 000000000..006f3cdfc --- /dev/null +++ b/python/pycylon/pycylon/data/layout.pyx @@ -0,0 +1,22 @@ +## +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + + + + + +cpdef enum Layout: + + FIXED_WIDTH = CLayout.clayout.CFIXED_WIDTH + VARIABLE_WIDTH = CLayout.clayout.CVARIABLE_WIDTH \ No newline at end of file diff --git a/python/pycylon/pycylon/net/communicator.pxd b/python/pycylon/pycylon/net/communicator.pxd index 4b2ccda37..4fc4abc76 100644 --- a/python/pycylon/pycylon/net/communicator.pxd +++ b/python/pycylon/pycylon/net/communicator.pxd @@ -15,11 +15,16 @@ from libcpp.memory cimport shared_ptr from pycylon.net.comm_config cimport CCommConfig from pycylon.net.comm_type cimport CCommType +from pycylon.net.reduce_op cimport CReduceOp +from pycylon.common.status cimport CStatus +from pycylon.data.scalar cimport CScalar + + cdef extern from "../../../../cpp/src/cylon/net/communicator.hpp" namespace "cylon::net": - cdef cppclass CCommunicator "cylon::net": - void Init(const shared_ptr[CCommConfig] &config) + cdef cppclass CCommunicator "cylon::net::Communicator": + # TODO: add create Channel int GetRank() int GetWorldSize() @@ -27,13 +32,12 @@ cdef extern from "../../../../cpp/src/cylon/net/communicator.hpp" namespace "cyl void Barrier() CCommType GetCommType() -cdef extern from "../../../../cpp/src/cylon/net/mpi/mpi_communicator.hpp" namespace "cylon::net": - cdef cppclass CMPICommunicator "cylon::net::MPICommunicator": - void Init(const shared_ptr[CCommConfig] &config) - int GetRank() - int GetWorldSize() - void Finalize() - void Barrier() - CCommType GetCommType() + CStatus AllReduce(const shared_ptr[CScalar] &value, + CReduceOp reduce_op, + shared_ptr[CScalar] *output) + +cdef class Communicator: + pass + diff --git a/python/pycylon/pycylon/net/communicator.pyx b/python/pycylon/pycylon/net/communicator.pyx index 102fc624a..bb1ee877a 100644 --- a/python/pycylon/pycylon/net/communicator.pyx +++ b/python/pycylon/pycylon/net/communicator.pyx @@ -12,10 +12,14 @@ # limitations under the License. ## -from pycylon.net.communicator cimport CMPICommunicator +from pycylon.net.reduce_op import ReduceOp -cdef class MPICommunicator: +cdef class Communicator: def __cinit__(self): - pass \ No newline at end of file + pass + + def allreduce(self, value, reduce_op: ReduceOp): + pass + diff --git a/python/pycylon/pycylon/net/mpi_communicator.pxd b/python/pycylon/pycylon/net/mpi_communicator.pxd new file mode 100644 index 000000000..1a9e1c90d --- /dev/null +++ b/python/pycylon/pycylon/net/mpi_communicator.pxd @@ -0,0 +1,41 @@ +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +from libcpp.memory cimport shared_ptr +from pycylon.net.comm_type cimport CCommType +from pycylon.net.reduce_op cimport CReduceOp +from pycylon.common.status cimport CStatus +from pycylon.data.scalar cimport CScalar +from pycylon.net.communicator cimport Communicator + + +cdef extern from "../../../../cpp/src/cylon/net/mpi/mpi_communicator.hpp" namespace "cylon::net": + cdef cppclass CMPICommunicator "cylon::net::MPICommunicator": + + int GetRank() + int GetWorldSize() + void Finalize() + void Barrier() + CCommType GetCommType() + + CStatus AllReduce(const shared_ptr[CScalar] & value, + CReduceOp reduce_op, + shared_ptr[CScalar] *output) + + +cdef class MPICommunicator(Communicator): + cdef: + shared_ptr[CMPICommunicator] mpi_comm_shd_ptr + + void init(self, const shared_ptr[CMPICommunicator] & communicator) \ No newline at end of file diff --git a/python/pycylon/pycylon/net/mpi_communicator.pyx b/python/pycylon/pycylon/net/mpi_communicator.pyx new file mode 100644 index 000000000..fb166c570 --- /dev/null +++ b/python/pycylon/pycylon/net/mpi_communicator.pyx @@ -0,0 +1,43 @@ + +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + + + + +from pycylon.net.communicator cimport Communicator + +from pycylon.net.reduce_op import ReduceOp +import pyarrow as pa +from pyarrow.lib cimport pyarrow_wrap_scalar +from pycylon.data.scalar cimport CScalar +from libcpp.memory cimport shared_ptr +from pycylon.data.scalar cimport Scalar + + +cdef class MPICommunicator(Communicator): + + def __cinit__(self): + pass + + cdef void init(self, const shared_ptr[CMPICommunicator]& communicator): + self.mpi_comm_shd_ptr = communicator + + def allreduce(self, value, reduce_op: ReduceOp): + cdef shared_ptr[CScalar] cresult + scalarv = Scalar(pa.scalar(value)) + + self.mpi_comm_shd_ptr.get().AllReduce(scalarv.thisPtr, reduce_op, &cresult) + + return pyarrow_wrap_scalar(cresult.get().data()).as_py() \ No newline at end of file diff --git a/python/pycylon/pycylon/net/redis_ucc_oob_context.pxd b/python/pycylon/pycylon/net/redis_ucc_oob_context.pxd index 132a96c83..0c64eb8ba 100644 --- a/python/pycylon/pycylon/net/redis_ucc_oob_context.pxd +++ b/python/pycylon/pycylon/net/redis_ucc_oob_context.pxd @@ -20,6 +20,7 @@ IF CYTHON_UCX & CYTHON_UCC & CYTHON_REDIS: from pycylon.net.ucx_oob_context cimport CUCXOOBContext from pycylon.net.ucc_oob_context cimport UCCOOBContext from pycylon.net.redis_ucx_oob_context cimport CUCXRedisOOBContext + from pycylon.common.status cimport CStatus from libcpp.string cimport string cdef extern from "../../../../cpp/src/cylon/net/ucx/redis_ucx_ucc_oob_context.hpp" namespace "cylon::net": @@ -36,6 +37,7 @@ IF CYTHON_UCX & CYTHON_UCC & CYTHON_REDIS: int getRank() + @ staticmethod shared_ptr[CUCCRedisOOBContext] Make(int world_size, string redis_addr); diff --git a/python/pycylon/pycylon/net/redis_ucx_oob_context.pyx b/python/pycylon/pycylon/net/redis_ucx_oob_context.pyx index 1ca8a483d..ec5f739eb 100644 --- a/python/pycylon/pycylon/net/redis_ucx_oob_context.pyx +++ b/python/pycylon/pycylon/net/redis_ucx_oob_context.pyx @@ -22,4 +22,4 @@ IF CYTHON_UCX & CYTHON_UCC & CYTHON_REDIS: def __cinit__(self, int world_size, string redis_addr): - self.ucx_redis_oob_context_shd_ptr = make_shared[CUCXRedisOOBContext](world_size, redis_addr) + self.ucx_redis_oob_context_shd_ptr = make_shared[CUCXRedisOOBContext](world_size, redis_addr) \ No newline at end of file diff --git a/python/pycylon/pycylon/net/reduce_op.pxd b/python/pycylon/pycylon/net/reduce_op.pxd new file mode 100644 index 000000000..0e15f6f5a --- /dev/null +++ b/python/pycylon/pycylon/net/reduce_op.pxd @@ -0,0 +1,29 @@ +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +''' +OOB Type mapping from Cylon C++ API +''' + +cdef extern from "../../../../cpp/src/cylon/net/comm_operations.hpp" namespace "cylon::net": + + cdef enum CReduceOp 'cylon::net::ReduceOp': + _SUM 'cylon::net::ReduceOp::SUM' + _MIN 'cylon::net::ReduceOp::MIN' + _MAX 'cylon::net::ReduceOp::MAX' + _PROD 'cylon::net::ReduceOp::PROD' + _LAND 'cylon::net::ReduceOp::LAND' + _LOR 'cylon::net::ReduceOp::LOR' + _BAND 'cylon::net::ReduceOp::BAND' + _BOR 'cylon::net::ReduceOp::BOR' \ No newline at end of file diff --git a/python/pycylon/pycylon/net/reduce_op.pyx b/python/pycylon/pycylon/net/reduce_op.pyx new file mode 100644 index 000000000..d25e0fa83 --- /dev/null +++ b/python/pycylon/pycylon/net/reduce_op.pyx @@ -0,0 +1,29 @@ +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +''' +Mapping Cylon C++ Comm Type with PyCylon CommType +''' + +from pycylon.net.reduce_op cimport CReduceOp + +cpdef enum ReduceOp: + SUM = CReduceOp._SUM + MIN = CReduceOp._MIN + MAX = CReduceOp._MAX + PROD = CReduceOp._PROD + LAND = CReduceOp._LAND + LOR = CReduceOp._LOR + BAND = CReduceOp._BAND + BOR = CReduceOp._BOR \ No newline at end of file diff --git a/python/pycylon/pycylon/net/ucc_ucx_communicator.pxd b/python/pycylon/pycylon/net/ucc_ucx_communicator.pxd new file mode 100644 index 000000000..2a9444ee6 --- /dev/null +++ b/python/pycylon/pycylon/net/ucc_ucx_communicator.pxd @@ -0,0 +1,43 @@ +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +IF CYTHON_UCX & CYTHON_UCC: + + from libcpp.memory cimport shared_ptr + from pycylon.net.comm_type cimport CCommType + from pycylon.net.reduce_op cimport CReduceOp + from pycylon.common.status cimport CStatus + from pycylon.data.scalar cimport CScalar + from pycylon.net.communicator cimport Communicator + + + cdef extern from "../../../../cpp/src/cylon/net/ucx/ucx_communicator.hpp" namespace "cylon::net": + cdef cppclass CUCXUCCCommunicator "cylon::net::UCXUCCCommunicator": + + int GetRank() + int GetWorldSize() + void Finalize() + void Barrier() + CCommType GetCommType() + + CStatus AllReduce(const shared_ptr[CScalar] & value, + CReduceOp reduce_op, + shared_ptr[CScalar] *output) + + + cdef class UCXUCCCommunicator(Communicator): + cdef: + shared_ptr[CUCXUCCCommunicator] ucc_cucx_comm_shd_ptr + + void init(self, const shared_ptr[CUCXUCCCommunicator] & communicator) \ No newline at end of file diff --git a/python/pycylon/pycylon/net/ucc_ucx_communicator.pyx b/python/pycylon/pycylon/net/ucc_ucx_communicator.pyx new file mode 100644 index 000000000..c2b24ded7 --- /dev/null +++ b/python/pycylon/pycylon/net/ucc_ucx_communicator.pyx @@ -0,0 +1,48 @@ + +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +IF CYTHON_UCX & CYTHON_UCC: + + + from pycylon.net.communicator cimport Communicator + from pycylon.net.ucc_ucx_communicator cimport CUCXUCCCommunicator + from pycylon.data.scalar cimport Scalar + from pycylon.data.scalar cimport CScalar + from libcpp.memory cimport shared_ptr + from pycylon.net.reduce_op import ReduceOp + import pyarrow as pa + from pyarrow.lib cimport pyarrow_wrap_scalar + + + cdef class UCXUCCCommunicator(Communicator): + + def __cinit__(self): + pass + + cdef void init(self, const shared_ptr[CUCXUCCCommunicator]& communicator): + self.ucc_cucx_comm_shd_ptr = communicator + + + def allreduce(self, value, reduce_op: ReduceOp): + cdef shared_ptr[CScalar] cresult + scalarv = Scalar(pa.scalar(value)) + + self.ucc_cucx_comm_shd_ptr.get().AllReduce(scalarv.thisPtr, reduce_op, &cresult) + + return pyarrow_wrap_scalar(cresult.get().data()).as_py() + + + + diff --git a/python/pycylon/pycylon/net/ucx_communicator.pxd b/python/pycylon/pycylon/net/ucx_communicator.pxd new file mode 100644 index 000000000..95b77e957 --- /dev/null +++ b/python/pycylon/pycylon/net/ucx_communicator.pxd @@ -0,0 +1,43 @@ +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +IF CYTHON_UCX: + + from libcpp.memory cimport shared_ptr + from pycylon.net.comm_type cimport CCommType + from pycylon.net.reduce_op cimport CReduceOp + from pycylon.common.status cimport CStatus + from pycylon.data.scalar cimport CScalar + from pycylon.net.communicator cimport Communicator + + + cdef extern from "../../../../cpp/src/cylon/net/ucx/ucx_communicator.hpp" namespace "cylon::net": + cdef cppclass CUCXCommunicator "cylon::net::UCXCommunicator": + + int GetRank() + int GetWorldSize() + void Finalize() + void Barrier() + CCommType GetCommType() + + CStatus AllReduce(const shared_ptr[CScalar] & value, + CReduceOp reduce_op, + shared_ptr[CScalar] *output) + + + cdef class UCXCommunicator(Communicator): + cdef: + shared_ptr[CUCXCommunicator] ucc_cucx_comm_shd_ptr + + void init(self, const shared_ptr[CUCXCommunicator] & communicator) \ No newline at end of file diff --git a/python/pycylon/pycylon/net/ucx_communicator.pyx b/python/pycylon/pycylon/net/ucx_communicator.pyx new file mode 100644 index 000000000..bb2cfe442 --- /dev/null +++ b/python/pycylon/pycylon/net/ucx_communicator.pyx @@ -0,0 +1,44 @@ + +## + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ## + +IF CYTHON_UCX: + + + from pycylon.net.communicator cimport Communicator + from pycylon.net.ucx_communicator cimport CUCXCommunicator + from pycylon.data.scalar cimport Scalar + from pycylon.data.scalar cimport CScalar + from libcpp.memory cimport shared_ptr + from pycylon.net.reduce_op import ReduceOp + import pyarrow as pa + from pyarrow.lib cimport pyarrow_wrap_scalar + + + cdef class UCXCommunicator(Communicator): + + def __cinit__(self): + pass + + cdef void init(self, const shared_ptr[CUCXCommunicator]& communicator): + self.ucc_cucx_comm_shd_ptr = communicator + + + def allreduce(self, value, reduce_op: ReduceOp): + cdef shared_ptr[CScalar] cresult + scalarv = Scalar(pa.scalar(value)) + + self.ucc_cucx_comm_shd_ptr.get().AllReduce(scalarv.thisPtr, reduce_op, &cresult) + + return pyarrow_wrap_scalar(cresult.get().data()).as_py() \ No newline at end of file From 8872f813951b8469b9bdb423c6244b050a846bf4 Mon Sep 17 00:00:00 2001 From: mstaylor Date: Thu, 23 Mar 2023 11:30:55 -0400 Subject: [PATCH 02/19] removes db flush and add python script --- cpp/src/examples/demo_join.cpp | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 cpp/src/examples/demo_join.cpp diff --git a/cpp/src/examples/demo_join.cpp b/cpp/src/examples/demo_join.cpp new file mode 100644 index 000000000..94414ef54 --- /dev/null +++ b/cpp/src/examples/demo_join.cpp @@ -0,0 +1,63 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include + +#define CHECK_STATUS(status, msg) \ + if (!status.is_ok()) { \ + LOG(ERROR) << msg << " " << status.get_msg(); \ + ctx->Finalize(); \ + return 1; \ + } + +int main(int argc, char *argv[]) { + + if (argc < 2) { + LOG(ERROR) << "There should be an argument to the directory for data file"; + return 1; + } + + auto mpi_config = std::make_shared(); + std::shared_ptr ctx; + auto initStatus = cylon::CylonContext::InitDistributed(mpi_config, &ctx); + + + const int rank = ctx->GetRank() + 1; + const std::string directory = argv[1] ; + const std::string csv1 = directory + "user_device_tm_" + std::to_string(rank) + ".csv"; + const std::string csv2 = directory + "user_usage_tm_" + std::to_string(rank) + ".csv"; + + std::shared_ptr first_table, second_table, joined_table; + cylon::Status status; + + status = cylon::FromCSV(ctx, csv1, first_table); + CHECK_STATUS(status, "Reading csv1 failed!") + + status = cylon::FromCSV(ctx, csv2, second_table); + CHECK_STATUS(status, "Reading csv2 failed!") + + auto join_config = cylon::join::config::JoinConfig::InnerJoin(0, 3); + status = cylon::DistributedJoin(first_table, second_table, join_config, joined_table); + CHECK_STATUS(status, "Join failed!") + + LOG(INFO) << "First table had : " << first_table->Rows() << " and Second table had : " + << second_table->Rows() << ", Joined has : " << joined_table->Rows(); + + ctx->Finalize(); + return 0; +} From 82033167415eb8b802400784b263abdbf1da96c3 Mon Sep 17 00:00:00 2001 From: mstaylor Date: Fri, 8 Sep 2023 18:05:46 -0400 Subject: [PATCH 03/19] adds support for conda environments with a local ucx (supports customization of ucx) --- build.py | 24 +++++++++++++++++++ conda/environments/cylon_NoUCX.yml | 20 ++++++++++++++++ cpp/CMakeLists.txt | 27 ++++++++++++++++------ cpp/src/examples/redis_ucc_ucx_example.cpp | 2 +- python/pycylon/setup.py | 15 ++++++++++++ 5 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 conda/environments/cylon_NoUCX.yml diff --git a/build.py b/build.py index 85d2fb741..0e32ecea6 100644 --- a/build.py +++ b/build.py @@ -172,12 +172,14 @@ def parse_cmake_flags(flag): CYLON_REDIS = parse_cmake_flags("CYLON_USE_REDIS") CYLON_UCX = parse_cmake_flags('CYLON_UCX') CYLON_UCC = parse_cmake_flags('CYLON_UCC') +UCX_INSTALL_PREFIX = parse_cmake_flags('UCX_INSTALL_PREFIX') UCC_PREFIX = parse_cmake_flags('UCC_INSTALL_PREFIX') REDIS_PREFIX = parse_cmake_flags('REDIS_INSTALL_PREFIX') if CYLON_REDIS and (REDIS_PREFIX is None): REDIS_PREFIX = "/usr/local" + def print_line(): logger.info("=================================================================") @@ -276,6 +278,20 @@ def python_test(): env['LD_LIBRARY_PATH'] = os.path.join(GLOO_PREFIX, "lib") + os.pathsep + \ env['LD_LIBRARY_PATH'] + if UCX_INSTALL_PREFIX is not None: + env['UCX_LOCAL_INSTALL'] = '1' + else: + env['UCX_LOCAL_INSTALL'] = '0' + + if UCX_INSTALL_PREFIX is not None: + env['UCX_INSTALL_PREFIX'] = UCX_INSTALL_PREFIX + env['LD_LIBRARY_PATH'] = os.path.join(UCX_INSTALL_PREFIX, "lib") + os.pathsep + \ + os.path.join(UCX_INSTALL_PREFIX, "lib", "uct") + os.pathsep + \ + os.path.join(UCX_INSTALL_PREFIX, "lib", "ucs") + os.pathsep + \ + os.path.join(UCX_INSTALL_PREFIX, "lib", "ucm") + os.pathsep + \ + os.path.join(UCX_INSTALL_PREFIX, "lib", "ucp") + os.pathsep + \ + env['LD_LIBRARY_PATH'] + if CYLON_UCC: env['CYLON_UCC'] = str(CYLON_UCC) env['UCC_PREFIX'] = UCC_PREFIX @@ -283,6 +299,7 @@ def python_test(): os.path.join(UCC_PREFIX, "lib", "ucc") + os.pathsep + \ env['LD_LIBRARY_PATH'] + if CYLON_REDIS: env['CYLON_REDIS'] = str(CYLON_REDIS) env['REDIS_PREFIX'] = REDIS_PREFIX @@ -331,6 +348,13 @@ def build_python(): env['CYLON_UCC'] = str(CYLON_UCC) env['UCC_PREFIX'] = UCC_PREFIX + if UCX_INSTALL_PREFIX is not None: + env['UCX_LOCAL_INSTALL'] = '1' + env['UCX_INSTALL_PREFIX'] = UCX_INSTALL_PREFIX + else: + env['UCX_LOCAL_INSTALL'] = '0' + + if CYLON_REDIS: env['CYLON_REDIS'] = str(CYLON_REDIS) env['REDIS_PREFIX'] = REDIS_PREFIX diff --git a/conda/environments/cylon_NoUCX.yml b/conda/environments/cylon_NoUCX.yml new file mode 100644 index 000000000..39d6f9ad7 --- /dev/null +++ b/conda/environments/cylon_NoUCX.yml @@ -0,0 +1,20 @@ +name: cylon_dev +channels: + - conda-forge + - defaults +dependencies: + - python>=3.8,<3.10 + - cmake>=3.23.1,!=3.25.0 + - arrow-cpp=9 + - pyarrow=9.0.0 + - glog + - openmpi=4.1.3=ha1ae619_105 + - cython>=0.29.31,<3 + - numpy<1.24.4 + - pandas>=1.0,<2.0.0 + - fsspec>=0.6.0 + - setuptools + # they are not needed for using pygcylon or compiling it + - pytest + - pytest-mpi + - mpi4py diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3f6411207..0415a9a60 100755 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -253,13 +253,26 @@ if (CYLON_UCX) add_definitions(-DBUILD_CYLON_UCX) if (CONDA_LINK_DIRS) - message("Using Conda UCX") - find_library(UCX_UCT uct REQUIRED HINTS ${CONDA_LINK_DIRS}) - find_library(UCX_UCS ucs REQUIRED HINTS ${CONDA_LINK_DIRS}) - find_library(UCX_UCM ucm REQUIRED HINTS ${CONDA_LINK_DIRS}) - find_library(UCX_UCP ucp REQUIRED HINTS ${CONDA_LINK_DIRS}) - set(UCX_LIBRARIES ${UCX_UCT} ${UCX_UCS} ${UCX_UCM} ${UCX_UCP}) - else (CONDA_LINK_DIRS) + message("Using Conda UCX unless UCX_INCLUDEDIR and UCX_LIBDIR is defined") + + if (UCX_INSTALL_PREFIX) + message("setting UCX include and lib directories from install prefix") + include_directories(SYSTEM ${UCX_INSTALL_PREFIX}/include) + set(UCX_LIBRARIES + ${UCX_INSTALL_PREFIX}/lib/libuct.so + ${UCX_INSTALL_PREFIX}/lib/libucs.so + ${UCX_INSTALL_PREFIX}/lib/libucm.so + ${UCX_INSTALL_PREFIX}/lib/libucp.so) + else() + find_library(UCX_UCT uct REQUIRED HINTS ${CONDA_LINK_DIRS}) + find_library(UCX_UCS ucs REQUIRED HINTS ${CONDA_LINK_DIRS}) + find_library(UCX_UCM ucm REQUIRED HINTS ${CONDA_LINK_DIRS}) + find_library(UCX_UCP ucp REQUIRED HINTS ${CONDA_LINK_DIRS}) + set(UCX_LIBRARIES ${UCX_UCT} ${UCX_UCS} ${UCX_UCM} ${UCX_UCP}) + endif () + + + else () message("Using locally installed UCX") # Check if UCX include and lib paths are given diff --git a/cpp/src/examples/redis_ucc_ucx_example.cpp b/cpp/src/examples/redis_ucc_ucx_example.cpp index b25acba6d..29ad5de5e 100644 --- a/cpp/src/examples/redis_ucc_ucx_example.cpp +++ b/cpp/src/examples/redis_ucc_ucx_example.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { //auto mpi_config = std::make_shared(); - auto redis_ucc_ucx_ctx = cylon::net::UCCRedisOOBContext::Make(4, + auto redis_ucc_ucx_ctx = cylon::net::UCCRedisOOBContext::Make(2, "tcp://cylon-redis.mveu6e.0001.use1.cache.amazonaws.com:6379"); auto ucc_config = std::make_shared(redis_ucc_ucx_ctx); diff --git a/python/pycylon/setup.py b/python/pycylon/setup.py index b51a67f81..5de60abd7 100644 --- a/python/pycylon/setup.py +++ b/python/pycylon/setup.py @@ -43,9 +43,12 @@ CYLON_UCX = strtobool(os.environ.get('CYLON_UCX') or '0') CYLON_UCC = strtobool(os.environ.get('CYLON_UCC') or '0') CYLON_REDIS = strtobool(os.environ.get('CYLON_REDIS') or '0') +UCX_LOCAL_INSTALL = strtobool(os.environ.get('UCX_LOCAL_INSTALL') or '0') UCC_PREFIX = os.environ.get('UCC_PREFIX') + REDIS_PREFIX = os.environ.get('REDIS_PREFIX') + print("Cylon prefix:", CYLON_PREFIX) print("Arrow prefix:", ARROW_PREFIX) print("Arrow version:", pyarrow_version) @@ -162,6 +165,16 @@ macros.append(('GLOO_USE_MPI', '0')) macros.append(('BUILD_CYLON_GLOO', '0')) +if UCX_LOCAL_INSTALL: + print("UCX Local install") + UCX_INSTALL_PREFIX = os.environ.get('UCX_INSTALL_PREFIX') + libraries.append('uct') + libraries.append('ucs') + libraries.append('ucm') + libraries.append('ucp') + include_dirs.append(os.path.join(UCX_INSTALL_PREFIX, 'include')) + library_dirs.append(os.path.join(UCX_INSTALL_PREFIX, 'lib')) + if CYLON_UCC and CYLON_UCX: libraries.append('ucc') library_dirs.append(os.path.join(UCC_PREFIX, 'lib')) @@ -170,6 +183,8 @@ macros.append(('BUILD_CYLON_UCC', '1')) compile_time_env['CYTHON_UCX'] = True compile_time_env['CYTHON_UCC'] = True + + else: macros.append(('BUILD_CYLON_UCX', '0')) macros.append(('BUILD_CYLON_UCC', '0')) From 3404452fa28070af86546ee213bb9b4307a055b9 Mon Sep 17 00:00:00 2001 From: mstaylor Date: Sat, 9 Sep 2023 12:23:49 -0400 Subject: [PATCH 04/19] removes cereal library --- cpp/src/cylon/thridparty/cereal/access.hpp | 351 --- .../thridparty/cereal/archives/adapters.hpp | 163 - .../thridparty/cereal/archives/binary.hpp | 169 -- .../cylon/thridparty/cereal/archives/json.hpp | 1041 ------- .../cereal/archives/portable_binary.hpp | 334 --- .../cylon/thridparty/cereal/archives/xml.hpp | 956 ------ cpp/src/cylon/thridparty/cereal/cereal.hpp | 1120 ------- .../thridparty/cereal/details/helpers.hpp | 422 --- .../cereal/details/polymorphic_impl.hpp | 825 ----- .../cereal/details/polymorphic_impl_fwd.hpp | 65 - .../cereal/details/static_object.hpp | 128 - .../thridparty/cereal/details/traits.hpp | 1411 --------- .../cylon/thridparty/cereal/details/util.hpp | 84 - .../cylon/thridparty/cereal/external/LICENSE | 21 - .../thridparty/cereal/external/base64.hpp | 134 - .../cereal/external/rapidjson/LICENSE | 13 - .../cereal/external/rapidjson/allocators.h | 284 -- .../external/rapidjson/cursorstreamwrapper.h | 78 - .../cereal/external/rapidjson/document.h | 2659 ----------------- .../cereal/external/rapidjson/encodedstream.h | 299 -- .../cereal/external/rapidjson/encodings.h | 716 ----- .../cereal/external/rapidjson/error/en.h | 74 - .../cereal/external/rapidjson/error/error.h | 161 - .../external/rapidjson/filereadstream.h | 99 - .../external/rapidjson/filewritestream.h | 104 - .../cereal/external/rapidjson/fwd.h | 151 - .../external/rapidjson/internal/biginteger.h | 290 -- .../external/rapidjson/internal/diyfp.h | 271 -- .../cereal/external/rapidjson/internal/dtoa.h | 245 -- .../external/rapidjson/internal/ieee754.h | 78 - .../cereal/external/rapidjson/internal/itoa.h | 308 -- .../cereal/external/rapidjson/internal/meta.h | 186 -- .../external/rapidjson/internal/pow10.h | 55 - .../external/rapidjson/internal/regex.h | 740 ----- .../external/rapidjson/internal/stack.h | 232 -- .../external/rapidjson/internal/strfunc.h | 69 - .../external/rapidjson/internal/strtod.h | 290 -- .../cereal/external/rapidjson/internal/swap.h | 46 - .../external/rapidjson/istreamwrapper.h | 128 - .../cereal/external/rapidjson/memorybuffer.h | 70 - .../cereal/external/rapidjson/memorystream.h | 71 - .../external/rapidjson/msinttypes/LICENSE | 29 - .../external/rapidjson/msinttypes/inttypes.h | 316 -- .../external/rapidjson/msinttypes/stdint.h | 300 -- .../external/rapidjson/ostreamwrapper.h | 81 - .../cereal/external/rapidjson/pointer.h | 1414 --------- .../cereal/external/rapidjson/prettywriter.h | 277 -- .../cereal/external/rapidjson/rapidjson.h | 656 ---- .../cereal/external/rapidjson/reader.h | 2230 -------------- .../cereal/external/rapidjson/schema.h | 2497 ---------------- .../cereal/external/rapidjson/stream.h | 223 -- .../cereal/external/rapidjson/stringbuffer.h | 121 - .../cereal/external/rapidjson/writer.h | 709 ----- .../cereal/external/rapidxml/license.txt | 52 - .../cereal/external/rapidxml/manual.html | 406 --- .../cereal/external/rapidxml/rapidxml.hpp | 2624 ---------------- .../external/rapidxml/rapidxml_iterators.hpp | 175 -- .../external/rapidxml/rapidxml_print.hpp | 428 --- .../external/rapidxml/rapidxml_utils.hpp | 123 - cpp/src/cylon/thridparty/cereal/macros.hpp | 156 - .../cylon/thridparty/cereal/specialize.hpp | 139 - .../cylon/thridparty/cereal/types/array.hpp | 79 - .../cylon/thridparty/cereal/types/atomic.hpp | 55 - .../thridparty/cereal/types/base_class.hpp | 203 -- .../cylon/thridparty/cereal/types/bitset.hpp | 176 -- .../thridparty/cereal/types/boost_variant.hpp | 164 - .../cylon/thridparty/cereal/types/chrono.hpp | 72 - .../cylon/thridparty/cereal/types/common.hpp | 129 - .../cylon/thridparty/cereal/types/complex.hpp | 56 - .../concepts/pair_associative_container.hpp | 73 - .../cylon/thridparty/cereal/types/deque.hpp | 62 - .../thridparty/cereal/types/forward_list.hpp | 68 - .../thridparty/cereal/types/functional.hpp | 43 - .../cylon/thridparty/cereal/types/list.hpp | 62 - cpp/src/cylon/thridparty/cereal/types/map.hpp | 36 - .../cylon/thridparty/cereal/types/memory.hpp | 425 --- .../thridparty/cereal/types/optional.hpp | 65 - .../thridparty/cereal/types/polymorphic.hpp | 483 --- .../cylon/thridparty/cereal/types/queue.hpp | 132 - cpp/src/cylon/thridparty/cereal/types/set.hpp | 103 - .../cylon/thridparty/cereal/types/stack.hpp | 76 - .../cylon/thridparty/cereal/types/string.hpp | 61 - .../cylon/thridparty/cereal/types/tuple.hpp | 123 - .../thridparty/cereal/types/unordered_map.hpp | 36 - .../thridparty/cereal/types/unordered_set.hpp | 99 - .../cylon/thridparty/cereal/types/utility.hpp | 47 - .../thridparty/cereal/types/valarray.hpp | 89 - .../cylon/thridparty/cereal/types/variant.hpp | 108 - .../cylon/thridparty/cereal/types/vector.hpp | 112 - cpp/src/cylon/thridparty/cereal/version.hpp | 52 - 90 files changed, 31186 deletions(-) delete mode 100644 cpp/src/cylon/thridparty/cereal/access.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/archives/adapters.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/archives/binary.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/archives/json.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/archives/xml.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/cereal.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/helpers.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/static_object.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/traits.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/details/util.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/external/LICENSE delete mode 100644 cpp/src/cylon/thridparty/cereal/external/base64.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/macros.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/specialize.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/array.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/atomic.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/base_class.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/bitset.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/chrono.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/common.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/complex.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/deque.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/forward_list.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/functional.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/list.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/map.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/memory.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/optional.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/queue.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/set.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/stack.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/string.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/tuple.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/utility.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/valarray.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/variant.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/types/vector.hpp delete mode 100644 cpp/src/cylon/thridparty/cereal/version.hpp diff --git a/cpp/src/cylon/thridparty/cereal/access.hpp b/cpp/src/cylon/thridparty/cereal/access.hpp deleted file mode 100644 index af92469df..000000000 --- a/cpp/src/cylon/thridparty/cereal/access.hpp +++ /dev/null @@ -1,351 +0,0 @@ -/*! \file access.hpp - \brief Access control and default construction */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ACCESS_HPP_ -#define CEREAL_ACCESS_HPP_ - -#include -#include -#include -#include - -#include "cylon/thridparty/cereal/macros.hpp" -#include "cylon/thridparty/cereal/specialize.hpp" -#include "cylon/thridparty/cereal/details/helpers.hpp" - -namespace cereal -{ - // ###################################################################### - //! A class that allows cereal to load smart pointers to types that have no default constructor - /*! If your class does not have a default constructor, cereal will not be able - to load any smart pointers to it unless you overload LoadAndConstruct - for your class, and provide an appropriate load_and_construct method. You can also - choose to define a member static function instead of specializing this class. - - The specialization of LoadAndConstruct must be placed within the cereal namespace: - - @code{.cpp} - struct MyType - { - MyType( int x ); // note: no default ctor - int myX; - - // Define a serialize or load/save pair as you normally would - template - void serialize( Archive & ar ) - { - ar( myX ); - } - }; - - // Provide a specialization for LoadAndConstruct for your type - namespace cereal - { - template <> struct LoadAndConstruct - { - // load_and_construct will be passed the archive that you will be loading - // from as well as a construct object which you can use as if it were the - // constructor for your type. cereal will handle all memory management for you. - template - static void load_and_construct( Archive & ar, cereal::construct & construct ) - { - int x; - ar( x ); - construct( x ); - } - - // if you require versioning, simply add a const std::uint32_t as the final parameter, e.g.: - // load_and_construct( Archive & ar, cereal::construct & construct, std::uint32_t const version ) - }; - } // end namespace cereal - @endcode - - Please note that just as in using external serialization functions, you cannot get - access to non-public members of your class by befriending cereal::access. If you - have the ability to modify the class you wish to serialize, it is recommended that you - use member serialize functions and a static member load_and_construct function. - - load_and_construct functions, regardless of whether they are static members of your class or - whether you create one in the LoadAndConstruct specialization, have the following signature: - - @code{.cpp} - // generally Archive will be templated, but it can be specific if desired - template - static void load_and_construct( Archive & ar, cereal::construct & construct ); - // with an optional last parameter specifying the version: const std::uint32_t version - @endcode - - Versioning behaves the same way as it does for standard serialization functions. - - @tparam T The type to specialize for - @ingroup Access */ - template - struct LoadAndConstruct - { }; - - // forward decl for construct - //! @cond PRIVATE_NEVERDEFINED - namespace memory_detail{ template struct LoadAndConstructLoadWrapper; } - namespace boost_variant_detail{ template struct LoadAndConstructLoadWrapper; } - //! @endcond - - //! Used to construct types with no default constructor - /*! When serializing a type that has no default constructor, cereal - will attempt to call either the class static function load_and_construct - or the appropriate template specialization of LoadAndConstruct. cereal - will pass that function a reference to the archive as well as a reference - to a construct object which should be used to perform the allocation once - data has been appropriately loaded. - - @code{.cpp} - struct MyType - { - // note the lack of default constructor - MyType( int xx, int yy ); - - int x, y; - double notInConstructor; - - template - void serialize( Archive & ar ) - { - ar( x, y ); - ar( notInConstructor ); - } - - template - static void load_and_construct( Archive & ar, cereal::construct & construct ) - { - int x, y; - ar( x, y ); - - // use construct object to initialize with loaded data - construct( x, y ); - - // access to member variables and functions via -> operator - ar( construct->notInConstructor ); - - // could also do the above section by: - double z; - ar( z ); - construct->notInConstructor = z; - } - }; - @endcode - - @tparam T The class type being serialized - */ - template - class construct - { - public: - //! Construct and initialize the type T with the given arguments - /*! This will forward all arguments to the underlying type T, - calling an appropriate constructor. - - Calling this function more than once will result in an exception - being thrown. - - @param args The arguments to the constructor for T - @throw Exception If called more than once */ - template - void operator()( Args && ... args ); - // implementation deferred due to reliance on cereal::access - - //! Get a reference to the initialized underlying object - /*! This must be called after the object has been initialized. - - @return A reference to the initialized object - @throw Exception If called before initialization */ - T * operator->() - { - if( !itsValid ) - throw Exception("Object must be initialized prior to accessing members"); - - return itsPtr; - } - - //! Returns a raw pointer to the initialized underlying object - /*! This is mainly intended for use with passing an instance of - a constructed object to cereal::base_class. - - It is strongly recommended to avoid using this function in - any other circumstance. - - @return A raw pointer to the initialized type */ - T * ptr() - { - return operator->(); - } - - private: - template friend struct ::cereal::memory_detail::LoadAndConstructLoadWrapper; - template friend struct ::cereal::boost_variant_detail::LoadAndConstructLoadWrapper; - - construct( T * p ) : itsPtr( p ), itsEnableSharedRestoreFunction( [](){} ), itsValid( false ) {} - construct( T * p, std::function enableSharedFunc ) : // g++4.7 ice with default lambda to std func - itsPtr( p ), itsEnableSharedRestoreFunction( enableSharedFunc ), itsValid( false ) {} - construct( construct const & ) = delete; - construct & operator=( construct const & ) = delete; - - T * itsPtr; - std::function itsEnableSharedRestoreFunction; - bool itsValid; - }; - - // ###################################################################### - //! A class that can be made a friend to give cereal access to non public functions - /*! If you desire non-public serialization functions within a class, cereal can only - access these if you declare cereal::access a friend. - - @code{.cpp} - class MyClass - { - private: - friend class cereal::access; // gives access to the private serialize - - template - void serialize( Archive & ar ) - { - // some code - } - }; - @endcode - @ingroup Access */ - class access - { - public: - // ####### Standard Serialization ######################################## - template inline - static auto member_serialize(Archive & ar, T & t) -> decltype(t.CEREAL_SERIALIZE_FUNCTION_NAME(ar)) - { return t.CEREAL_SERIALIZE_FUNCTION_NAME(ar); } - - template inline - static auto member_save(Archive & ar, T const & t) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar)) - { return t.CEREAL_SAVE_FUNCTION_NAME(ar); } - - template inline - static auto member_save_non_const(Archive & ar, T & t) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar)) - { return t.CEREAL_SAVE_FUNCTION_NAME(ar); } - - template inline - static auto member_load(Archive & ar, T & t) -> decltype(t.CEREAL_LOAD_FUNCTION_NAME(ar)) - { return t.CEREAL_LOAD_FUNCTION_NAME(ar); } - - template inline - static auto member_save_minimal(Archive const & ar, T const & t) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar)) - { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar); } - - template inline - static auto member_save_minimal_non_const(Archive const & ar, T & t) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar)) - { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar); } - - template inline - static auto member_load_minimal(Archive const & ar, T & t, U && u) -> decltype(t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u))) - { return t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u)); } - - // ####### Versioned Serialization ####################################### - template inline - static auto member_serialize(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_SERIALIZE_FUNCTION_NAME(ar, version)) - { return t.CEREAL_SERIALIZE_FUNCTION_NAME(ar, version); } - - template inline - static auto member_save(Archive & ar, T const & t, const std::uint32_t version ) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar, version)) - { return t.CEREAL_SAVE_FUNCTION_NAME(ar, version); } - - template inline - static auto member_save_non_const(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_SAVE_FUNCTION_NAME(ar, version)) - { return t.CEREAL_SAVE_FUNCTION_NAME(ar, version); } - - template inline - static auto member_load(Archive & ar, T & t, const std::uint32_t version ) -> decltype(t.CEREAL_LOAD_FUNCTION_NAME(ar, version)) - { return t.CEREAL_LOAD_FUNCTION_NAME(ar, version); } - - template inline - static auto member_save_minimal(Archive const & ar, T const & t, const std::uint32_t version) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version)) - { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version); } - - template inline - static auto member_save_minimal_non_const(Archive const & ar, T & t, const std::uint32_t version) -> decltype(t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version)) - { return t.CEREAL_SAVE_MINIMAL_FUNCTION_NAME(ar, version); } - - template inline - static auto member_load_minimal(Archive const & ar, T & t, U && u, const std::uint32_t version) -> decltype(t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u), version)) - { return t.CEREAL_LOAD_MINIMAL_FUNCTION_NAME(ar, std::forward(u), version); } - - // ####### Other Functionality ########################################## - // for detecting inheritance from enable_shared_from_this - template inline - static auto shared_from_this(T & t) -> decltype(t.shared_from_this()); - - // for placement new - template inline - static void construct( T *& ptr, Args && ... args ) - { - new (ptr) T( std::forward( args )... ); - } - - // for non-placement new with a default constructor - template inline - static T * construct() - { - return new T(); - } - - template inline - static std::false_type load_and_construct(...) - { return std::false_type(); } - - template inline - static auto load_and_construct(Archive & ar, ::cereal::construct & construct) -> decltype(T::load_and_construct(ar, construct)) - { - T::load_and_construct( ar, construct ); - } - - template inline - static auto load_and_construct(Archive & ar, ::cereal::construct & construct, const std::uint32_t version) -> decltype(T::load_and_construct(ar, construct, version)) - { - T::load_and_construct( ar, construct, version ); - } - }; // end class access - - // ###################################################################### - // Deferred Implementation, see construct for more information - template template inline - void construct::operator()( Args && ... args ) - { - if( itsValid ) - throw Exception("Attempting to construct an already initialized object"); - - ::cereal::access::construct( itsPtr, std::forward( args )... ); - itsEnableSharedRestoreFunction(); - itsValid = true; - } -} // namespace cereal - -#endif // CEREAL_ACCESS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp b/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp deleted file mode 100644 index 9615c604a..000000000 --- a/cpp/src/cylon/thridparty/cereal/archives/adapters.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/*! \file adapters.hpp - \brief Archive adapters that provide additional functionality - on top of an existing archive */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ARCHIVES_ADAPTERS_HPP_ -#define CEREAL_ARCHIVES_ADAPTERS_HPP_ - -#include "cylon/thridparty/cereal/details/helpers.hpp" -#include - -namespace cereal -{ - #ifdef CEREAL_FUTURE_EXPERIMENTAL - - // Forward declaration for friend access - template U & get_user_data( A & ); - - //! Wraps an archive and gives access to user data - /*! This adapter is useful if you require access to - either raw pointers or references within your - serialization functions. - - While cereal does not directly support serialization - raw pointers or references, it is sometimes the case - that you may want to supply something such as a raw - pointer or global reference to some constructor. - In this situation this adapter would likely be used - with the construct class to allow for non-default - constructors. - - @note This feature is experimental and may be altered or removed in a future release. See issue #46. - - @code{.cpp} - struct MyUserData - { - int * myRawPointer; - std::reference_wrapper myReference; - }; - - struct MyClass - { - // Note the raw pointer parameter - MyClass( int xx, int * rawP ); - - int x; - - template - void serialize( Archive & ar ) - { ar( x ); } - - template - static void load_and_construct( Archive & ar, cereal::construct & construct ) - { - int xx; - ar( xx ); - // note the need to use get_user_data to retrieve user data from the archive - construct( xx, cereal::get_user_data( ar ).myRawPointer ); - } - }; - - int main() - { - { - MyUserData md; - md.myRawPointer = &something; - md.myReference = someInstanceOfType; - - std::ifstream is( "data.xml" ); - cereal::UserDataAdapter ar( md, is ); - - std::unique_ptr sc; - ar( sc ); // use as normal - } - - return 0; - } - @endcode - - @relates get_user_data - - @tparam UserData The type to give the archive access to - @tparam Archive The archive to wrap */ - template - class UserDataAdapter : public Archive - { - public: - //! Construct the archive with some user data struct - /*! This will forward all arguments (other than the user - data) to the wrapped archive type. The UserDataAdapter - can then be used identically to the wrapped archive type - - @tparam Args The arguments to pass to the constructor of - the archive. */ - template - UserDataAdapter( UserData & ud, Args && ... args ) : - Archive( std::forward( args )... ), - userdata( ud ) - { } - - private: - //! Overload the rtti function to enable dynamic_cast - void rtti() {} - friend UserData & get_user_data( Archive & ar ); - UserData & userdata; //!< The actual user data - }; - - //! Retrieves user data from an archive wrapped by UserDataAdapter - /*! This will attempt to retrieve the user data associated with - some archive wrapped by UserDataAdapter. If this is used on - an archive that is not wrapped, a run-time exception will occur. - - @note This feature is experimental and may be altered or removed in a future release. See issue #46. - - @note The correct use of this function cannot be enforced at compile - time. - - @relates UserDataAdapter - @tparam UserData The data struct contained in the archive - @tparam Archive The archive, which should be wrapped by UserDataAdapter - @param ar The archive - @throws Exception if the archive this is used upon is not wrapped with - UserDataAdapter. */ - template - UserData & get_user_data( Archive & ar ) - { - try - { - return dynamic_cast &>( ar ).userdata; - } - catch( std::bad_cast const & ) - { - throw ::cereal::Exception("Attempting to get user data from archive not wrapped in UserDataAdapter"); - } - } - #endif // CEREAL_FUTURE_EXPERIMENTAL -} // namespace cereal - -#endif // CEREAL_ARCHIVES_ADAPTERS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/binary.hpp b/cpp/src/cylon/thridparty/cereal/archives/binary.hpp deleted file mode 100644 index 4c22cdf17..000000000 --- a/cpp/src/cylon/thridparty/cereal/archives/binary.hpp +++ /dev/null @@ -1,169 +0,0 @@ -/*! \file binary.hpp - \brief Binary input and output archives */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ARCHIVES_BINARY_HPP_ -#define CEREAL_ARCHIVES_BINARY_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - // ###################################################################### - //! An output archive designed to save data in a compact binary representation - /*! This archive outputs data to a stream in an extremely compact binary - representation with as little extra metadata as possible. - - This archive does nothing to ensure that the endianness of the saved - and loaded data is the same. If you need to have portability over - architectures with different endianness, use PortableBinaryOutputArchive. - - When using a binary archive and a file stream, you must use the - std::ios::binary format flag to avoid having your data altered - inadvertently. - - \ingroup Archives */ - class BinaryOutputArchive : public OutputArchive - { - public: - //! Construct, outputting to the provided stream - /*! @param stream The stream to output to. Can be a stringstream, a file stream, or - even cout! */ - BinaryOutputArchive(std::ostream & stream) : - OutputArchive(this), - itsStream(stream) - { } - - ~BinaryOutputArchive() CEREAL_NOEXCEPT = default; - - //! Writes size bytes of data to the output stream - void saveBinary( const void * data, std::streamsize size ) - { - auto const writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); - - if(writtenSize != size) - throw Exception("Failed to write " + std::to_string(size) + " bytes to output stream! Wrote " + std::to_string(writtenSize)); - } - - private: - std::ostream & itsStream; - }; - - // ###################################################################### - //! An input archive designed to load data saved using BinaryOutputArchive - /* This archive does nothing to ensure that the endianness of the saved - and loaded data is the same. If you need to have portability over - architectures with different endianness, use PortableBinaryOutputArchive. - - When using a binary archive and a file stream, you must use the - std::ios::binary format flag to avoid having your data altered - inadvertently. - - \ingroup Archives */ - class BinaryInputArchive : public InputArchive - { - public: - //! Construct, loading from the provided stream - BinaryInputArchive(std::istream & stream) : - InputArchive(this), - itsStream(stream) - { } - - ~BinaryInputArchive() CEREAL_NOEXCEPT = default; - - //! Reads size bytes of data from the input stream - void loadBinary( void * const data, std::streamsize size ) - { - auto const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); - - if(readSize != size) - throw Exception("Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize)); - } - - private: - std::istream & itsStream; - }; - - // ###################################################################### - // Common BinaryArchive serialization functions - - //! Saving for POD types to binary - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive & ar, T const & t) - { - ar.saveBinary(std::addressof(t), sizeof(t)); - } - - //! Loading for POD types from binary - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive & ar, T & t) - { - ar.loadBinary(std::addressof(t), sizeof(t)); - } - - //! Serializing NVP types to binary - template inline - CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) - CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, NameValuePair & t ) - { - ar( t.value ); - } - - //! Serializing SizeTags to binary - template inline - CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) - CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, SizeTag & t ) - { - ar( t.size ); - } - - //! Saving binary data - template inline - void CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive & ar, BinaryData const & bd) - { - ar.saveBinary( bd.data, static_cast( bd.size ) ); - } - - //! Loading binary data - template inline - void CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive & ar, BinaryData & bd) - { - ar.loadBinary(bd.data, static_cast( bd.size ) ); - } -} // namespace cereal - -// register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::BinaryOutputArchive) -CEREAL_REGISTER_ARCHIVE(cereal::BinaryInputArchive) - -// tie input and output archives together -CEREAL_SETUP_ARCHIVE_TRAITS(cereal::BinaryInputArchive, cereal::BinaryOutputArchive) - -#endif // CEREAL_ARCHIVES_BINARY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/json.hpp b/cpp/src/cylon/thridparty/cereal/archives/json.hpp deleted file mode 100644 index 37a1e1337..000000000 --- a/cpp/src/cylon/thridparty/cereal/archives/json.hpp +++ /dev/null @@ -1,1041 +0,0 @@ -/*! \file json.hpp - \brief JSON input and output archives */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ARCHIVES_JSON_HPP_ -#define CEREAL_ARCHIVES_JSON_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include "cylon/thridparty/cereal/details/util.hpp" - -namespace cereal -{ - //! An exception thrown when rapidjson fails an internal assertion - /*! @ingroup Utility */ - struct RapidJSONException : Exception - { RapidJSONException( const char * what_ ) : Exception( what_ ) {} }; -} - -// Inform rapidjson that assert will throw -#ifndef CEREAL_RAPIDJSON_ASSERT_THROWS -#define CEREAL_RAPIDJSON_ASSERT_THROWS -#endif // CEREAL_RAPIDJSON_ASSERT_THROWS - -// Override rapidjson assertions to throw exceptions by default -#ifndef CEREAL_RAPIDJSON_ASSERT -#define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ \ - throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); } -#endif // RAPIDJSON_ASSERT - -// Enable support for parsing of nan, inf, -inf -#ifndef CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS -#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNanAndInfFlag -#endif - -// Enable support for parsing of nan, inf, -inf -#ifndef CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS -#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag | kParseNanAndInfFlag -#endif - -#include "cereal/external/rapidjson/prettywriter.h" -#include "cereal/external/rapidjson/ostreamwrapper.h" -#include "cereal/external/rapidjson/istreamwrapper.h" -#include "cereal/external/rapidjson/document.h" -#include "cereal/external/base64.hpp" - -#include -#include -#include -#include -#include - -namespace cereal -{ - // ###################################################################### - //! An output archive designed to save data to JSON - /*! This archive uses RapidJSON to build serialize data to JSON. - - JSON archives provides a human readable output but at decreased - performance (both in time and space) compared to binary archives. - - JSON archives are only guaranteed to finish flushing their contents - upon destruction and should thus be used in an RAII fashion. - - JSON benefits greatly from name-value pairs, which if present, will - name the nodes in the output. If these are not present, each level - of the output will be given an automatically generated delimited name. - - The precision of the output archive controls the number of decimals output - for floating point numbers and should be sufficiently large (i.e. at least 20) - if there is a desire to have binary equality between the numbers output and - those read in. In general you should expect a loss of precision when going - from floating point to text and back. - - JSON archives do not output the size information for any dynamically sized structure - and instead infer it from the number of children for a node. This means that data - can be hand edited for dynamic sized structures and will still be readable. This - is accomplished through the cereal::SizeTag object, which will cause the archive - to output the data as a JSON array (e.g. marked by [] instead of {}), which indicates - that the container is variable sized and may be edited. - - \ingroup Archives */ - class JSONOutputArchive : public OutputArchive, public traits::TextArchive - { - enum class NodeType { StartObject, InObject, StartArray, InArray }; - - using WriteStream = CEREAL_RAPIDJSON_NAMESPACE::OStreamWrapper; - using JSONWriter = CEREAL_RAPIDJSON_NAMESPACE::PrettyWriter; - - public: - /*! @name Common Functionality - Common use cases for directly interacting with an JSONOutputArchive */ - //! @{ - - //! A class containing various advanced options for the JSON archive - class Options - { - public: - //! Default options - static Options Default(){ return Options(); } - - //! Default options with no indentation - static Options NoIndent(){ return Options( JSONWriter::kDefaultMaxDecimalPlaces, IndentChar::space, 0 ); } - - //! The character to use for indenting - enum class IndentChar : char - { - space = ' ', - tab = '\t', - newline = '\n', - carriage_return = '\r' - }; - - //! Specify specific options for the JSONOutputArchive - /*! @param precision The precision used for floating point numbers - @param indentChar The type of character to indent with - @param indentLength The number of indentChar to use for indentation - (0 corresponds to no indentation) */ - explicit Options( int precision = JSONWriter::kDefaultMaxDecimalPlaces, - IndentChar indentChar = IndentChar::space, - unsigned int indentLength = 4 ) : - itsPrecision( precision ), - itsIndentChar( static_cast(indentChar) ), - itsIndentLength( indentLength ) { } - - private: - friend class JSONOutputArchive; - int itsPrecision; - char itsIndentChar; - unsigned int itsIndentLength; - }; - - //! Construct, outputting to the provided stream - /*! @param stream The stream to output to. - @param options The JSON specific options to use. See the Options struct - for the values of default parameters */ - JSONOutputArchive(std::ostream & stream, Options const & options = Options::Default() ) : - OutputArchive(this), - itsWriteStream(stream), - itsWriter(itsWriteStream), - itsNextName(nullptr) - { - itsWriter.SetMaxDecimalPlaces( options.itsPrecision ); - itsWriter.SetIndent( options.itsIndentChar, options.itsIndentLength ); - itsNameCounter.push(0); - itsNodeStack.push(NodeType::StartObject); - } - - //! Destructor, flushes the JSON - ~JSONOutputArchive() CEREAL_NOEXCEPT - { - if (itsNodeStack.top() == NodeType::InObject) - itsWriter.EndObject(); - else if (itsNodeStack.top() == NodeType::InArray) - itsWriter.EndArray(); - } - - //! Saves some binary data, encoded as a base64 string, with an optional name - /*! This will create a new node, optionally named, and insert a value that consists of - the data encoded as a base64 string */ - void saveBinaryValue( const void * data, size_t size, const char * name = nullptr ) - { - setNextName( name ); - writeName(); - - auto base64string = base64::encode( reinterpret_cast( data ), size ); - saveValue( base64string ); - } - - //! @} - /*! @name Internal Functionality - Functionality designed for use by those requiring control over the inner mechanisms of - the JSONOutputArchive */ - //! @{ - - //! Starts a new node in the JSON output - /*! The node can optionally be given a name by calling setNextName prior - to creating the node - - Nodes only need to be started for types that are themselves objects or arrays */ - void startNode() - { - writeName(); - itsNodeStack.push(NodeType::StartObject); - itsNameCounter.push(0); - } - - //! Designates the most recently added node as finished - void finishNode() - { - // if we ended up serializing an empty object or array, writeName - // will never have been called - so start and then immediately end - // the object/array. - // - // We'll also end any object/arrays we happen to be in - switch(itsNodeStack.top()) - { - case NodeType::StartArray: - itsWriter.StartArray(); - // fall through - case NodeType::InArray: - itsWriter.EndArray(); - break; - case NodeType::StartObject: - itsWriter.StartObject(); - // fall through - case NodeType::InObject: - itsWriter.EndObject(); - break; - } - - itsNodeStack.pop(); - itsNameCounter.pop(); - } - - //! Sets the name for the next node created with startNode - void setNextName( const char * name ) - { - itsNextName = name; - } - - //! Saves a bool to the current node - void saveValue(bool b) { itsWriter.Bool(b); } - //! Saves an int to the current node - void saveValue(int i) { itsWriter.Int(i); } - //! Saves a uint to the current node - void saveValue(unsigned u) { itsWriter.Uint(u); } - //! Saves an int64 to the current node - void saveValue(int64_t i64) { itsWriter.Int64(i64); } - //! Saves a uint64 to the current node - void saveValue(uint64_t u64) { itsWriter.Uint64(u64); } - //! Saves a double to the current node - void saveValue(double d) { itsWriter.Double(d); } - //! Saves a string to the current node - void saveValue(std::string const & s) { itsWriter.String(s.c_str(), static_cast( s.size() )); } - //! Saves a const char * to the current node - void saveValue(char const * s) { itsWriter.String(s); } - //! Saves a nullptr to the current node - void saveValue(std::nullptr_t) { itsWriter.Null(); } - - template inline - typename std::enable_if::value && std::is_same::value, void>::type - saveValue(T val) { itsWriter.Int64(val); } - template inline - typename std::enable_if::value && std::is_same::value, void>::type - saveValue(T val) { itsWriter.Uint64(val); } - - private: - // Some compilers/OS have difficulty disambiguating the above for various flavors of longs, so we provide - // special overloads to handle these cases. - - //! 32 bit signed long saving to current node - template ::value> = traits::sfinae> inline - void saveLong(T l){ saveValue( static_cast( l ) ); } - - //! non 32 bit signed long saving to current node - template ::value> = traits::sfinae> inline - void saveLong(T l){ saveValue( static_cast( l ) ); } - - //! 32 bit unsigned long saving to current node - template ::value> = traits::sfinae> inline - void saveLong(T lu){ saveValue( static_cast( lu ) ); } - - //! non 32 bit unsigned long saving to current node - template ::value> = traits::sfinae> inline - void saveLong(T lu){ saveValue( static_cast( lu ) ); } - - public: -#if defined(_MSC_VER) && _MSC_VER < 1916 - //! MSVC only long overload to current node - void saveValue( unsigned long lu ){ saveLong( lu ); }; -#else // _MSC_VER - //! Serialize a long if it would not be caught otherwise - template ::value, - !std::is_same::value, - !std::is_same::value> = traits::sfinae> inline - void saveValue( T t ){ saveLong( t ); } - - //! Serialize an unsigned long if it would not be caught otherwise - template ::value, - !std::is_same::value, - !std::is_same::value> = traits::sfinae> inline - void saveValue( T t ){ saveLong( t ); } -#endif // _MSC_VER - - //! Save exotic arithmetic as strings to current node - /*! Handles long long (if distinct from other types), unsigned long (if distinct), and long double */ - template ::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long))> = traits::sfinae> inline - void saveValue(T const & t) - { - std::stringstream ss; ss.precision( std::numeric_limits::max_digits10 ); - ss << t; - saveValue( ss.str() ); - } - - //! Write the name of the upcoming node and prepare object/array state - /*! Since writeName is called for every value that is output, regardless of - whether it has a name or not, it is the place where we will do a deferred - check of our node state and decide whether we are in an array or an object. - - The general workflow of saving to the JSON archive is: - - 1. (optional) Set the name for the next node to be created, usually done by an NVP - 2. Start the node - 3. (if there is data to save) Write the name of the node (this function) - 4. (if there is data to save) Save the data (with saveValue) - 5. Finish the node - */ - void writeName() - { - NodeType const & nodeType = itsNodeStack.top(); - - // Start up either an object or an array, depending on state - if(nodeType == NodeType::StartArray) - { - itsWriter.StartArray(); - itsNodeStack.top() = NodeType::InArray; - } - else if(nodeType == NodeType::StartObject) - { - itsNodeStack.top() = NodeType::InObject; - itsWriter.StartObject(); - } - - // Array types do not output names - if(nodeType == NodeType::InArray) return; - - if(itsNextName == nullptr) - { - std::string name = "value" + std::to_string( itsNameCounter.top()++ ) + "\0"; - saveValue(name); - } - else - { - saveValue(itsNextName); - itsNextName = nullptr; - } - } - - //! Designates that the current node should be output as an array, not an object - void makeArray() - { - itsNodeStack.top() = NodeType::StartArray; - } - - //! @} - - private: - WriteStream itsWriteStream; //!< Rapidjson write stream - JSONWriter itsWriter; //!< Rapidjson writer - char const * itsNextName; //!< The next name - std::stack itsNameCounter; //!< Counter for creating unique names for unnamed nodes - std::stack itsNodeStack; - }; // JSONOutputArchive - - // ###################################################################### - //! An input archive designed to load data from JSON - /*! This archive uses RapidJSON to read in a JSON archive. - - As with the output JSON archive, the preferred way to use this archive is in - an RAII fashion, ensuring its destruction after all data has been read. - - Input JSON should have been produced by the JSONOutputArchive. Data can - only be added to dynamically sized containers (marked by JSON arrays) - - the input archive will determine their size by looking at the number of child nodes. - Only JSON originating from a JSONOutputArchive is officially supported, but data - from other sources may work if properly formatted. - - The JSONInputArchive does not require that nodes are loaded in the same - order they were saved by JSONOutputArchive. Using name value pairs (NVPs), - it is possible to load in an out of order fashion or otherwise skip/select - specific nodes to load. - - The default behavior of the input archive is to read sequentially starting - with the first node and exploring its children. When a given NVP does - not match the read in name for a node, the archive will search for that - node at the current level and load it if it exists. After loading an out of - order node, the archive will then proceed back to loading sequentially from - its new position. - - Consider this simple example where loading of some data is skipped: - - @code{cpp} - // imagine the input file has someData(1-9) saved in order at the top level node - ar( someData1, someData2, someData3 ); // XML loads in the order it sees in the file - ar( cereal::make_nvp( "hello", someData6 ) ); // NVP given does not - // match expected NVP name, so we search - // for the given NVP and load that value - ar( someData7, someData8, someData9 ); // with no NVP given, loading resumes at its - // current location, proceeding sequentially - @endcode - - \ingroup Archives */ - class JSONInputArchive : public InputArchive, public traits::TextArchive - { - private: - using ReadStream = CEREAL_RAPIDJSON_NAMESPACE::IStreamWrapper; - typedef CEREAL_RAPIDJSON_NAMESPACE::GenericValue> JSONValue; - typedef JSONValue::ConstMemberIterator MemberIterator; - typedef JSONValue::ConstValueIterator ValueIterator; - typedef CEREAL_RAPIDJSON_NAMESPACE::Document::GenericValue GenericValue; - - public: - /*! @name Common Functionality - Common use cases for directly interacting with an JSONInputArchive */ - //! @{ - - //! Construct, reading from the provided stream - /*! @param stream The stream to read from */ - JSONInputArchive(std::istream & stream) : - InputArchive(this), - itsNextName( nullptr ), - itsReadStream(stream) - { - itsDocument.ParseStream<>(itsReadStream); - if (itsDocument.IsArray()) - itsIteratorStack.emplace_back(itsDocument.Begin(), itsDocument.End()); - else - itsIteratorStack.emplace_back(itsDocument.MemberBegin(), itsDocument.MemberEnd()); - } - - ~JSONInputArchive() CEREAL_NOEXCEPT = default; - - //! Loads some binary data, encoded as a base64 string - /*! This will automatically start and finish a node to load the data, and can be called directly by - users. - - Note that this follows the same ordering rules specified in the class description in regards - to loading in/out of order */ - void loadBinaryValue( void * data, size_t size, const char * name = nullptr ) - { - itsNextName = name; - - std::string encoded; - loadValue( encoded ); - auto decoded = base64::decode( encoded ); - - if( size != decoded.size() ) - throw Exception("Decoded binary data size does not match specified size"); - - std::memcpy( data, decoded.data(), decoded.size() ); - itsNextName = nullptr; - } - - private: - //! @} - /*! @name Internal Functionality - Functionality designed for use by those requiring control over the inner mechanisms of - the JSONInputArchive */ - //! @{ - - //! An internal iterator that handles both array and object types - /*! This class is a variant and holds both types of iterators that - rapidJSON supports - one for arrays and one for objects. */ - class Iterator - { - public: - Iterator() : itsIndex( 0 ), itsType(Null_) {} - - Iterator(MemberIterator begin, MemberIterator end) : - itsMemberItBegin(begin), itsMemberItEnd(end), itsIndex(0), itsSize(std::distance(begin, end)), itsType(Member) - { - if( itsSize == 0 ) - itsType = Null_; - } - - Iterator(ValueIterator begin, ValueIterator end) : - itsValueItBegin(begin), itsIndex(0), itsSize(std::distance(begin, end)), itsType(Value) - { - if( itsSize == 0 ) - itsType = Null_; - } - - //! Advance to the next node - Iterator & operator++() - { - ++itsIndex; - return *this; - } - - //! Get the value of the current node - GenericValue const & value() - { - if( itsIndex >= itsSize ) - throw cereal::Exception("No more objects in input"); - - switch(itsType) - { - case Value : return itsValueItBegin[itsIndex]; - case Member: return itsMemberItBegin[itsIndex].value; - default: throw cereal::Exception("JSONInputArchive internal error: null or empty iterator to object or array!"); - } - } - - //! Get the name of the current node, or nullptr if it has no name - const char * name() const - { - if( itsType == Member && (itsMemberItBegin + itsIndex) != itsMemberItEnd ) - return itsMemberItBegin[itsIndex].name.GetString(); - else - return nullptr; - } - - //! Adjust our position such that we are at the node with the given name - /*! @throws Exception if no such named node exists */ - inline void search( const char * searchName ) - { - const auto len = std::strlen( searchName ); - size_t index = 0; - for( auto it = itsMemberItBegin; it != itsMemberItEnd; ++it, ++index ) - { - const auto currentName = it->name.GetString(); - if( ( std::strncmp( searchName, currentName, len ) == 0 ) && - ( std::strlen( currentName ) == len ) ) - { - itsIndex = index; - return; - } - } - - throw Exception("JSON Parsing failed - provided NVP (" + std::string(searchName) + ") not found"); - } - - private: - MemberIterator itsMemberItBegin, itsMemberItEnd; //!< The member iterator (object) - ValueIterator itsValueItBegin; //!< The value iterator (array) - size_t itsIndex, itsSize; //!< The current index of this iterator - enum Type {Value, Member, Null_} itsType; //!< Whether this holds values (array) or members (objects) or nothing - }; - - //! Searches for the expectedName node if it doesn't match the actualName - /*! This needs to be called before every load or node start occurs. This function will - check to see if an NVP has been provided (with setNextName) and if so, see if that name matches the actual - next name given. If the names do not match, it will search in the current level of the JSON for that name. - If the name is not found, an exception will be thrown. - - Resets the NVP name after called. - - @throws Exception if an expectedName is given and not found */ - inline void search() - { - // store pointer to itsNextName locally and reset to nullptr in case search() throws - auto localNextName = itsNextName; - itsNextName = nullptr; - - // The name an NVP provided with setNextName() - if( localNextName ) - { - // The actual name of the current node - auto const actualName = itsIteratorStack.back().name(); - - // Do a search if we don't see a name coming up, or if the names don't match - if( !actualName || std::strcmp( localNextName, actualName ) != 0 ) - itsIteratorStack.back().search( localNextName ); - } - } - - public: - //! Starts a new node, going into its proper iterator - /*! This places an iterator for the next node to be parsed onto the iterator stack. If the next - node is an array, this will be a value iterator, otherwise it will be a member iterator. - - By default our strategy is to start with the document root node and then recursively iterate through - all children in the order they show up in the document. - We don't need to know NVPs to do this; we'll just blindly load in the order things appear in. - - If we were given an NVP, we will search for it if it does not match our the name of the next node - that would normally be loaded. This functionality is provided by search(). */ - void startNode() - { - search(); - - if(itsIteratorStack.back().value().IsArray()) - itsIteratorStack.emplace_back(itsIteratorStack.back().value().Begin(), itsIteratorStack.back().value().End()); - else - itsIteratorStack.emplace_back(itsIteratorStack.back().value().MemberBegin(), itsIteratorStack.back().value().MemberEnd()); - } - - //! Finishes the most recently started node - void finishNode() - { - itsIteratorStack.pop_back(); - ++itsIteratorStack.back(); - } - - //! Retrieves the current node name - /*! @return nullptr if no name exists */ - const char * getNodeName() const - { - return itsIteratorStack.back().name(); - } - - //! Sets the name for the next node created with startNode - void setNextName( const char * name ) - { - itsNextName = name; - } - - //! Loads a value from the current node - small signed overload - template ::value, - sizeof(T) < sizeof(int64_t)> = traits::sfinae> inline - void loadValue(T & val) - { - search(); - - val = static_cast( itsIteratorStack.back().value().GetInt() ); - ++itsIteratorStack.back(); - } - - //! Loads a value from the current node - small unsigned overload - template ::value, - sizeof(T) < sizeof(uint64_t), - !std::is_same::value> = traits::sfinae> inline - void loadValue(T & val) - { - search(); - - val = static_cast( itsIteratorStack.back().value().GetUint() ); - ++itsIteratorStack.back(); - } - - //! Loads a value from the current node - bool overload - void loadValue(bool & val) { search(); val = itsIteratorStack.back().value().GetBool(); ++itsIteratorStack.back(); } - //! Loads a value from the current node - int64 overload - void loadValue(int64_t & val) { search(); val = itsIteratorStack.back().value().GetInt64(); ++itsIteratorStack.back(); } - //! Loads a value from the current node - uint64 overload - void loadValue(uint64_t & val) { search(); val = itsIteratorStack.back().value().GetUint64(); ++itsIteratorStack.back(); } - //! Loads a value from the current node - float overload - void loadValue(float & val) { search(); val = static_cast(itsIteratorStack.back().value().GetDouble()); ++itsIteratorStack.back(); } - //! Loads a value from the current node - double overload - void loadValue(double & val) { search(); val = itsIteratorStack.back().value().GetDouble(); ++itsIteratorStack.back(); } - //! Loads a value from the current node - string overload - void loadValue(std::string & val) { search(); val = itsIteratorStack.back().value().GetString(); ++itsIteratorStack.back(); } - //! Loads a nullptr from the current node - void loadValue(std::nullptr_t&) { search(); CEREAL_RAPIDJSON_ASSERT(itsIteratorStack.back().value().IsNull()); ++itsIteratorStack.back(); } - - template inline - typename std::enable_if::value && std::is_same::value, void>::type - loadValue(T & val) { search(); val = itsIteratorStack.back().value().GetInt64(); ++itsIteratorStack.back(); } - template inline - typename std::enable_if::value && std::is_same::value, void>::type - loadValue(T & val) { search(); val = itsIteratorStack.back().value().GetUint64(); ++itsIteratorStack.back(); } - // Special cases to handle various flavors of long, which tend to conflict with - // the int32_t or int64_t on various compiler/OS combinations. MSVC doesn't need any of this. - #ifndef _MSC_VER - private: - //! 32 bit signed long loading from current node - template inline - typename std::enable_if::value, void>::type - loadLong(T & l){ loadValue( reinterpret_cast( l ) ); } - - //! non 32 bit signed long loading from current node - template inline - typename std::enable_if::value, void>::type - loadLong(T & l){ loadValue( reinterpret_cast( l ) ); } - - //! 32 bit unsigned long loading from current node - template inline - typename std::enable_if::value, void>::type - loadLong(T & lu){ loadValue( reinterpret_cast( lu ) ); } - - //! non 32 bit unsigned long loading from current node - template inline - typename std::enable_if::value, void>::type - loadLong(T & lu){ loadValue( reinterpret_cast( lu ) ); } - - public: - //! Serialize a long if it would not be caught otherwise - template inline - typename std::enable_if::value && - sizeof(T) >= sizeof(std::int64_t) && - !std::is_same::value, void>::type - loadValue( T & t ){ loadLong(t); } - - //! Serialize an unsigned long if it would not be caught otherwise - template inline - typename std::enable_if::value && - sizeof(T) >= sizeof(std::uint64_t) && - !std::is_same::value, void>::type - loadValue( T & t ){ loadLong(t); } - #endif // _MSC_VER - - private: - //! Convert a string to a long long - void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); } - //! Convert a string to an unsigned long long - void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); } - //! Convert a string to a long double - void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); } - - public: - //! Loads a value from the current node - long double and long long overloads - template ::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long))> = traits::sfinae> - inline void loadValue(T & val) - { - std::string encoded; - loadValue( encoded ); - stringToNumber( encoded, val ); - } - - //! Loads the size for a SizeTag - void loadSize(size_type & size) - { - if (itsIteratorStack.size() == 1) - size = itsDocument.Size(); - else - size = (itsIteratorStack.rbegin() + 1)->value().Size(); - } - - //! @} - - private: - const char * itsNextName; //!< Next name set by NVP - ReadStream itsReadStream; //!< Rapidjson write stream - std::vector itsIteratorStack; //!< 'Stack' of rapidJSON iterators - CEREAL_RAPIDJSON_NAMESPACE::Document itsDocument; //!< Rapidjson document - }; - - // ###################################################################### - // JSONArchive prologue and epilogue functions - // ###################################################################### - - // ###################################################################### - //! Prologue for NVPs for JSON archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void prologue( JSONOutputArchive &, NameValuePair const & ) - { } - - //! Prologue for NVPs for JSON archives - template inline - void prologue( JSONInputArchive &, NameValuePair const & ) - { } - - // ###################################################################### - //! Epilogue for NVPs for JSON archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void epilogue( JSONOutputArchive &, NameValuePair const & ) - { } - - //! Epilogue for NVPs for JSON archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void epilogue( JSONInputArchive &, NameValuePair const & ) - { } - - // ###################################################################### - //! Prologue for deferred data for JSON archives - /*! Do nothing for the defer wrapper */ - template inline - void prologue( JSONOutputArchive &, DeferredData const & ) - { } - - //! Prologue for deferred data for JSON archives - template inline - void prologue( JSONInputArchive &, DeferredData const & ) - { } - - // ###################################################################### - //! Epilogue for deferred for JSON archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void epilogue( JSONOutputArchive &, DeferredData const & ) - { } - - //! Epilogue for deferred for JSON archives - /*! Do nothing for the defer wrapper */ - template inline - void epilogue( JSONInputArchive &, DeferredData const & ) - { } - - // ###################################################################### - //! Prologue for SizeTags for JSON archives - /*! SizeTags are strictly ignored for JSON, they just indicate - that the current node should be made into an array */ - template inline - void prologue( JSONOutputArchive & ar, SizeTag const & ) - { - ar.makeArray(); - } - - //! Prologue for SizeTags for JSON archives - template inline - void prologue( JSONInputArchive &, SizeTag const & ) - { } - - // ###################################################################### - //! Epilogue for SizeTags for JSON archives - /*! SizeTags are strictly ignored for JSON */ - template inline - void epilogue( JSONOutputArchive &, SizeTag const & ) - { } - - //! Epilogue for SizeTags for JSON archives - template inline - void epilogue( JSONInputArchive &, SizeTag const & ) - { } - - // ###################################################################### - //! Prologue for all other types for JSON archives (except minimal types) - /*! Starts a new node, named either automatically or by some NVP, - that may be given data by the type about to be archived - - Minimal types do not start or finish nodes */ - template ::value, - !traits::has_minimal_base_class_serialization::value, - !traits::has_minimal_output_serialization::value> = traits::sfinae> - inline void prologue( JSONOutputArchive & ar, T const & ) - { - ar.startNode(); - } - - //! Prologue for all other types for JSON archives - template ::value, - !traits::has_minimal_base_class_serialization::value, - !traits::has_minimal_input_serialization::value> = traits::sfinae> - inline void prologue( JSONInputArchive & ar, T const & ) - { - ar.startNode(); - } - - // ###################################################################### - //! Epilogue for all other types other for JSON archives (except minimal types) - /*! Finishes the node created in the prologue - - Minimal types do not start or finish nodes */ - template ::value, - !traits::has_minimal_base_class_serialization::value, - !traits::has_minimal_output_serialization::value> = traits::sfinae> - inline void epilogue( JSONOutputArchive & ar, T const & ) - { - ar.finishNode(); - } - - //! Epilogue for all other types other for JSON archives - template ::value, - !traits::has_minimal_base_class_serialization::value, - !traits::has_minimal_input_serialization::value> = traits::sfinae> - inline void epilogue( JSONInputArchive & ar, T const & ) - { - ar.finishNode(); - } - - // ###################################################################### - //! Prologue for arithmetic types for JSON archives - inline - void prologue( JSONOutputArchive & ar, std::nullptr_t const & ) - { - ar.writeName(); - } - - //! Prologue for arithmetic types for JSON archives - inline - void prologue( JSONInputArchive &, std::nullptr_t const & ) - { } - - // ###################################################################### - //! Epilogue for arithmetic types for JSON archives - inline - void epilogue( JSONOutputArchive &, std::nullptr_t const & ) - { } - - //! Epilogue for arithmetic types for JSON archives - inline - void epilogue( JSONInputArchive &, std::nullptr_t const & ) - { } - - // ###################################################################### - //! Prologue for arithmetic types for JSON archives - template ::value> = traits::sfinae> inline - void prologue( JSONOutputArchive & ar, T const & ) - { - ar.writeName(); - } - - //! Prologue for arithmetic types for JSON archives - template ::value> = traits::sfinae> inline - void prologue( JSONInputArchive &, T const & ) - { } - - // ###################################################################### - //! Epilogue for arithmetic types for JSON archives - template ::value> = traits::sfinae> inline - void epilogue( JSONOutputArchive &, T const & ) - { } - - //! Epilogue for arithmetic types for JSON archives - template ::value> = traits::sfinae> inline - void epilogue( JSONInputArchive &, T const & ) - { } - - // ###################################################################### - //! Prologue for strings for JSON archives - template inline - void prologue(JSONOutputArchive & ar, std::basic_string const &) - { - ar.writeName(); - } - - //! Prologue for strings for JSON archives - template inline - void prologue(JSONInputArchive &, std::basic_string const &) - { } - - // ###################################################################### - //! Epilogue for strings for JSON archives - template inline - void epilogue(JSONOutputArchive &, std::basic_string const &) - { } - - //! Epilogue for strings for JSON archives - template inline - void epilogue(JSONInputArchive &, std::basic_string const &) - { } - - // ###################################################################### - // Common JSONArchive serialization functions - // ###################################################################### - //! Serializing NVP types to JSON - template inline - void CEREAL_SAVE_FUNCTION_NAME( JSONOutputArchive & ar, NameValuePair const & t ) - { - ar.setNextName( t.name ); - ar( t.value ); - } - - template inline - void CEREAL_LOAD_FUNCTION_NAME( JSONInputArchive & ar, NameValuePair & t ) - { - ar.setNextName( t.name ); - ar( t.value ); - } - - //! Saving for nullptr to JSON - inline - void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, std::nullptr_t const & t) - { - ar.saveValue( t ); - } - - //! Loading arithmetic from JSON - inline - void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, std::nullptr_t & t) - { - ar.loadValue( t ); - } - - //! Saving for arithmetic to JSON - template ::value> = traits::sfinae> inline - void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, T const & t) - { - ar.saveValue( t ); - } - - //! Loading arithmetic from JSON - template ::value> = traits::sfinae> inline - void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, T & t) - { - ar.loadValue( t ); - } - - //! saving string to JSON - template inline - void CEREAL_SAVE_FUNCTION_NAME(JSONOutputArchive & ar, std::basic_string const & str) - { - ar.saveValue( str ); - } - - //! loading string from JSON - template inline - void CEREAL_LOAD_FUNCTION_NAME(JSONInputArchive & ar, std::basic_string & str) - { - ar.loadValue( str ); - } - - // ###################################################################### - //! Saving SizeTags to JSON - template inline - void CEREAL_SAVE_FUNCTION_NAME( JSONOutputArchive &, SizeTag const & ) - { - // nothing to do here, we don't explicitly save the size - } - - //! Loading SizeTags from JSON - template inline - void CEREAL_LOAD_FUNCTION_NAME( JSONInputArchive & ar, SizeTag & st ) - { - ar.loadSize( st.size ); - } -} // namespace cereal - -// register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive) -CEREAL_REGISTER_ARCHIVE(cereal::JSONOutputArchive) - -// tie input and output archives together -CEREAL_SETUP_ARCHIVE_TRAITS(cereal::JSONInputArchive, cereal::JSONOutputArchive) - -#endif // CEREAL_ARCHIVES_JSON_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp b/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp deleted file mode 100644 index f794a57f9..000000000 --- a/cpp/src/cylon/thridparty/cereal/archives/portable_binary.hpp +++ /dev/null @@ -1,334 +0,0 @@ -/*! \file binary.hpp - \brief Binary input and output archives */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ -#define CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include -#include - -namespace cereal -{ - namespace portable_binary_detail - { - //! Returns true if the current machine is little endian - /*! @ingroup Internal */ - inline std::uint8_t is_little_endian() - { - static std::int32_t test = 1; - return *reinterpret_cast( &test ) == 1; - } - - //! Swaps the order of bytes for some chunk of memory - /*! @param data The data as a uint8_t pointer - @tparam DataSize The true size of the data - @ingroup Internal */ - template - inline void swap_bytes( std::uint8_t * data ) - { - for( std::size_t i = 0, end = DataSize / 2; i < end; ++i ) - std::swap( data[i], data[DataSize - i - 1] ); - } - } // end namespace portable_binary_detail - - // ###################################################################### - //! An output archive designed to save data in a compact binary representation portable over different architectures - /*! This archive outputs data to a stream in an extremely compact binary - representation with as little extra metadata as possible. - - This archive will record the endianness of the data as well as the desired in/out endianness - and assuming that the user takes care of ensuring serialized types are the same size - across machines, is portable over different architectures. - - When using a binary archive and a file stream, you must use the - std::ios::binary format flag to avoid having your data altered - inadvertently. - - \warning This archive has not been thoroughly tested across different architectures. - Please report any issues, optimizations, or feature requests at - the project github. - - \ingroup Archives */ - class PortableBinaryOutputArchive : public OutputArchive - { - public: - //! A class containing various advanced options for the PortableBinaryOutput archive - class Options - { - public: - //! Represents desired endianness - enum class Endianness : std::uint8_t - { big, little }; - - //! Default options, preserve system endianness - static Options Default(){ return Options(); } - - //! Save as little endian - static Options LittleEndian(){ return Options( Endianness::little ); } - - //! Save as big endian - static Options BigEndian(){ return Options( Endianness::big ); } - - //! Specify specific options for the PortableBinaryOutputArchive - /*! @param outputEndian The desired endianness of saved (output) data */ - explicit Options( Endianness outputEndian = getEndianness() ) : - itsOutputEndianness( outputEndian ) { } - - private: - //! Gets the endianness of the system - inline static Endianness getEndianness() - { return portable_binary_detail::is_little_endian() ? Endianness::little : Endianness::big; } - - //! Checks if Options is set for little endian - inline std::uint8_t is_little_endian() const - { return itsOutputEndianness == Endianness::little; } - - friend class PortableBinaryOutputArchive; - Endianness itsOutputEndianness; - }; - - //! Construct, outputting to the provided stream - /*! @param stream The stream to output to. Should be opened with std::ios::binary flag. - @param options The PortableBinary specific options to use. See the Options struct - for the values of default parameters */ - PortableBinaryOutputArchive(std::ostream & stream, Options const & options = Options::Default()) : - OutputArchive(this), - itsStream(stream), - itsConvertEndianness( portable_binary_detail::is_little_endian() ^ options.is_little_endian() ) - { - this->operator()( options.is_little_endian() ); - } - - ~PortableBinaryOutputArchive() CEREAL_NOEXCEPT = default; - - //! Writes size bytes of data to the output stream - template inline - void saveBinary( const void * data, std::streamsize size ) - { - std::streamsize writtenSize = 0; - - if( itsConvertEndianness ) - { - for( std::streamsize i = 0; i < size; i += DataSize ) - for( std::streamsize j = 0; j < DataSize; ++j ) - writtenSize += itsStream.rdbuf()->sputn( reinterpret_cast( data ) + DataSize - j - 1 + i, 1 ); - } - else - writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); - - if(writtenSize != size) - throw Exception("Failed to write " + std::to_string(size) + " bytes to output stream! Wrote " + std::to_string(writtenSize)); - } - - private: - std::ostream & itsStream; - const uint8_t itsConvertEndianness; //!< If set to true, we will need to swap bytes upon saving - }; - - // ###################################################################### - //! An input archive designed to load data saved using PortableBinaryOutputArchive - /*! This archive outputs data to a stream in an extremely compact binary - representation with as little extra metadata as possible. - - This archive will load the endianness of the serialized data and - if necessary transform it to match that of the local machine. This comes - at a significant performance cost compared to non portable archives if - the transformation is necessary, and also causes a small performance hit - even if it is not necessary. - - It is recommended to use portable archives only if you know that you will - be sending binary data to machines with different endianness. - - The archive will do nothing to ensure types are the same size - that is - the responsibility of the user. - - When using a binary archive and a file stream, you must use the - std::ios::binary format flag to avoid having your data altered - inadvertently. - - \warning This archive has not been thoroughly tested across different architectures. - Please report any issues, optimizations, or feature requests at - the project github. - - \ingroup Archives */ - class PortableBinaryInputArchive : public InputArchive - { - public: - //! A class containing various advanced options for the PortableBinaryInput archive - class Options - { - public: - //! Represents desired endianness - enum class Endianness : std::uint8_t - { big, little }; - - //! Default options, preserve system endianness - static Options Default(){ return Options(); } - - //! Load into little endian - static Options LittleEndian(){ return Options( Endianness::little ); } - - //! Load into big endian - static Options BigEndian(){ return Options( Endianness::big ); } - - //! Specify specific options for the PortableBinaryInputArchive - /*! @param inputEndian The desired endianness of loaded (input) data */ - explicit Options( Endianness inputEndian = getEndianness() ) : - itsInputEndianness( inputEndian ) { } - - private: - //! Gets the endianness of the system - inline static Endianness getEndianness() - { return portable_binary_detail::is_little_endian() ? Endianness::little : Endianness::big; } - - //! Checks if Options is set for little endian - inline std::uint8_t is_little_endian() const - { return itsInputEndianness == Endianness::little; } - - friend class PortableBinaryInputArchive; - Endianness itsInputEndianness; - }; - - //! Construct, loading from the provided stream - /*! @param stream The stream to read from. Should be opened with std::ios::binary flag. - @param options The PortableBinary specific options to use. See the Options struct - for the values of default parameters */ - PortableBinaryInputArchive(std::istream & stream, Options const & options = Options::Default()) : - InputArchive(this), - itsStream(stream), - itsConvertEndianness( false ) - { - uint8_t streamLittleEndian; - this->operator()( streamLittleEndian ); - itsConvertEndianness = options.is_little_endian() ^ streamLittleEndian; - } - - ~PortableBinaryInputArchive() CEREAL_NOEXCEPT = default; - - //! Reads size bytes of data from the input stream - /*! @param data The data to save - @param size The number of bytes in the data - @tparam DataSize T The size of the actual type of the data elements being loaded */ - template inline - void loadBinary( void * const data, std::streamsize size ) - { - // load data - auto const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); - - if(readSize != size) - throw Exception("Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize)); - - // flip bits if needed - if( itsConvertEndianness ) - { - std::uint8_t * ptr = reinterpret_cast( data ); - for( std::streamsize i = 0; i < size; i += DataSize ) - portable_binary_detail::swap_bytes( ptr + i ); - } - } - - private: - std::istream & itsStream; - uint8_t itsConvertEndianness; //!< If set to true, we will need to swap bytes upon loading - }; - - // ###################################################################### - // Common BinaryArchive serialization functions - - //! Saving for POD types to portable binary - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME(PortableBinaryOutputArchive & ar, T const & t) - { - static_assert( !std::is_floating_point::value || - (std::is_floating_point::value && std::numeric_limits::is_iec559), - "Portable binary only supports IEEE 754 standardized floating point" ); - ar.template saveBinary(std::addressof(t), sizeof(t)); - } - - //! Loading for POD types from portable binary - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME(PortableBinaryInputArchive & ar, T & t) - { - static_assert( !std::is_floating_point::value || - (std::is_floating_point::value && std::numeric_limits::is_iec559), - "Portable binary only supports IEEE 754 standardized floating point" ); - ar.template loadBinary(std::addressof(t), sizeof(t)); - } - - //! Serializing NVP types to portable binary - template inline - CEREAL_ARCHIVE_RESTRICT(PortableBinaryInputArchive, PortableBinaryOutputArchive) - CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, NameValuePair & t ) - { - ar( t.value ); - } - - //! Serializing SizeTags to portable binary - template inline - CEREAL_ARCHIVE_RESTRICT(PortableBinaryInputArchive, PortableBinaryOutputArchive) - CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, SizeTag & t ) - { - ar( t.size ); - } - - //! Saving binary data to portable binary - template inline - void CEREAL_SAVE_FUNCTION_NAME(PortableBinaryOutputArchive & ar, BinaryData const & bd) - { - typedef typename std::remove_pointer::type TT; - static_assert( !std::is_floating_point::value || - (std::is_floating_point::value && std::numeric_limits::is_iec559), - "Portable binary only supports IEEE 754 standardized floating point" ); - - ar.template saveBinary( bd.data, static_cast( bd.size ) ); - } - - //! Loading binary data from portable binary - template inline - void CEREAL_LOAD_FUNCTION_NAME(PortableBinaryInputArchive & ar, BinaryData & bd) - { - typedef typename std::remove_pointer::type TT; - static_assert( !std::is_floating_point::value || - (std::is_floating_point::value && std::numeric_limits::is_iec559), - "Portable binary only supports IEEE 754 standardized floating point" ); - - ar.template loadBinary( bd.data, static_cast( bd.size ) ); - } -} // namespace cereal - -// register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryOutputArchive) -CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryInputArchive) - -// tie input and output archives together -CEREAL_SETUP_ARCHIVE_TRAITS(cereal::PortableBinaryInputArchive, cereal::PortableBinaryOutputArchive) - -#endif // CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/archives/xml.hpp b/cpp/src/cylon/thridparty/cereal/archives/xml.hpp deleted file mode 100644 index cfdada27d..000000000 --- a/cpp/src/cylon/thridparty/cereal/archives/xml.hpp +++ /dev/null @@ -1,956 +0,0 @@ -/*! \file xml.hpp - \brief XML input and output archives */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_ARCHIVES_XML_HPP_ -#define CEREAL_ARCHIVES_XML_HPP_ -#include "cylon/thridparty/cereal/cereal.hpp" -#include "cylon/thridparty/cereal/details/util.hpp" - -#include "cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp" -#include "cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp" -#include "cylon/thridparty/cereal/external/base64.hpp" - -#include -#include -#include -#include -#include -#include -#include - -namespace cereal -{ - namespace xml_detail - { - #ifndef CEREAL_XML_STRING_VALUE - //! The default name for the root node in a cereal xml archive. - /*! You can define CEREAL_XML_STRING_VALUE to be different assuming you do so - before this file is included. */ - #define CEREAL_XML_STRING_VALUE "cereal" - #endif // CEREAL_XML_STRING_VALUE - - //! The name given to the root node in a cereal xml archive - static const char * CEREAL_XML_STRING = CEREAL_XML_STRING_VALUE; - - //! Returns true if the character is whitespace - inline bool isWhitespace( char c ) - { - return c == ' ' || c == '\t' || c == '\n' || c == '\r'; - } - } - - // ###################################################################### - //! An output archive designed to save data to XML - /*! This archive uses RapidXML to build an in memory XML tree of the - data it serializes before outputting it to its stream upon destruction. - This archive should be used in an RAII fashion, letting - the automatic destruction of the object cause the flush to its stream. - - XML archives provides a human readable output but at decreased - performance (both in time and space) compared to binary archives. - - XML benefits greatly from name-value pairs, which if present, will - name the nodes in the output. If these are not present, each level - of the output tree will be given an automatically generated delimited name. - - The precision of the output archive controls the number of decimals output - for floating point numbers and should be sufficiently large (i.e. at least 20) - if there is a desire to have binary equality between the numbers output and - those read in. In general you should expect a loss of precision when going - from floating point to text and back. - - XML archives can optionally print the type of everything they serialize, which - adds an attribute to each node. - - XML archives do not output the size information for any dynamically sized structure - and instead infer it from the number of children for a node. This means that data - can be hand edited for dynamic sized structures and will still be readable. This - is accomplished through the cereal::SizeTag object, which will also add an attribute - to its parent field. - \ingroup Archives */ - class XMLOutputArchive : public OutputArchive, public traits::TextArchive - { - public: - /*! @name Common Functionality - Common use cases for directly interacting with an XMLOutputArchive */ - //! @{ - - //! A class containing various advanced options for the XML archive - /*! Options can either be directly passed to the constructor, or chained using the - modifier functions for an interface analogous to named parameters */ - class Options - { - public: - //! Default options - static Options Default(){ return Options(); } - - //! Specify specific options for the XMLOutputArchive - /*! @param precision_ The precision used for floating point numbers - @param indent_ Whether to indent each line of XML - @param outputType_ Whether to output the type of each serialized object as an attribute - @param sizeAttributes_ Whether dynamically sized containers output the size=dynamic attribute */ - explicit Options( int precision_ = std::numeric_limits::max_digits10, - bool indent_ = true, - bool outputType_ = false, - bool sizeAttributes_ = true ) : - itsPrecision( precision_ ), - itsIndent( indent_ ), - itsOutputType( outputType_ ), - itsSizeAttributes( sizeAttributes_ ) - { } - - /*! @name Option Modifiers - An interface for setting option settings analogous to named parameters. - - @code{cpp} - cereal::XMLOutputArchive ar( myStream, - cereal::XMLOutputArchive::Options() - .indent(true) - .sizeAttributes(false) ); - @endcode - */ - //! @{ - - //! Sets the precision used for floating point numbers - Options & precision( int value ){ itsPrecision = value; return * this; } - //! Whether to indent each line of XML - Options & indent( bool enable ){ itsIndent = enable; return *this; } - //! Whether to output the type of each serialized object as an attribute - Options & outputType( bool enable ){ itsOutputType = enable; return *this; } - //! Whether dynamically sized containers (e.g. vector) output the size=dynamic attribute - Options & sizeAttributes( bool enable ){ itsSizeAttributes = enable; return *this; } - - //! @} - - private: - friend class XMLOutputArchive; - int itsPrecision; - bool itsIndent; - bool itsOutputType; - bool itsSizeAttributes; - }; - - //! Construct, outputting to the provided stream upon destruction - /*! @param stream The stream to output to. Note that XML is only guaranteed to flush - its output to the stream upon destruction. - @param options The XML specific options to use. See the Options struct - for the values of default parameters */ - XMLOutputArchive( std::ostream & stream, Options const & options = Options::Default() ) : - OutputArchive(this), - itsStream(stream), - itsOutputType( options.itsOutputType ), - itsIndent( options.itsIndent ), - itsSizeAttributes(options.itsSizeAttributes) - { - // rapidxml will delete all allocations when xml_document is cleared - auto node = itsXML.allocate_node( rapidxml::node_declaration ); - node->append_attribute( itsXML.allocate_attribute( "version", "1.0" ) ); - node->append_attribute( itsXML.allocate_attribute( "encoding", "utf-8" ) ); - itsXML.append_node( node ); - - // allocate root node - auto root = itsXML.allocate_node( rapidxml::node_element, xml_detail::CEREAL_XML_STRING ); - itsXML.append_node( root ); - itsNodes.emplace( root ); - - // set attributes on the streams - itsStream << std::boolalpha; - itsStream.precision( options.itsPrecision ); - itsOS << std::boolalpha; - itsOS.precision( options.itsPrecision ); - } - - //! Destructor, flushes the XML - ~XMLOutputArchive() CEREAL_NOEXCEPT - { - const int flags = itsIndent ? 0x0 : rapidxml::print_no_indenting; - rapidxml::print( itsStream, itsXML, flags ); - itsXML.clear(); - } - - //! Saves some binary data, encoded as a base64 string, with an optional name - /*! This can be called directly by users and it will automatically create a child node for - the current XML node, populate it with a base64 encoded string, and optionally name - it. The node will be finished after it has been populated. */ - void saveBinaryValue( const void * data, size_t size, const char * name = nullptr ) - { - itsNodes.top().name = name; - - startNode(); - - auto base64string = base64::encode( reinterpret_cast( data ), size ); - saveValue( base64string ); - - if( itsOutputType ) - itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "type", "cereal binary data" ) ); - - finishNode(); - } - - //! @} - /*! @name Internal Functionality - Functionality designed for use by those requiring control over the inner mechanisms of - the XMLOutputArchive */ - //! @{ - - //! Creates a new node that is a child of the node at the top of the stack - /*! Nodes will be given a name that has either been pre-set by a name value pair, - or generated based upon a counter unique to the parent node. If you want to - give a node a specific name, use setNextName prior to calling startNode. - - The node will then be pushed onto the node stack. */ - void startNode() - { - // generate a name for this new node - const auto nameString = itsNodes.top().getValueName(); - - // allocate strings for all of the data in the XML object - auto namePtr = itsXML.allocate_string( nameString.data(), nameString.length() + 1 ); - - // insert into the XML - auto node = itsXML.allocate_node( rapidxml::node_element, namePtr, nullptr, nameString.size() ); - itsNodes.top().node->append_node( node ); - itsNodes.emplace( node ); - } - - //! Designates the most recently added node as finished - void finishNode() - { - itsNodes.pop(); - } - - //! Sets the name for the next node created with startNode - void setNextName( const char * name ) - { - itsNodes.top().name = name; - } - - //! Saves some data, encoded as a string, into the current top level node - /*! The data will be be named with the most recent name if one exists, - otherwise it will be given some default delimited value that depends upon - the parent node */ - template inline - void saveValue( T const & value ) - { - itsOS.clear(); itsOS.seekp( 0, std::ios::beg ); - itsOS << value << std::ends; - - auto strValue = itsOS.str(); - - // itsOS.str() may contain data from previous calls after the first '\0' that was just inserted - // and this data is counted in the length call. We make sure to remove that section so that the - // whitespace validation is done properly - strValue.resize(std::strlen(strValue.c_str())); - - // If the first or last character is a whitespace, add xml:space attribute - const auto len = strValue.length(); - if ( len > 0 && ( xml_detail::isWhitespace( strValue[0] ) || xml_detail::isWhitespace( strValue[len - 1] ) ) ) - { - itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "xml:space", "preserve" ) ); - } - - // allocate strings for all of the data in the XML object - auto dataPtr = itsXML.allocate_string(strValue.c_str(), strValue.length() + 1 ); - - // insert into the XML - itsNodes.top().node->append_node( itsXML.allocate_node( rapidxml::node_data, nullptr, dataPtr ) ); - } - - //! Overload for uint8_t prevents them from being serialized as characters - void saveValue( uint8_t const & value ) - { - saveValue( static_cast( value ) ); - } - - //! Overload for int8_t prevents them from being serialized as characters - void saveValue( int8_t const & value ) - { - saveValue( static_cast( value ) ); - } - - //! Causes the type to be appended as an attribute to the most recently made node if output type is set to true - template inline - void insertType() - { - if( !itsOutputType ) - return; - - // generate a name for this new node - const auto nameString = util::demangledName(); - - // allocate strings for all of the data in the XML object - auto namePtr = itsXML.allocate_string( nameString.data(), nameString.length() + 1 ); - - itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "type", namePtr ) ); - } - - //! Appends an attribute to the current top level node - void appendAttribute( const char * name, const char * value ) - { - auto namePtr = itsXML.allocate_string( name ); - auto valuePtr = itsXML.allocate_string( value ); - itsNodes.top().node->append_attribute( itsXML.allocate_attribute( namePtr, valuePtr ) ); - } - - bool hasSizeAttributes() const { return itsSizeAttributes; } - - protected: - //! A struct that contains metadata about a node - struct NodeInfo - { - NodeInfo( rapidxml::xml_node<> * n = nullptr, - const char * nm = nullptr ) : - node( n ), - counter( 0 ), - name( nm ) - { } - - rapidxml::xml_node<> * node; //!< A pointer to this node - size_t counter; //!< The counter for naming child nodes - const char * name; //!< The name for the next child node - - //! Gets the name for the next child node created from this node - /*! The name will be automatically generated using the counter if - a name has not been previously set. If a name has been previously - set, that name will be returned only once */ - std::string getValueName() - { - if( name ) - { - auto n = name; - name = nullptr; - return {n}; - } - else - return "value" + std::to_string( counter++ ) + "\0"; - } - }; // NodeInfo - - //! @} - - private: - std::ostream & itsStream; //!< The output stream - rapidxml::xml_document<> itsXML; //!< The XML document - std::stack itsNodes; //!< A stack of nodes added to the document - std::ostringstream itsOS; //!< Used to format strings internally - bool itsOutputType; //!< Controls whether type information is printed - bool itsIndent; //!< Controls whether indenting is used - bool itsSizeAttributes; //!< Controls whether lists have a size attribute - }; // XMLOutputArchive - - // ###################################################################### - //! An output archive designed to load data from XML - /*! This archive uses RapidXML to build an in memory XML tree of the - data in the stream it is given before loading any types serialized. - - As with the output XML archive, the preferred way to use this archive is in - an RAII fashion, ensuring its destruction after all data has been read. - - Input XML should have been produced by the XMLOutputArchive. Data can - only be added to dynamically sized containers - the input archive will - determine their size by looking at the number of child nodes. Data that - did not originate from an XMLOutputArchive is not officially supported, - but may be possible to use if properly formatted. - - The XMLInputArchive does not require that nodes are loaded in the same - order they were saved by XMLOutputArchive. Using name value pairs (NVPs), - it is possible to load in an out of order fashion or otherwise skip/select - specific nodes to load. - - The default behavior of the input archive is to read sequentially starting - with the first node and exploring its children. When a given NVP does - not match the read in name for a node, the archive will search for that - node at the current level and load it if it exists. After loading an out of - order node, the archive will then proceed back to loading sequentially from - its new position. - - Consider this simple example where loading of some data is skipped: - - @code{cpp} - // imagine the input file has someData(1-9) saved in order at the top level node - ar( someData1, someData2, someData3 ); // XML loads in the order it sees in the file - ar( cereal::make_nvp( "hello", someData6 ) ); // NVP given does not - // match expected NVP name, so we search - // for the given NVP and load that value - ar( someData7, someData8, someData9 ); // with no NVP given, loading resumes at its - // current location, proceeding sequentially - @endcode - - \ingroup Archives */ - class XMLInputArchive : public InputArchive, public traits::TextArchive - { - public: - /*! @name Common Functionality - Common use cases for directly interacting with an XMLInputArchive */ - //! @{ - - //! Construct, reading in from the provided stream - /*! Reads in an entire XML document from some stream and parses it as soon - as serialization starts - - @param stream The stream to read from. Can be a stringstream or a file. */ - XMLInputArchive( std::istream & stream ) : - InputArchive( this ), - itsData( std::istreambuf_iterator( stream ), std::istreambuf_iterator() ) - { - try - { - itsData.push_back('\0'); // rapidxml will do terrible things without the data being null terminated - itsXML.parse( reinterpret_cast( itsData.data() ) ); - } - catch( rapidxml::parse_error const & ) - { - //std::cerr << "-----Original-----" << std::endl; - //stream.seekg(0); - //std::cout << std::string( std::istreambuf_iterator( stream ), std::istreambuf_iterator() ) << std::endl; - - //std::cerr << "-----Error-----" << std::endl; - //std::cerr << e.what() << std::endl; - //std::cerr << e.where() << std::endl; - throw Exception("XML Parsing failed - likely due to invalid characters or invalid naming"); - } - - // Parse the root - auto root = itsXML.first_node( xml_detail::CEREAL_XML_STRING ); - if( root == nullptr ) - throw Exception("Could not detect cereal root node - likely due to empty or invalid input"); - else - itsNodes.emplace( root ); - } - - ~XMLInputArchive() CEREAL_NOEXCEPT = default; - - //! Loads some binary data, encoded as a base64 string, optionally specified by some name - /*! This will automatically start and finish a node to load the data, and can be called directly by - users. - - Note that this follows the same ordering rules specified in the class description in regards - to loading in/out of order */ - void loadBinaryValue( void * data, size_t size, const char * name = nullptr ) - { - setNextName( name ); - startNode(); - - std::string encoded; - loadValue( encoded ); - - auto decoded = base64::decode( encoded ); - - if( size != decoded.size() ) - throw Exception("Decoded binary data size does not match specified size"); - - std::memcpy( data, decoded.data(), decoded.size() ); - - finishNode(); - } - - //! @} - /*! @name Internal Functionality - Functionality designed for use by those requiring control over the inner mechanisms of - the XMLInputArchive */ - //! @{ - - //! Prepares to start reading the next node - /*! This places the next node to be parsed onto the nodes stack. - - By default our strategy is to start with the document root node and then - recursively iterate through all children in the order they show up in the document. - We don't need to know NVPs do to this; we'll just blindly load in the order things appear in. - - We check to see if the specified NVP matches what the next automatically loaded node is. If they - match, we just continue as normal, going in order. If they don't match, we attempt to find a node - named after the NVP that is being loaded. If that NVP does not exist, we throw an exception. */ - void startNode() - { - auto next = itsNodes.top().child; // By default we would move to the next child node - auto const expectedName = itsNodes.top().name; // this is the expected name from the NVP, if provided - - // If we were given an NVP name, look for it in the current level of the document. - // We only need to do this if either we have exhausted the siblings of the current level or - // the NVP name does not match the name of the node we would normally read next - if( expectedName && ( next == nullptr || std::strcmp( next->name(), expectedName ) != 0 ) ) - { - next = itsNodes.top().search( expectedName ); - - if( next == nullptr ) - throw Exception("XML Parsing failed - provided NVP (" + std::string(expectedName) + ") not found"); - } - - itsNodes.emplace( next ); - } - - //! Finishes reading the current node - void finishNode() - { - // remove current - itsNodes.pop(); - - // advance parent - itsNodes.top().advance(); - - // Reset name - itsNodes.top().name = nullptr; - } - - //! Retrieves the current node name - //! will return @c nullptr if the node does not have a name - const char * getNodeName() const - { - return itsNodes.top().getChildName(); - } - - //! Sets the name for the next node created with startNode - void setNextName( const char * name ) - { - itsNodes.top().name = name; - } - - //! Loads a bool from the current top node - template ::value, - std::is_same::value> = traits::sfinae> inline - void loadValue( T & value ) - { - std::istringstream is( itsNodes.top().node->value() ); - is.setf( std::ios::boolalpha ); - is >> value; - } - - //! Loads a char (signed or unsigned) from the current top node - template ::value, - !std::is_same::value, - sizeof(T) == sizeof(char)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = *reinterpret_cast( itsNodes.top().node->value() ); - } - - //! Load an int8_t from the current top node (ensures we parse entire number) - void loadValue( int8_t & value ) - { - int32_t val; loadValue( val ); value = static_cast( val ); - } - - //! Load a uint8_t from the current top node (ensures we parse entire number) - void loadValue( uint8_t & value ) - { - uint32_t val; loadValue( val ); value = static_cast( val ); - } - - //! Loads a type best represented as an unsigned long from the current top node - template ::value, - !std::is_same::value, - !std::is_same::value, - !std::is_same::value, - sizeof(T) < sizeof(long long)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = static_cast( std::stoul( itsNodes.top().node->value() ) ); - } - - //! Loads a type best represented as an unsigned long long from the current top node - template ::value, - !std::is_same::value, - sizeof(T) >= sizeof(long long)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = static_cast( std::stoull( itsNodes.top().node->value() ) ); - } - - //! Loads a type best represented as an int from the current top node - template ::value, - !std::is_same::value, - sizeof(T) <= sizeof(int)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = static_cast( std::stoi( itsNodes.top().node->value() ) ); - } - - //! Loads a type best represented as a long from the current top node - template ::value, - (sizeof(T) > sizeof(int)), - sizeof(T) <= sizeof(long)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = static_cast( std::stol( itsNodes.top().node->value() ) ); - } - - //! Loads a type best represented as a long long from the current top node - template ::value, - (sizeof(T) > sizeof(long)), - sizeof(T) <= sizeof(long long)> = traits::sfinae> inline - void loadValue( T & value ) - { - value = static_cast( std::stoll( itsNodes.top().node->value() ) ); - } - - //! Loads a type best represented as a float from the current top node - void loadValue( float & value ) - { - try - { - value = std::stof( itsNodes.top().node->value() ); - } - catch( std::out_of_range const & ) - { - // special case for denormalized values - std::istringstream is( itsNodes.top().node->value() ); - is >> value; - if( std::fpclassify( value ) != FP_SUBNORMAL ) - throw; - } - } - - //! Loads a type best represented as a double from the current top node - void loadValue( double & value ) - { - try - { - value = std::stod( itsNodes.top().node->value() ); - } - catch( std::out_of_range const & ) - { - // special case for denormalized values - std::istringstream is( itsNodes.top().node->value() ); - is >> value; - if( std::fpclassify( value ) != FP_SUBNORMAL ) - throw; - } - } - - //! Loads a type best represented as a long double from the current top node - void loadValue( long double & value ) - { - try - { - value = std::stold( itsNodes.top().node->value() ); - } - catch( std::out_of_range const & ) - { - // special case for denormalized values - std::istringstream is( itsNodes.top().node->value() ); - is >> value; - if( std::fpclassify( value ) != FP_SUBNORMAL ) - throw; - } - } - - //! Loads a string from the current node from the current top node - template inline - void loadValue( std::basic_string & str ) - { - std::basic_istringstream is( itsNodes.top().node->value() ); - - str.assign( std::istreambuf_iterator( is ), - std::istreambuf_iterator() ); - } - - //! Loads the size of the current top node - template inline - void loadSize( T & value ) - { - value = getNumChildren( itsNodes.top().node ); - } - - protected: - //! Gets the number of children (usually interpreted as size) for the specified node - static size_t getNumChildren( rapidxml::xml_node<> * node ) - { - size_t size = 0; - node = node->first_node(); // get first child - - while( node != nullptr ) - { - ++size; - node = node->next_sibling(); - } - - return size; - } - - //! A struct that contains metadata about a node - /*! Keeps track of some top level node, its number of - remaining children, and the current active child node */ - struct NodeInfo - { - NodeInfo( rapidxml::xml_node<> * n = nullptr ) : - node( n ), - child( n->first_node() ), - size( XMLInputArchive::getNumChildren( n ) ), - name( nullptr ) - { } - - //! Advances to the next sibling node of the child - /*! If this is the last sibling child will be null after calling */ - void advance() - { - if( size > 0 ) - { - --size; - child = child->next_sibling(); - } - } - - //! Searches for a child with the given name in this node - /*! @param searchName The name to search for (must be null terminated) - @return The node if found, nullptr otherwise */ - rapidxml::xml_node<> * search( const char * searchName ) - { - if( searchName ) - { - size_t new_size = XMLInputArchive::getNumChildren( node ); - const size_t name_size = rapidxml::internal::measure( searchName ); - - for( auto new_child = node->first_node(); new_child != nullptr; new_child = new_child->next_sibling() ) - { - if( rapidxml::internal::compare( new_child->name(), new_child->name_size(), searchName, name_size, true ) ) - { - size = new_size; - child = new_child; - - return new_child; - } - --new_size; - } - } - - return nullptr; - } - - //! Returns the actual name of the next child node, if it exists - const char * getChildName() const - { - return child ? child->name() : nullptr; - } - - rapidxml::xml_node<> * node; //!< A pointer to this node - rapidxml::xml_node<> * child; //!< A pointer to its current child - size_t size; //!< The remaining number of children for this node - const char * name; //!< The NVP name for next child node - }; // NodeInfo - - //! @} - - private: - std::vector itsData; //!< The raw data loaded - rapidxml::xml_document<> itsXML; //!< The XML document - std::stack itsNodes; //!< A stack of nodes read from the document - }; - - // ###################################################################### - // XMLArchive prologue and epilogue functions - // ###################################################################### - - // ###################################################################### - //! Prologue for NVPs for XML output archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void prologue( XMLOutputArchive &, NameValuePair const & ) - { } - - //! Prologue for NVPs for XML input archives - template inline - void prologue( XMLInputArchive &, NameValuePair const & ) - { } - - // ###################################################################### - //! Epilogue for NVPs for XML output archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void epilogue( XMLOutputArchive &, NameValuePair const & ) - { } - - //! Epilogue for NVPs for XML input archives - template inline - void epilogue( XMLInputArchive &, NameValuePair const & ) - { } - - // ###################################################################### - //! Prologue for deferred data for XML archives - /*! Do nothing for the defer wrapper */ - template inline - void prologue( XMLOutputArchive &, DeferredData const & ) - { } - - //! Prologue for deferred data for XML archives - template inline - void prologue( XMLInputArchive &, DeferredData const & ) - { } - - // ###################################################################### - //! Epilogue for deferred for XML archives - /*! NVPs do not start or finish nodes - they just set up the names */ - template inline - void epilogue( XMLOutputArchive &, DeferredData const & ) - { } - - //! Epilogue for deferred for XML archives - /*! Do nothing for the defer wrapper */ - template inline - void epilogue( XMLInputArchive &, DeferredData const & ) - { } - - // ###################################################################### - //! Prologue for SizeTags for XML output archives - /*! SizeTags do not start or finish nodes */ - template inline - void prologue( XMLOutputArchive & ar, SizeTag const & ) - { - if (ar.hasSizeAttributes()) - { - ar.appendAttribute("size", "dynamic"); - } - } - - template inline - void prologue( XMLInputArchive &, SizeTag const & ) - { } - - //! Epilogue for SizeTags for XML output archives - /*! SizeTags do not start or finish nodes */ - template inline - void epilogue( XMLOutputArchive &, SizeTag const & ) - { } - - template inline - void epilogue( XMLInputArchive &, SizeTag const & ) - { } - - // ###################################################################### - //! Prologue for all other types for XML output archives (except minimal types) - /*! Starts a new node, named either automatically or by some NVP, - that may be given data by the type about to be archived - - Minimal types do not start or end nodes */ - template ::value || - traits::has_minimal_output_serialization::value> = traits::sfinae> inline - void prologue( XMLOutputArchive & ar, T const & ) - { - ar.startNode(); - ar.insertType(); - } - - //! Prologue for all other types for XML input archives (except minimal types) - template ::value || - traits::has_minimal_input_serialization::value> = traits::sfinae> inline - void prologue( XMLInputArchive & ar, T const & ) - { - ar.startNode(); - } - - // ###################################################################### - //! Epilogue for all other types other for XML output archives (except minimal types) - /*! Finishes the node created in the prologue - - Minimal types do not start or end nodes */ - template ::value || - traits::has_minimal_output_serialization::value> = traits::sfinae> inline - void epilogue( XMLOutputArchive & ar, T const & ) - { - ar.finishNode(); - } - - //! Epilogue for all other types other for XML output archives (except minimal types) - template ::value || - traits::has_minimal_input_serialization::value> = traits::sfinae> inline - void epilogue( XMLInputArchive & ar, T const & ) - { - ar.finishNode(); - } - - // ###################################################################### - // Common XMLArchive serialization functions - // ###################################################################### - - //! Saving NVP types to XML - template inline - void CEREAL_SAVE_FUNCTION_NAME( XMLOutputArchive & ar, NameValuePair const & t ) - { - ar.setNextName( t.name ); - ar( t.value ); - } - - //! Loading NVP types from XML - template inline - void CEREAL_LOAD_FUNCTION_NAME( XMLInputArchive & ar, NameValuePair & t ) - { - ar.setNextName( t.name ); - ar( t.value ); - } - - // ###################################################################### - //! Saving SizeTags to XML - template inline - void CEREAL_SAVE_FUNCTION_NAME( XMLOutputArchive &, SizeTag const & ) - { } - - //! Loading SizeTags from XML - template inline - void CEREAL_LOAD_FUNCTION_NAME( XMLInputArchive & ar, SizeTag & st ) - { - ar.loadSize( st.size ); - } - - // ###################################################################### - //! Saving for POD types to xml - template ::value> = traits::sfinae> inline - void CEREAL_SAVE_FUNCTION_NAME(XMLOutputArchive & ar, T const & t) - { - ar.saveValue( t ); - } - - //! Loading for POD types from xml - template ::value> = traits::sfinae> inline - void CEREAL_LOAD_FUNCTION_NAME(XMLInputArchive & ar, T & t) - { - ar.loadValue( t ); - } - - // ###################################################################### - //! saving string to xml - template inline - void CEREAL_SAVE_FUNCTION_NAME(XMLOutputArchive & ar, std::basic_string const & str) - { - ar.saveValue( str ); - } - - //! loading string from xml - template inline - void CEREAL_LOAD_FUNCTION_NAME(XMLInputArchive & ar, std::basic_string & str) - { - ar.loadValue( str ); - } -} // namespace cereal - -// register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::XMLOutputArchive) -CEREAL_REGISTER_ARCHIVE(cereal::XMLInputArchive) - -// tie input and output archives together -CEREAL_SETUP_ARCHIVE_TRAITS(cereal::XMLInputArchive, cereal::XMLOutputArchive) - -#endif // CEREAL_ARCHIVES_XML_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/cereal.hpp b/cpp/src/cylon/thridparty/cereal/cereal.hpp deleted file mode 100644 index 6a36e357f..000000000 --- a/cpp/src/cylon/thridparty/cereal/cereal.hpp +++ /dev/null @@ -1,1120 +0,0 @@ -/*! \file cereal.hpp - \brief Main cereal functionality */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_CEREAL_HPP_ -#define CEREAL_CEREAL_HPP_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cylon/thridparty/cereal/macros.hpp" -#include "cylon/thridparty/cereal/details/traits.hpp" -#include "cylon/thridparty/cereal/details/helpers.hpp" -#include "cylon/thridparty/cereal/types/base_class.hpp" - -namespace cereal -{ - // ###################################################################### - //! Creates a name value pair - /*! @relates NameValuePair - @ingroup Utility */ - template inline - NameValuePair make_nvp( std::string const & name, T && value ) - { - return {name.c_str(), std::forward(value)}; - } - - //! Creates a name value pair - /*! @relates NameValuePair - @ingroup Utility */ - template inline - NameValuePair make_nvp( const char * name, T && value ) - { - return {name, std::forward(value)}; - } - - //! Creates a name value pair for the variable T with the same name as the variable - /*! @relates NameValuePair - @ingroup Utility */ - #define CEREAL_NVP(T) ::cereal::make_nvp(#T, T) - - // ###################################################################### - //! Convenience function to create binary data for both const and non const pointers - /*! @param data Pointer to beginning of the data - @param size The size in bytes of the data - @relates BinaryData - @ingroup Utility */ - template inline - BinaryData binary_data( T && data, size_t size ) - { - return {std::forward(data), size}; - } - - // ###################################################################### - //! Creates a size tag from some variable. - /*! Will normally be used to serialize size (e.g. size()) information for - variable size containers. If you have a variable sized container, - the very first thing it serializes should be its size, wrapped in - a SizeTag. - - @relates SizeTag - @ingroup Utility */ - template inline - SizeTag make_size_tag( T && sz ) - { - return {std::forward(sz)}; - } - - // ###################################################################### - //! Marks data for deferred serialization - /*! cereal performs a recursive depth-first traversal of data it serializes. When - serializing smart pointers to large, nested, or cyclical data structures, it - is possible to encounter a stack overflow from excessive recursion when following - a chain of pointers. - - Deferment can help in these situations if the data can be serialized separately from - the pointers used to traverse the structure. For example, a graph structure can have its - nodes serialized before its edges: - - @code{.cpp} - struct MyEdge - { - std::shared_ptr connection; - int some_value; - - template - void serialize(Archive & archive) - { - // when we serialize an edge, we'll defer serializing the associated node - archive( cereal::defer( connection ), - some_value ); - } - }; - - struct MyGraphStructure - { - std::vector edges; - std::vector nodes; - - template - void serialize(Archive & archive) - { - // because of the deferment, we ensure all nodes are fully serialized - // before any connection pointers to those nodes are serialized - archive( edges, nodes ); - - // we have to explicitly inform the archive when it is safe to serialize - // the deferred data - archive.serializeDeferments(); - } - }; - @endcode - - @relates DeferredData - @ingroup Utility */ - template inline - DeferredData defer( T && value ) - { - return {std::forward(value)}; - } - - // ###################################################################### - //! Called before a type is serialized to set up any special archive state - //! for processing some type - /*! If designing a serializer that needs to set up any kind of special - state or output extra information for a type, specialize this function - for the archive type and the types that require the extra information. - @ingroup Internal */ - template inline - void prologue( Archive & /* archive */, T const & /* data */) - { } - - //! Called after a type is serialized to tear down any special archive state - //! for processing some type - /*! @ingroup Internal */ - template inline - void epilogue( Archive & /* archive */, T const & /* data */) - { } - - // ###################################################################### - //! Special flags for archives - /*! AllowEmptyClassElision - This allows for empty classes to be serialized even if they do not provide - a serialization function. Classes with no data members are considered to be - empty. Be warned that if this is enabled and you attempt to serialize an - empty class with improperly formed serialize or load/save functions, no - static error will occur - the error will propagate silently and your - intended serialization functions may not be called. You can manually - ensure that your classes that have custom serialization are correct - by using the traits is_output_serializable and is_input_serializable - in cereal/details/traits.hpp. - @ingroup Internal */ - enum Flags { AllowEmptyClassElision = 1 }; - - // ###################################################################### - //! Registers a specific Archive type with cereal - /*! This registration should be done once per archive. A good place to - put this is immediately following the definition of your archive. - Archive registration is only strictly necessary if you wish to - support pointers to polymorphic data types. All archives that - come with cereal are already registered. - @ingroup Internal */ - #define CEREAL_REGISTER_ARCHIVE(Archive) \ - namespace cereal { namespace detail { \ - template \ - typename polymorphic_serialization_support::type \ - instantiate_polymorphic_binding( T*, Archive*, BindingTag, adl_tag ); \ - } } /* end namespaces */ - - //! Helper macro to omit unused warning - #if defined(__GNUC__) - // GCC / clang don't want the function - #define CEREAL_UNUSED_FUNCTION - #else - #define CEREAL_UNUSED_FUNCTION static void unused() { (void)version; } - #endif - - // ###################################################################### - //! Defines a class version for some type - /*! Versioning information is optional and adds some small amount of - overhead to serialization. This overhead will occur both in terms of - space in the archive (the version information for each class will be - stored exactly once) as well as runtime (versioned serialization functions - must check to see if they need to load or store version information). - - Versioning is useful if you plan on fundamentally changing the way some - type is serialized in the future. Versioned serialization functions - cannot be used to load non-versioned data. - - By default, all types have an assumed version value of zero. By - using this macro, you may change the version number associated with - some type. cereal will then use this value as a second parameter - to your serialization functions. - - The interface for the serialization functions is nearly identical - to non-versioned serialization with the addition of a second parameter, - const std::uint32_t version, which will be supplied with the correct - version number. Serializing the version number on a save happens - automatically. - - Versioning cannot be mixed with non-versioned serialization functions. - Having both types will result result in a compile time error. Data - serialized without versioning cannot be loaded by a serialization - function with added versioning support. - - Example interface for versioning on a non-member serialize function: - - @code{cpp} - CEREAL_CLASS_VERSION( Mytype, 77 ); // register class version - - template - void serialize( Archive & ar, Mytype & t, const std::uint32_t version ) - { - // When performing a load, the version associated with the class - // is whatever it was when that data was originally serialized - // - // When we save, we'll use the version that is defined in the macro - - if( version >= some_number ) - // do this - else - // do that - } - @endcode - - Interfaces for other forms of serialization functions is similar. This - macro should be placed at global scope. - @ingroup Utility */ - - //! On C++17, define the StaticObject as inline to merge the definitions across TUs - //! This prevents multiple definition errors when this macro appears in a header file - //! included in multiple TUs. - #ifdef CEREAL_HAS_CPP17 - #define CEREAL_CLASS_VERSION(TYPE, VERSION_NUMBER) \ - namespace cereal { namespace detail { \ - template <> struct Version \ - { \ - static std::uint32_t registerVersion() \ - { \ - ::cereal::detail::StaticObject::getInstance().mapping.emplace( \ - std::type_index(typeid(TYPE)).hash_code(), VERSION_NUMBER ); \ - return VERSION_NUMBER; \ - } \ - static inline const std::uint32_t version = registerVersion(); \ - CEREAL_UNUSED_FUNCTION \ - }; /* end Version */ \ - } } // end namespaces - #else - #define CEREAL_CLASS_VERSION(TYPE, VERSION_NUMBER) \ - namespace cereal { namespace detail { \ - template <> struct Version \ - { \ - static const std::uint32_t version; \ - static std::uint32_t registerVersion() \ - { \ - ::cereal::detail::StaticObject::getInstance().mapping.emplace( \ - std::type_index(typeid(TYPE)).hash_code(), VERSION_NUMBER ); \ - return VERSION_NUMBER; \ - } \ - CEREAL_UNUSED_FUNCTION \ - }; /* end Version */ \ - const std::uint32_t Version::version = \ - Version::registerVersion(); \ - } } // end namespaces - - #endif - - // ###################################################################### - //! The base output archive class - /*! This is the base output archive for all output archives. If you create - a custom archive class, it should derive from this, passing itself as - a template parameter for the ArchiveType. - - The base class provides all of the functionality necessary to - properly forward data to the correct serialization functions. - - Individual archives should use a combination of prologue and - epilogue functions together with specializations of serialize, save, - and load to alter the functionality of their serialization. - - @tparam ArchiveType The archive type that derives from OutputArchive - @tparam Flags Flags to control advanced functionality. See the Flags - enum for more information. - @ingroup Internal */ - template - class OutputArchive : public detail::OutputArchiveBase - { - public: - //! Construct the output archive - /*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */ - OutputArchive(ArchiveType * const derived) : self(derived), itsCurrentPointerId(1), itsCurrentPolymorphicTypeId(1) - { } - - OutputArchive & operator=( OutputArchive const & ) = delete; - - //! Serializes all passed in data - /*! This is the primary interface for serializing data with an archive */ - template inline - ArchiveType & operator()( Types && ... args ) - { - self->process( std::forward( args )... ); - return *self; - } - - //! Serializes any data marked for deferment using defer - /*! This will cause any data wrapped in DeferredData to be immediately serialized */ - void serializeDeferments() - { - for( auto & deferment : itsDeferments ) - deferment(); - } - - /*! @name Boost Transition Layer - Functionality that mirrors the syntax for Boost. This is useful if you are transitioning - a large project from Boost to cereal. The preferred interface for cereal is using operator(). */ - //! @{ - - //! Indicates this archive is not intended for loading - /*! This ensures compatibility with boost archive types. If you are transitioning - from boost, you can check this value within a member or external serialize function - (i.e., Archive::is_loading::value) to disable behavior specific to loading, until - you can transition to split save/load or save_minimal/load_minimal functions */ - using is_loading = std::false_type; - - //! Indicates this archive is intended for saving - /*! This ensures compatibility with boost archive types. If you are transitioning - from boost, you can check this value within a member or external serialize function - (i.e., Archive::is_saving::value) to enable behavior specific to loading, until - you can transition to split save/load or save_minimal/load_minimal functions */ - using is_saving = std::true_type; - - //! Serializes passed in data - /*! This is a boost compatability layer and is not the preferred way of using - cereal. If you are transitioning from boost, use this until you can - transition to the operator() overload */ - template inline - ArchiveType & operator&( T && arg ) - { - self->process( std::forward( arg ) ); - return *self; - } - - //! Serializes passed in data - /*! This is a boost compatability layer and is not the preferred way of using - cereal. If you are transitioning from boost, use this until you can - transition to the operator() overload */ - template inline - ArchiveType & operator<<( T && arg ) - { - self->process( std::forward( arg ) ); - return *self; - } - - //! @} - - //! Registers a shared pointer with the archive - /*! This function is used to track shared pointer targets to prevent - unnecessary saves from taking place if multiple shared pointers - point to the same data. - - @internal - @param sharedPointer The shared pointer itself (the address is taken via get()). - The archive takes a copy to prevent the memory location to be freed - as long as the address is used as id. This is needed to prevent CVE-2020-11105. - @return A key that uniquely identifies the pointer */ - inline std::uint32_t registerSharedPointer(const std::shared_ptr& sharedPointer) - { - void const * addr = sharedPointer.get(); - - // Handle null pointers by just returning 0 - if(addr == 0) return 0; - itsSharedPointerStorage.push_back(sharedPointer); - - auto id = itsSharedPointerMap.find( addr ); - if( id == itsSharedPointerMap.end() ) - { - auto ptrId = itsCurrentPointerId++; - itsSharedPointerMap.insert( {addr, ptrId} ); - return ptrId | detail::msb_32bit; // mask MSB to be 1 - } - else - return id->second; - } - - //! Registers a polymorphic type name with the archive - /*! This function is used to track polymorphic types to prevent - unnecessary saves of identifying strings used by the polymorphic - support functionality. - - @internal - @param name The name to associate with a polymorphic type - @return A key that uniquely identifies the polymorphic type name */ - inline std::uint32_t registerPolymorphicType( char const * name ) - { - auto id = itsPolymorphicTypeMap.find( name ); - if( id == itsPolymorphicTypeMap.end() ) - { - auto polyId = itsCurrentPolymorphicTypeId++; - itsPolymorphicTypeMap.insert( {name, polyId} ); - return polyId | detail::msb_32bit; // mask MSB to be 1 - } - else - return id->second; - } - - private: - //! Serializes data after calling prologue, then calls epilogue - template inline - void process( T && head ) - { - prologue( *self, head ); - self->processImpl( head ); - epilogue( *self, head ); - } - - //! Unwinds to process all data - template inline - void process( T && head, Other && ... tail ) - { - self->process( std::forward( head ) ); - self->process( std::forward( tail )... ); - } - - //! Serialization of a virtual_base_class wrapper - /*! \sa virtual_base_class */ - template inline - ArchiveType & processImpl(virtual_base_class const & b) - { - traits::detail::base_class_id id(b.base_ptr); - if(itsBaseClassSet.count(id) == 0) - { - itsBaseClassSet.insert(id); - self->processImpl( *b.base_ptr ); - } - return *self; - } - - //! Serialization of a base_class wrapper - /*! \sa base_class */ - template inline - ArchiveType & processImpl(base_class const & b) - { - self->processImpl( *b.base_ptr ); - return *self; - } - - std::vector> itsDeferments; - - template inline - ArchiveType & processImpl(DeferredData const & d) - { - std::function deferment( [this, d](){ self->process( d.value ); } ); - itsDeferments.emplace_back( std::move(deferment) ); - - return *self; - } - - //! Helper macro that expands the requirements for activating an overload - /*! Requirements: - Has the requested serialization function - Does not have version and unversioned at the same time - Is output serializable AND - is specialized for this type of function OR - has no specialization at all */ - #define PROCESS_IF(name) \ - traits::EnableIf::value, \ - !traits::has_invalid_output_versioning::value, \ - (traits::is_output_serializable::value && \ - (traits::is_specialized_##name::value || \ - !traits::is_specialized::value))> = traits::sfinae - - //! Member serialization - template inline - ArchiveType & processImpl(T const & t) - { - access::member_serialize(*self, const_cast(t)); - return *self; - } - - //! Non member serialization - template inline - ArchiveType & processImpl(T const & t) - { - CEREAL_SERIALIZE_FUNCTION_NAME(*self, const_cast(t)); - return *self; - } - - //! Member split (save) - template inline - ArchiveType & processImpl(T const & t) - { - access::member_save(*self, t); - return *self; - } - - //! Non member split (save) - template inline - ArchiveType & processImpl(T const & t) - { - CEREAL_SAVE_FUNCTION_NAME(*self, t); - return *self; - } - - //! Member split (save_minimal) - template inline - ArchiveType & processImpl(T const & t) - { - self->process( access::member_save_minimal(*self, t) ); - return *self; - } - - //! Non member split (save_minimal) - template inline - ArchiveType & processImpl(T const & t) - { - self->process( CEREAL_SAVE_MINIMAL_FUNCTION_NAME(*self, t) ); - return *self; - } - - //! Empty class specialization - template ::value, - std::is_empty::value> = traits::sfinae> inline - ArchiveType & processImpl(T const &) - { - return *self; - } - - //! No matching serialization - /*! Invalid if we have invalid output versioning or - we are not output serializable, and either - don't allow empty class ellision or allow it but are not serializing an empty class */ - template ::value || - (!traits::is_output_serializable::value && - (!(Flags & AllowEmptyClassElision) || ((Flags & AllowEmptyClassElision) && !std::is_empty::value)))> = traits::sfinae> inline - ArchiveType & processImpl(T const &) - { - static_assert(traits::detail::count_output_serializers::value != 0, - "cereal could not find any output serialization functions for the provided type and archive combination. \n\n " - "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " - "Serialize functions generally have the following signature: \n\n " - "template \n " - " void serialize(Archive & ar) \n " - " { \n " - " ar( member1, member2, member3 ); \n " - " } \n\n " ); - - static_assert(traits::detail::count_output_serializers::value < 2, - "cereal found more than one compatible output serialization function for the provided type and archive combination. \n\n " - "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " - "Use specialization (see access.hpp) if you need to disambiguate between serialize vs load/save functions. \n " - "Note that serialization functions can be inherited which may lead to the aforementioned ambiguities. \n " - "In addition, you may not mix versioned with non-versioned serialization functions. \n\n "); - - return *self; - } - - //! Registers a class version with the archive and serializes it if necessary - /*! If this is the first time this class has been serialized, we will record its - version number and serialize that. - - @tparam T The type of the class being serialized */ - template inline - std::uint32_t registerClassVersion() - { - static const auto hash = std::type_index(typeid(T)).hash_code(); - const auto insertResult = itsVersionedTypes.insert( hash ); - const auto lock = detail::StaticObject::lock(); - const auto version = - detail::StaticObject::getInstance().find( hash, detail::Version::version ); - - if( insertResult.second ) // insertion took place, serialize the version number - process( make_nvp("cereal_class_version", version) ); - - return version; - } - - //! Member serialization - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - access::member_serialize(*self, const_cast(t), registerClassVersion()); - return *self; - } - - //! Non member serialization - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - CEREAL_SERIALIZE_FUNCTION_NAME(*self, const_cast(t), registerClassVersion()); - return *self; - } - - //! Member split (save) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - access::member_save(*self, t, registerClassVersion()); - return *self; - } - - //! Non member split (save) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - CEREAL_SAVE_FUNCTION_NAME(*self, t, registerClassVersion()); - return *self; - } - - //! Member split (save_minimal) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - self->process( access::member_save_minimal(*self, t, registerClassVersion()) ); - return *self; - } - - //! Non member split (save_minimal) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T const & t) - { - self->process( CEREAL_SAVE_MINIMAL_FUNCTION_NAME(*self, t, registerClassVersion()) ); - return *self; - } - - #undef PROCESS_IF - - private: - ArchiveType * const self; - - //! A set of all base classes that have been serialized - std::unordered_set itsBaseClassSet; - - //! Maps from addresses to pointer ids - std::unordered_map itsSharedPointerMap; - - //! Copy of shared pointers used in #itsSharedPointerMap to make sure they are kept alive - // during lifetime of itsSharedPointerMap to prevent CVE-2020-11105. - std::vector> itsSharedPointerStorage; - - //! The id to be given to the next pointer - std::uint32_t itsCurrentPointerId; - - //! Maps from polymorphic type name strings to ids - std::unordered_map itsPolymorphicTypeMap; - - //! The id to be given to the next polymorphic type name - std::uint32_t itsCurrentPolymorphicTypeId; - - //! Keeps track of classes that have versioning information associated with them - std::unordered_set itsVersionedTypes; - }; // class OutputArchive - - // ###################################################################### - //! The base input archive class - /*! This is the base input archive for all input archives. If you create - a custom archive class, it should derive from this, passing itself as - a template parameter for the ArchiveType. - - The base class provides all of the functionality necessary to - properly forward data to the correct serialization functions. - - Individual archives should use a combination of prologue and - epilogue functions together with specializations of serialize, save, - and load to alter the functionality of their serialization. - - @tparam ArchiveType The archive type that derives from InputArchive - @tparam Flags Flags to control advanced functionality. See the Flags - enum for more information. - @ingroup Internal */ - template - class InputArchive : public detail::InputArchiveBase - { - public: - //! Construct the output archive - /*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */ - InputArchive(ArchiveType * const derived) : - self(derived), - itsBaseClassSet(), - itsSharedPointerMap(), - itsPolymorphicTypeMap(), - itsVersionedTypes() - { } - - InputArchive & operator=( InputArchive const & ) = delete; - - //! Serializes all passed in data - /*! This is the primary interface for serializing data with an archive */ - template inline - ArchiveType & operator()( Types && ... args ) - { - process( std::forward( args )... ); - return *self; - } - - //! Serializes any data marked for deferment using defer - /*! This will cause any data wrapped in DeferredData to be immediately serialized */ - void serializeDeferments() - { - for( auto & deferment : itsDeferments ) - deferment(); - } - - /*! @name Boost Transition Layer - Functionality that mirrors the syntax for Boost. This is useful if you are transitioning - a large project from Boost to cereal. The preferred interface for cereal is using operator(). */ - //! @{ - - //! Indicates this archive is intended for loading - /*! This ensures compatibility with boost archive types. If you are transitioning - from boost, you can check this value within a member or external serialize function - (i.e., Archive::is_loading::value) to enable behavior specific to loading, until - you can transition to split save/load or save_minimal/load_minimal functions */ - using is_loading = std::true_type; - - //! Indicates this archive is not intended for saving - /*! This ensures compatibility with boost archive types. If you are transitioning - from boost, you can check this value within a member or external serialize function - (i.e., Archive::is_saving::value) to disable behavior specific to loading, until - you can transition to split save/load or save_minimal/load_minimal functions */ - using is_saving = std::false_type; - - //! Serializes passed in data - /*! This is a boost compatability layer and is not the preferred way of using - cereal. If you are transitioning from boost, use this until you can - transition to the operator() overload */ - template inline - ArchiveType & operator&( T && arg ) - { - self->process( std::forward( arg ) ); - return *self; - } - - //! Serializes passed in data - /*! This is a boost compatability layer and is not the preferred way of using - cereal. If you are transitioning from boost, use this until you can - transition to the operator() overload */ - template inline - ArchiveType & operator>>( T && arg ) - { - self->process( std::forward( arg ) ); - return *self; - } - - //! @} - - //! Retrieves a shared pointer given a unique key for it - /*! This is used to retrieve a previously registered shared_ptr - which has already been loaded. - - @internal - @param id The unique id that was serialized for the pointer - @return A shared pointer to the data - @throw Exception if the id does not exist */ - inline std::shared_ptr getSharedPointer(std::uint32_t const id) - { - if(id == 0) return std::shared_ptr(nullptr); - - auto iter = itsSharedPointerMap.find( id ); - if(iter == itsSharedPointerMap.end()) - throw Exception("Error while trying to deserialize a smart pointer. Could not find id " + std::to_string(id)); - - return iter->second; - } - - //! Registers a shared pointer to its unique identifier - /*! After a shared pointer has been allocated for the first time, it should - be registered with its loaded id for future references to it. - - @internal - @param id The unique identifier for the shared pointer - @param ptr The actual shared pointer */ - inline void registerSharedPointer(std::uint32_t const id, std::shared_ptr ptr) - { - std::uint32_t const stripped_id = id & ~detail::msb_32bit; - itsSharedPointerMap[stripped_id] = ptr; - } - - //! Retrieves the string for a polymorphic type given a unique key for it - /*! This is used to retrieve a string previously registered during - a polymorphic load. - - @internal - @param id The unique id that was serialized for the polymorphic type - @return The string identifier for the type */ - inline std::string getPolymorphicName(std::uint32_t const id) - { - auto name = itsPolymorphicTypeMap.find( id ); - if(name == itsPolymorphicTypeMap.end()) - { - throw Exception("Error while trying to deserialize a polymorphic pointer. Could not find type id " + std::to_string(id)); - } - return name->second; - } - - //! Registers a polymorphic name string to its unique identifier - /*! After a polymorphic type has been loaded for the first time, it should - be registered with its loaded id for future references to it. - - @internal - @param id The unique identifier for the polymorphic type - @param name The name associated with the type */ - inline void registerPolymorphicName(std::uint32_t const id, std::string const & name) - { - std::uint32_t const stripped_id = id & ~detail::msb_32bit; - itsPolymorphicTypeMap.insert( {stripped_id, name} ); - } - - private: - //! Serializes data after calling prologue, then calls epilogue - template inline - void process( T && head ) - { - prologue( *self, head ); - self->processImpl( head ); - epilogue( *self, head ); - } - - //! Unwinds to process all data - template inline - void process( T && head, Other && ... tail ) - { - process( std::forward( head ) ); - process( std::forward( tail )... ); - } - - //! Serialization of a virtual_base_class wrapper - /*! \sa virtual_base_class */ - template inline - ArchiveType & processImpl(virtual_base_class & b) - { - traits::detail::base_class_id id(b.base_ptr); - if(itsBaseClassSet.count(id) == 0) - { - itsBaseClassSet.insert(id); - self->processImpl( *b.base_ptr ); - } - return *self; - } - - //! Serialization of a base_class wrapper - /*! \sa base_class */ - template inline - ArchiveType & processImpl(base_class & b) - { - self->processImpl( *b.base_ptr ); - return *self; - } - - std::vector> itsDeferments; - - template inline - ArchiveType & processImpl(DeferredData const & d) - { - std::function deferment( [this, d](){ self->process( d.value ); } ); - itsDeferments.emplace_back( std::move(deferment) ); - - return *self; - } - - //! Helper macro that expands the requirements for activating an overload - /*! Requirements: - Has the requested serialization function - Does not have version and unversioned at the same time - Is input serializable AND - is specialized for this type of function OR - has no specialization at all */ - #define PROCESS_IF(name) \ - traits::EnableIf::value, \ - !traits::has_invalid_input_versioning::value, \ - (traits::is_input_serializable::value && \ - (traits::is_specialized_##name::value || \ - !traits::is_specialized::value))> = traits::sfinae - - //! Member serialization - template inline - ArchiveType & processImpl(T & t) - { - access::member_serialize(*self, t); - return *self; - } - - //! Non member serialization - template inline - ArchiveType & processImpl(T & t) - { - CEREAL_SERIALIZE_FUNCTION_NAME(*self, t); - return *self; - } - - //! Member split (load) - template inline - ArchiveType & processImpl(T & t) - { - access::member_load(*self, t); - return *self; - } - - //! Non member split (load) - template inline - ArchiveType & processImpl(T & t) - { - CEREAL_LOAD_FUNCTION_NAME(*self, t); - return *self; - } - - //! Member split (load_minimal) - template inline - ArchiveType & processImpl(T & t) - { - using OutArchiveType = typename traits::detail::get_output_from_input::type; - typename traits::has_member_save_minimal::type value; - self->process( value ); - access::member_load_minimal(*self, t, value); - return *self; - } - - //! Non member split (load_minimal) - template inline - ArchiveType & processImpl(T & t) - { - using OutArchiveType = typename traits::detail::get_output_from_input::type; - typename traits::has_non_member_save_minimal::type value; - self->process( value ); - CEREAL_LOAD_MINIMAL_FUNCTION_NAME(*self, t, value); - return *self; - } - - //! Empty class specialization - template ::value, - std::is_empty::value> = traits::sfinae> inline - ArchiveType & processImpl(T const &) - { - return *self; - } - - //! No matching serialization - /*! Invalid if we have invalid input versioning or - we are not input serializable, and either - don't allow empty class ellision or allow it but are not serializing an empty class */ - template ::value || - (!traits::is_input_serializable::value && - (!(Flags & AllowEmptyClassElision) || ((Flags & AllowEmptyClassElision) && !std::is_empty::value)))> = traits::sfinae> inline - ArchiveType & processImpl(T const &) - { - static_assert(traits::detail::count_input_serializers::value != 0, - "cereal could not find any input serialization functions for the provided type and archive combination. \n\n " - "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " - "Serialize functions generally have the following signature: \n\n " - "template \n " - " void serialize(Archive & ar) \n " - " { \n " - " ar( member1, member2, member3 ); \n " - " } \n\n " ); - - static_assert(traits::detail::count_input_serializers::value < 2, - "cereal found more than one compatible input serialization function for the provided type and archive combination. \n\n " - "Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). \n " - "Use specialization (see access.hpp) if you need to disambiguate between serialize vs load/save functions. \n " - "Note that serialization functions can be inherited which may lead to the aforementioned ambiguities. \n " - "In addition, you may not mix versioned with non-versioned serialization functions. \n\n "); - - return *self; - } - - //! Befriend for versioning in load_and_construct - template friend struct detail::Construct; - - //! Registers a class version with the archive and serializes it if necessary - /*! If this is the first time this class has been serialized, we will record its - version number and serialize that. - - @tparam T The type of the class being serialized */ - template inline - std::uint32_t loadClassVersion() - { - static const auto hash = std::type_index(typeid(T)).hash_code(); - auto lookupResult = itsVersionedTypes.find( hash ); - - if( lookupResult != itsVersionedTypes.end() ) // already exists - return lookupResult->second; - else // need to load - { - std::uint32_t version; - - process( make_nvp("cereal_class_version", version) ); - itsVersionedTypes.emplace_hint( lookupResult, hash, version ); - - return version; - } - } - - //! Member serialization - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - const auto version = loadClassVersion(); - access::member_serialize(*self, t, version); - return *self; - } - - //! Non member serialization - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - const auto version = loadClassVersion(); - CEREAL_SERIALIZE_FUNCTION_NAME(*self, t, version); - return *self; - } - - //! Member split (load) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - const auto version = loadClassVersion(); - access::member_load(*self, t, version); - return *self; - } - - //! Non member split (load) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - const auto version = loadClassVersion(); - CEREAL_LOAD_FUNCTION_NAME(*self, t, version); - return *self; - } - - //! Member split (load_minimal) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - using OutArchiveType = typename traits::detail::get_output_from_input::type; - const auto version = loadClassVersion(); - typename traits::has_member_versioned_save_minimal::type value; - self->process(value); - access::member_load_minimal(*self, t, value, version); - return *self; - } - - //! Non member split (load_minimal) - /*! Versioning implementation */ - template inline - ArchiveType & processImpl(T & t) - { - using OutArchiveType = typename traits::detail::get_output_from_input::type; - const auto version = loadClassVersion(); - typename traits::has_non_member_versioned_save_minimal::type value; - self->process(value); - CEREAL_LOAD_MINIMAL_FUNCTION_NAME(*self, t, value, version); - return *self; - } - - #undef PROCESS_IF - - private: - ArchiveType * const self; - - //! A set of all base classes that have been serialized - std::unordered_set itsBaseClassSet; - - //! Maps from pointer ids to metadata - std::unordered_map> itsSharedPointerMap; - - //! Maps from name ids to names - std::unordered_map itsPolymorphicTypeMap; - - //! Maps from type hash codes to version numbers - std::unordered_map itsVersionedTypes; - }; // class InputArchive -} // namespace cereal - -// This include needs to come after things such as binary_data, make_nvp, etc -#include "cylon/thridparty/cereal/types/common.hpp" - -#endif // CEREAL_CEREAL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/helpers.hpp b/cpp/src/cylon/thridparty/cereal/details/helpers.hpp deleted file mode 100644 index a0514fc41..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/helpers.hpp +++ /dev/null @@ -1,422 +0,0 @@ -/*! \file helpers.hpp - \brief Internal helper functionality - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_DETAILS_HELPERS_HPP_ -#define CEREAL_DETAILS_HELPERS_HPP_ - -#include -#include -#include -#include -#include -#include - -#include "cylon/thridparty/cereal/macros.hpp" -#include "cylon/thridparty/cereal/details/static_object.hpp" - -namespace cereal -{ - // ###################################################################### - //! An exception class thrown when things go wrong at runtime - /*! @ingroup Utility */ - struct Exception : public std::runtime_error - { - explicit Exception( const std::string & what_ ) : std::runtime_error(what_) {} - explicit Exception( const char * what_ ) : std::runtime_error(what_) {} - }; - - // ###################################################################### - //! The size type used by cereal - /*! To ensure compatability between 32, 64, etc bit machines, we need to use - a fixed size type instead of size_t, which may vary from machine to - machine. - - The default value for CEREAL_SIZE_TYPE is specified in cereal/macros.hpp */ - using size_type = CEREAL_SIZE_TYPE; - - // forward decls - class BinaryOutputArchive; - class BinaryInputArchive; - - // ###################################################################### - namespace detail - { - struct NameValuePairCore {}; //!< Traits struct for NVPs - struct DeferredDataCore {}; //!< Traits struct for DeferredData - } - - // ###################################################################### - //! For holding name value pairs - /*! This pairs a name (some string) with some value such that an archive - can potentially take advantage of the pairing. - - In serialization functions, NameValuePairs are usually created like so: - @code{.cpp} - struct MyStruct - { - int a, b, c, d, e; - - template - void serialize(Archive & archive) - { - archive( CEREAL_NVP(a), - CEREAL_NVP(b), - CEREAL_NVP(c), - CEREAL_NVP(d), - CEREAL_NVP(e) ); - } - }; - @endcode - - Alternatively, you can give you data members custom names like so: - @code{.cpp} - struct MyStruct - { - int a, b, my_embarrassing_variable_name, d, e; - - template - void serialize(Archive & archive) - { - archive( CEREAL_NVP(a), - CEREAL_NVP(b), - cereal::make_nvp("var", my_embarrassing_variable_name) ); - CEREAL_NVP(d), - CEREAL_NVP(e) ); - } - }; - @endcode - - There is a slight amount of overhead to creating NameValuePairs, so there - is a third method which will elide the names when they are not used by - the Archive: - - @code{.cpp} - struct MyStruct - { - int a, b; - - template - void serialize(Archive & archive) - { - archive( cereal::make_nvp(a), - cereal::make_nvp(b) ); - } - }; - @endcode - - This third method is generally only used when providing generic type - support. Users writing their own serialize functions will normally - explicitly control whether they want to use NVPs or not. - - @internal */ - template - class NameValuePair : detail::NameValuePairCore - { - private: - // If we get passed an array, keep the type as is, otherwise store - // a reference if we were passed an l value reference, else copy the value - using Type = typename std::conditional::type>::value, - typename std::remove_cv::type, - typename std::conditional::value, - T, - typename std::decay::type>::type>::type; - - // prevent nested nvps - static_assert( !std::is_base_of::value, - "Cannot pair a name to a NameValuePair" ); - - NameValuePair & operator=( NameValuePair const & ) = delete; - - public: - //! Constructs a new NameValuePair - /*! @param n The name of the pair - @param v The value to pair. Ideally this should be an l-value reference so that - the value can be both loaded and saved to. If you pass an r-value reference, - the NameValuePair will store a copy of it instead of a reference. Thus you should - only pass r-values in cases where this makes sense, such as the result of some - size() call. - @internal */ - NameValuePair( char const * n, T && v ) : name(n), value(std::forward(v)) {} - - char const * name; - Type value; - }; - - //! A specialization of make_nvp<> that simply forwards the value for binary archives - /*! @relates NameValuePair - @internal */ - template inline - typename - std::enable_if::value || - std::is_same::value, - T && >::type - make_nvp( const char *, T && value ) - { - return std::forward(value); - } - - //! A specialization of make_nvp<> that actually creates an nvp for non-binary archives - /*! @relates NameValuePair - @internal */ - template inline - typename - std::enable_if::value && - !std::is_same::value, - NameValuePair >::type - make_nvp( const char * name, T && value) - { - return {name, std::forward(value)}; - } - - //! Convenience for creating a templated NVP - /*! For use in internal generic typing functions which have an - Archive type declared - @internal */ - #define CEREAL_NVP_(name, value) ::cereal::make_nvp(name, value) - - // ###################################################################### - //! A wrapper around data that can be serialized in a binary fashion - /*! This class is used to demarcate data that can safely be serialized - as a binary chunk of data. Individual archives can then choose how - best represent this during serialization. - - @internal */ - template - struct BinaryData - { - //! Internally store the pointer as a void *, keeping const if created with - //! a const pointer - using PT = typename std::conditional::type>::type>::value, - const void *, - void *>::type; - - BinaryData( T && d, uint64_t s ) : data(std::forward(d)), size(s) {} - - PT data; //!< pointer to beginning of data - uint64_t size; //!< size in bytes - }; - - // ###################################################################### - //! A wrapper around data that should be serialized after all non-deferred data - /*! This class is used to demarcate data that can only be safely serialized after - any data not wrapped in this class. - - @internal */ - template - class DeferredData : detail::DeferredDataCore - { - private: - // If we get passed an array, keep the type as is, otherwise store - // a reference if we were passed an l value reference, else copy the value - using Type = typename std::conditional::type>::value, - typename std::remove_cv::type, - typename std::conditional::value, - T, - typename std::decay::type>::type>::type; - - // prevent nested nvps - static_assert( !std::is_base_of::value, - "Cannot defer DeferredData" ); - - DeferredData & operator=( DeferredData const & ) = delete; - - public: - //! Constructs a new NameValuePair - /*! @param v The value to defer. Ideally this should be an l-value reference so that - the value can be both loaded and saved to. If you pass an r-value reference, - the DeferredData will store a copy of it instead of a reference. Thus you should - only pass r-values in cases where this makes sense, such as the result of some - size() call. - @internal */ - DeferredData( T && v ) : value(std::forward(v)) {} - - Type value; - }; - - // ###################################################################### - namespace detail - { - // base classes for type checking - /* The rtti virtual function only exists to enable an archive to - be used in a polymorphic fashion, if necessary. See the - archive adapters for an example of this */ - class OutputArchiveBase - { - public: - OutputArchiveBase() = default; - OutputArchiveBase( OutputArchiveBase && ) CEREAL_NOEXCEPT {} - OutputArchiveBase & operator=( OutputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } - virtual ~OutputArchiveBase() CEREAL_NOEXCEPT = default; - - private: - virtual void rtti() {} - }; - - class InputArchiveBase - { - public: - InputArchiveBase() = default; - InputArchiveBase( InputArchiveBase && ) CEREAL_NOEXCEPT {} - InputArchiveBase & operator=( InputArchiveBase && ) CEREAL_NOEXCEPT { return *this; } - virtual ~InputArchiveBase() CEREAL_NOEXCEPT = default; - - private: - virtual void rtti() {} - }; - - // forward decls for polymorphic support - template struct polymorphic_serialization_support; - struct adl_tag; - - // used during saving pointers - static const uint32_t msb_32bit = 0x80000000; - static const int32_t msb2_32bit = 0x40000000; - } - - // ###################################################################### - //! A wrapper around size metadata - /*! This class provides a way for archives to have more flexibility over how - they choose to serialize size metadata for containers. For some archive - types, the size may be implicitly encoded in the output (e.g. JSON) and - not need an explicit entry. Specializing serialize or load/save for - your archive and SizeTags allows you to choose what happens. - - @internal */ - template - class SizeTag - { - private: - // Store a reference if passed an lvalue reference, otherwise - // make a copy of the data - using Type = typename std::conditional::value, - T, - typename std::decay::type>::type; - - SizeTag & operator=( SizeTag const & ) = delete; - - public: - SizeTag( T && sz ) : size(std::forward(sz)) {} - - Type size; - }; - - // ###################################################################### - //! A wrapper around a key and value for serializing data into maps. - /*! This class just provides a grouping of keys and values into a struct for - human readable archives. For example, XML archives will use this wrapper - to write maps like so: - - @code{.xml} - - - MyFirstKey - MyFirstValue - - - MySecondKey - MySecondValue - - - @endcode - - \sa make_map_item - @internal */ - template - struct MapItem - { - using KeyType = typename std::conditional< - std::is_lvalue_reference::value, - Key, - typename std::decay::type>::type; - - using ValueType = typename std::conditional< - std::is_lvalue_reference::value, - Value, - typename std::decay::type>::type; - - //! Construct a MapItem from a key and a value - /*! @internal */ - MapItem( Key && key_, Value && value_ ) : key(std::forward(key_)), value(std::forward(value_)) {} - - MapItem & operator=( MapItem const & ) = delete; - - KeyType key; - ValueType value; - - //! Serialize the MapItem with the NVPs "key" and "value" - template inline - void CEREAL_SERIALIZE_FUNCTION_NAME(Archive & archive) - { - archive( make_nvp("key", key), - make_nvp("value", value) ); - } - }; - - //! Create a MapItem so that human readable archives will group keys and values together - /*! @internal - @relates MapItem */ - template inline - MapItem make_map_item(KeyType && key, ValueType && value) - { - return {std::forward(key), std::forward(value)}; - } - - namespace detail - { - //! Tag for Version, which due to its anonymous namespace, becomes a different - //! type in each translation unit - /*! This allows CEREAL_CLASS_VERSION to be safely called in a header file */ - namespace{ struct version_binding_tag {}; } - - // ###################################################################### - //! Version information class - /*! This is the base case for classes that have not been explicitly - registered */ - template struct Version - { - static const std::uint32_t version = 0; - // we don't need to explicitly register these types since they - // always get a version number of 0 - }; - - //! Holds all registered version information - struct Versions - { - std::unordered_map mapping; - - std::uint32_t find( std::size_t hash, std::uint32_t version ) - { - const auto result = mapping.emplace( hash, version ); - return result.first->second; - } - }; // struct Versions - } // namespace detail -} // namespace cereal - -#endif // CEREAL_DETAILS_HELPERS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp deleted file mode 100644 index 64a58e458..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl.hpp +++ /dev/null @@ -1,825 +0,0 @@ -/*! \file polymorphic_impl.hpp - \brief Internal polymorphism support - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This code is heavily inspired by the boost serialization implementation by the following authors - - (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . - Use, modification and distribution is subject to the Boost Software - License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt) - - See http://www.boost.org for updates, documentation, and revision history. - - (C) Copyright 2006 David Abrahams - http://www.boost.org. - - See /boost/serialization/export.hpp, /boost/archive/detail/register_archive.hpp, - and /boost/serialization/void_cast.hpp for their implementation. Additional details - found in other files split across serialization and archive. -*/ -#ifndef CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ -#define CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ - -#include "cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp" -#include "cylon/thridparty/cereal/details/static_object.hpp" -#include "cylon/thridparty/cereal/types/memory.hpp" -#include "cylon/thridparty/cereal/types/string.hpp" -#include -#include -#include -#include -#include -#include - -//! Helper macro to omit unused warning -#if defined(__GNUC__) - // GCC / clang don't want the function - #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION -#else - #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION static void unused() { (void)b; } -#endif - -//! Binds a polymorphic type to all registered archives -/*! This binds a polymorphic type to all compatible registered archives that - have been registered with CEREAL_REGISTER_ARCHIVE. This must be called - after all archives are registered (usually after the archives themselves - have been included). */ -#ifdef CEREAL_HAS_CPP17 -#define CEREAL_BIND_TO_ARCHIVES(...) \ - namespace cereal { \ - namespace detail { \ - template<> \ - struct init_binding<__VA_ARGS__> { \ - static inline bind_to_archives<__VA_ARGS__> const & b= \ - ::cereal::detail::StaticObject< \ - bind_to_archives<__VA_ARGS__> \ - >::getInstance().bind(); \ - CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION \ - }; \ - }} /* end namespaces */ -#else -#define CEREAL_BIND_TO_ARCHIVES(...) \ - namespace cereal { \ - namespace detail { \ - template<> \ - struct init_binding<__VA_ARGS__> { \ - static bind_to_archives<__VA_ARGS__> const& b; \ - CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION \ - }; \ - bind_to_archives<__VA_ARGS__> const & init_binding<__VA_ARGS__>::b = \ - ::cereal::detail::StaticObject< \ - bind_to_archives<__VA_ARGS__> \ - >::getInstance().bind(); \ - }} /* end namespaces */ -#endif - -namespace cereal -{ - /* Polymorphic casting support */ - namespace detail - { - //! Base type for polymorphic void casting - /*! Contains functions for casting between registered base and derived types. - - This is necessary so that cereal can properly cast between polymorphic types - even though void pointers are used, which normally have no type information. - Runtime type information is used instead to index a compile-time made mapping - that can perform the proper cast. In the case of multiple levels of inheritance, - cereal will attempt to find the shortest path by using registered relationships to - perform the cast. - - This class will be allocated as a StaticObject and only referenced by pointer, - allowing a templated derived version of it to define strongly typed functions - that cast between registered base and derived types. */ - struct PolymorphicCaster - { - PolymorphicCaster() = default; - PolymorphicCaster( const PolymorphicCaster & ) = default; - PolymorphicCaster & operator=( const PolymorphicCaster & ) = default; - PolymorphicCaster( PolymorphicCaster && ) CEREAL_NOEXCEPT {} - PolymorphicCaster & operator=( PolymorphicCaster && ) CEREAL_NOEXCEPT { return *this; } - virtual ~PolymorphicCaster() CEREAL_NOEXCEPT = default; - - //! Downcasts to the proper derived type - virtual void const * downcast( void const * const ptr ) const = 0; - //! Upcast to proper base type - virtual void * upcast( void * const ptr ) const = 0; - //! Upcast to proper base type, shared_ptr version - virtual std::shared_ptr upcast( std::shared_ptr const & ptr ) const = 0; - }; - - //! Holds registered mappings between base and derived types for casting - /*! This will be allocated as a StaticObject and holds a map containing - all registered mappings between base and derived types. */ - struct PolymorphicCasters - { - //! Maps from a derived type index to a set of chainable casters - using DerivedCasterMap = std::unordered_map>; - //! Maps from base type index to a map from derived type index to caster - std::unordered_map map; - - std::multimap reverseMap; - - //! Error message used for unregistered polymorphic casts - #define UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(LoadSave) \ - throw cereal::Exception("Trying to " #LoadSave " a registered polymorphic type with an unregistered polymorphic cast.\n" \ - "Could not find a path to a base class (" + util::demangle(baseInfo.name()) + ") for type: " + ::cereal::util::demangledName() + "\n" \ - "Make sure you either serialize the base class at some point via cereal::base_class or cereal::virtual_base_class.\n" \ - "Alternatively, manually register the association with CEREAL_REGISTER_POLYMORPHIC_RELATION."); - - //! Checks if the mapping object that can perform the upcast or downcast exists, and returns it if so - /*! Uses the type index from the base and derived class to find the matching - registered caster. If no matching caster exists, the bool in the pair will be false and the vector - reference should not be used. */ - static std::pair const &> - lookup_if_exists( std::type_index const & baseIndex, std::type_index const & derivedIndex ) - { - // First phase of lookup - match base type index - auto const & baseMap = StaticObject::getInstance().map; - auto baseIter = baseMap.find( baseIndex ); - if (baseIter == baseMap.end()) - return {false, {}}; - - // Second phase - find a match from base to derived - auto const & derivedMap = baseIter->second; - auto derivedIter = derivedMap.find( derivedIndex ); - if (derivedIter == derivedMap.end()) - return {false, {}}; - - return {true, derivedIter->second}; - } - - //! Gets the mapping object that can perform the upcast or downcast - /*! Uses the type index from the base and derived class to find the matching - registered caster. If no matching caster exists, calls the exception function. - - The returned PolymorphicCaster is capable of upcasting or downcasting between the two types. */ - template inline - static std::vector const & lookup( std::type_index const & baseIndex, std::type_index const & derivedIndex, F && exceptionFunc ) - { - // First phase of lookup - match base type index - auto const & baseMap = StaticObject::getInstance().map; - auto baseIter = baseMap.find( baseIndex ); - if( baseIter == baseMap.end() ) - exceptionFunc(); - - // Second phase - find a match from base to derived - auto const & derivedMap = baseIter->second; - auto derivedIter = derivedMap.find( derivedIndex ); - if( derivedIter == derivedMap.end() ) - exceptionFunc(); - - return derivedIter->second; - } - - //! Performs a downcast to the derived type using a registered mapping - template inline - static const Derived * downcast( const void * dptr, std::type_info const & baseInfo ) - { - auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(save) } ); - - for( auto const * dmap : mapping ) - dptr = dmap->downcast( dptr ); - - return static_cast( dptr ); - } - - //! Performs an upcast to the registered base type using the given a derived type - /*! The return is untyped because the final casting to the base type must happen in the polymorphic - serialization function, where the type is known at compile time */ - template inline - static void * upcast( Derived * const dptr, std::type_info const & baseInfo ) - { - auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(load) } ); - - void * uptr = dptr; - for( auto mIter = mapping.rbegin(), mEnd = mapping.rend(); mIter != mEnd; ++mIter ) - uptr = (*mIter)->upcast( uptr ); - - return uptr; - } - - //! Upcasts for shared pointers - template inline - static std::shared_ptr upcast( std::shared_ptr const & dptr, std::type_info const & baseInfo ) - { - auto const & mapping = lookup( baseInfo, typeid(Derived), [&](){ UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION(load) } ); - - std::shared_ptr uptr = dptr; - for( auto mIter = mapping.rbegin(), mEnd = mapping.rend(); mIter != mEnd; ++mIter ) - uptr = (*mIter)->upcast( uptr ); - - return uptr; - } - - #undef UNREGISTERED_POLYMORPHIC_CAST_EXCEPTION - }; - - #ifdef CEREAL_OLDER_GCC - #define CEREAL_EMPLACE_MAP(map, key, value) \ - map.insert( std::make_pair(std::move(key), std::move(value)) ); - #else // NOT CEREAL_OLDER_GCC - #define CEREAL_EMPLACE_MAP(map, key, value) \ - map.emplace( key, value ); - #endif // NOT_CEREAL_OLDER_GCC - - //! Strongly typed derivation of PolymorphicCaster - template - struct PolymorphicVirtualCaster : PolymorphicCaster - { - //! Inserts an entry in the polymorphic casting map for this pairing - /*! Creates an explicit mapping between Base and Derived in both upwards and - downwards directions, allowing void pointers to either to be properly cast - assuming dynamic type information is available */ - PolymorphicVirtualCaster() - { - const auto baseKey = std::type_index(typeid(Base)); - const auto derivedKey = std::type_index(typeid(Derived)); - - // First insert the relation Base->Derived - const auto lock = StaticObject::lock(); - auto & baseMap = StaticObject::getInstance().map; - - { - auto & derivedMap = baseMap.insert( {baseKey, PolymorphicCasters::DerivedCasterMap{}} ).first->second; - auto & derivedVec = derivedMap.insert( {derivedKey, {}} ).first->second; - derivedVec.push_back( this ); - } - - // Insert reverse relation Derived->Base - auto & reverseMap = StaticObject::getInstance().reverseMap; - CEREAL_EMPLACE_MAP(reverseMap, derivedKey, baseKey); - - // Find all chainable unregistered relations - /* The strategy here is to process only the nodes in the class hierarchy graph that have been - affected by the new insertion. The algorithm iteratively processes a node an ensures that it - is updated with all new shortest length paths. It then processes the parents of the active node, - with the knowledge that all children have already been processed. - - Note that for the following, we'll use the nomenclature of parent and child to not confuse with - the inserted base derived relationship */ - { - // Checks whether there is a path from parent->child and returns a pair - // dist is set to MAX if the path does not exist - auto checkRelation = [](std::type_index const & parentInfo, std::type_index const & childInfo) -> - std::pair const &> - { - auto result = PolymorphicCasters::lookup_if_exists( parentInfo, childInfo ); - if( result.first ) - { - auto const & path = result.second; - return {path.size(), path}; - } - else - return {(std::numeric_limits::max)(), {}}; - }; - - std::stack parentStack; // Holds the parent nodes to be processed - std::vector dirtySet; // Marks child nodes that have been changed - std::unordered_set processedParents; // Marks parent nodes that have been processed - - // Checks if a child has been marked dirty - auto isDirty = [&](std::type_index const & c) - { - auto const dirtySetSize = dirtySet.size(); - for( size_t i = 0; i < dirtySetSize; ++i ) - if( dirtySet[i] == c ) - return true; - - return false; - }; - - // Begin processing the base key and mark derived as dirty - parentStack.push( baseKey ); - dirtySet.emplace_back( derivedKey ); - - while( !parentStack.empty() ) - { - using Relations = std::unordered_multimap>>; - Relations unregisteredRelations; // Defer insertions until after main loop to prevent iterator invalidation - - const auto parent = parentStack.top(); - parentStack.pop(); - - // Update paths to all children marked dirty - for( auto const & childPair : baseMap[parent] ) - { - const auto child = childPair.first; - if( isDirty( child ) && baseMap.count( child ) ) - { - auto parentChildPath = checkRelation( parent, child ); - - // Search all paths from the child to its own children (finalChild), - // looking for a shorter path from parent to finalChild - for( auto const & finalChildPair : baseMap[child] ) - { - const auto finalChild = finalChildPair.first; - - auto parentFinalChildPath = checkRelation( parent, finalChild ); - auto childFinalChildPath = checkRelation( child, finalChild ); - - const size_t newLength = 1u + parentChildPath.first; - - if( newLength < parentFinalChildPath.first ) - { - std::vector path = parentChildPath.second; - path.insert( path.end(), childFinalChildPath.second.begin(), childFinalChildPath.second.end() ); - - // Check to see if we have a previous uncommitted path in unregisteredRelations - // that is shorter. If so, ignore this path - auto hintRange = unregisteredRelations.equal_range( parent ); - auto hint = hintRange.first; - for( ; hint != hintRange.second; ++hint ) - if( hint->second.first == finalChild ) - break; - - const bool uncommittedExists = hint != unregisteredRelations.end(); - if( uncommittedExists && (hint->second.second.size() <= newLength) ) - continue; - - auto newPath = std::pair>{finalChild, std::move(path)}; - - // Insert the new path if it doesn't exist, otherwise this will just lookup where to do the - // replacement - #ifdef CEREAL_OLDER_GCC - auto old = unregisteredRelations.insert( hint, std::make_pair(parent, newPath) ); - #else // NOT CEREAL_OLDER_GCC - auto old = unregisteredRelations.emplace_hint( hint, parent, newPath ); - #endif // NOT CEREAL_OLDER_GCC - - // If there was an uncommitted path, we need to perform a replacement - if( uncommittedExists ) - old->second = newPath; - } - } // end loop over child's children - } // end if dirty and child has children - } // end loop over children - - // Insert chained relations - for( auto const & it : unregisteredRelations ) - { - auto & derivedMap = baseMap.find( it.first )->second; - derivedMap[it.second.first] = it.second.second; - CEREAL_EMPLACE_MAP(reverseMap, it.second.first, it.first ); - } - - // Mark current parent as modified - dirtySet.emplace_back( parent ); - - // Insert all parents of the current parent node that haven't yet been processed - auto parentRange = reverseMap.equal_range( parent ); - for( auto pIter = parentRange.first; pIter != parentRange.second; ++pIter ) - { - const auto pParent = pIter->second; - if( !processedParents.count( pParent ) ) - { - parentStack.push( pParent ); - processedParents.insert( pParent ); - } - } - } // end loop over parent stack - } // end chainable relations - } // end PolymorphicVirtualCaster() - - #undef CEREAL_EMPLACE_MAP - - //! Performs the proper downcast with the templated types - void const * downcast( void const * const ptr ) const override - { - return dynamic_cast( static_cast( ptr ) ); - } - - //! Performs the proper upcast with the templated types - void * upcast( void * const ptr ) const override - { - return dynamic_cast( static_cast( ptr ) ); - } - - //! Performs the proper upcast with the templated types (shared_ptr version) - std::shared_ptr upcast( std::shared_ptr const & ptr ) const override - { - return std::dynamic_pointer_cast( std::static_pointer_cast( ptr ) ); - } - }; - - //! Registers a polymorphic casting relation between a Base and Derived type - /*! Registering a relation allows cereal to properly cast between the two types - given runtime type information and void pointers. - - Registration happens automatically via cereal::base_class and cereal::virtual_base_class - instantiations. For cases where neither is called, see the CEREAL_REGISTER_POLYMORPHIC_RELATION - macro */ - template - struct RegisterPolymorphicCaster - { - static PolymorphicCaster const * bind( std::true_type /* is_polymorphic */) - { - return &StaticObject>::getInstance(); - } - - static PolymorphicCaster const * bind( std::false_type /* is_polymorphic */ ) - { return nullptr; } - - //! Performs registration (binding) between Base and Derived - /*! If the type is not polymorphic, nothing will happen */ - static PolymorphicCaster const * bind() - { return bind( typename std::is_polymorphic::type() ); } - }; - } - - /* General polymorphism support */ - namespace detail - { - //! Binds a compile time type with a user defined string - template - struct binding_name {}; - - //! A structure holding a map from type_indices to output serializer functions - /*! A static object of this map should be created for each registered archive - type, containing entries for every registered type that describe how to - properly cast the type to its real type in polymorphic scenarios for - shared_ptr, weak_ptr, and unique_ptr. */ - template - struct OutputBindingMap - { - //! A serializer function - /*! Serializer functions return nothing and take an archive as - their first parameter (will be cast properly inside the function, - a pointer to actual data (contents of smart_ptr's get() function) - as their second parameter, and the type info of the owning smart_ptr - as their final parameter */ - typedef std::function Serializer; - - //! Struct containing the serializer functions for all pointer types - struct Serializers - { - Serializer shared_ptr, //!< Serializer function for shared/weak pointers - unique_ptr; //!< Serializer function for unique pointers - }; - - //! A map of serializers for pointers of all registered types - std::map map; - }; - - //! An empty noop deleter - template struct EmptyDeleter { void operator()(T *) const {} }; - - //! A structure holding a map from type name strings to input serializer functions - /*! A static object of this map should be created for each registered archive - type, containing entries for every registered type that describe how to - properly cast the type to its real type in polymorphic scenarios for - shared_ptr, weak_ptr, and unique_ptr. */ - template - struct InputBindingMap - { - //! Shared ptr serializer function - /*! Serializer functions return nothing and take an archive as - their first parameter (will be cast properly inside the function, - a shared_ptr (or unique_ptr for the unique case) of any base - type, and the type id of said base type as the third parameter. - Internally it will properly be loaded and cast to the correct type. */ - typedef std::function &, std::type_info const &)> SharedSerializer; - //! Unique ptr serializer function - typedef std::function> &, std::type_info const &)> UniqueSerializer; - - //! Struct containing the serializer functions for all pointer types - struct Serializers - { - SharedSerializer shared_ptr; //!< Serializer function for shared/weak pointers - UniqueSerializer unique_ptr; //!< Serializer function for unique pointers - }; - - //! A map of serializers for pointers of all registered types - std::map map; - }; - - // forward decls for archives from cereal.hpp - class InputArchiveBase; - class OutputArchiveBase; - - //! Creates a binding (map entry) between an input archive type and a polymorphic type - /*! Bindings are made when types are registered, assuming that at least one - archive has already been registered. When this struct is created, - it will insert (at run time) an entry into a map that properly handles - casting for serializing polymorphic objects */ - template struct InputBindingCreator - { - //! Initialize the binding - InputBindingCreator() - { - auto & map = StaticObject>::getInstance().map; - auto lock = StaticObject>::lock(); - auto key = std::string(binding_name::name()); - auto lb = map.lower_bound(key); - - if (lb != map.end() && lb->first == key) - return; - - typename InputBindingMap::Serializers serializers; - - serializers.shared_ptr = - [](void * arptr, std::shared_ptr & dptr, std::type_info const & baseInfo) - { - Archive & ar = *static_cast(arptr); - std::shared_ptr ptr; - - ar( CEREAL_NVP_("ptr_wrapper", ::cereal::memory_detail::make_ptr_wrapper(ptr)) ); - - dptr = PolymorphicCasters::template upcast( ptr, baseInfo ); - }; - - serializers.unique_ptr = - [](void * arptr, std::unique_ptr> & dptr, std::type_info const & baseInfo) - { - Archive & ar = *static_cast(arptr); - std::unique_ptr ptr; - - ar( CEREAL_NVP_("ptr_wrapper", ::cereal::memory_detail::make_ptr_wrapper(ptr)) ); - - dptr.reset( PolymorphicCasters::template upcast( ptr.release(), baseInfo )); - }; - - map.insert( lb, { std::move(key), std::move(serializers) } ); - } - }; - - //! Creates a binding (map entry) between an output archive type and a polymorphic type - /*! Bindings are made when types are registered, assuming that at least one - archive has already been registered. When this struct is created, - it will insert (at run time) an entry into a map that properly handles - casting for serializing polymorphic objects */ - template struct OutputBindingCreator - { - //! Writes appropriate metadata to the archive for this polymorphic type - static void writeMetadata(Archive & ar) - { - // Register the polymorphic type name with the archive, and get the id - char const * name = binding_name::name(); - std::uint32_t id = ar.registerPolymorphicType(name); - - // Serialize the id - ar( CEREAL_NVP_("polymorphic_id", id) ); - - // If the msb of the id is 1, then the type name is new, and we should serialize it - if( id & detail::msb_32bit ) - { - std::string namestring(name); - ar( CEREAL_NVP_("polymorphic_name", namestring) ); - } - } - - //! Holds a properly typed shared_ptr to the polymorphic type - class PolymorphicSharedPointerWrapper - { - public: - /*! Wrap a raw polymorphic pointer in a shared_ptr to its true type - - The wrapped pointer will not be responsible for ownership of the held pointer - so it will not attempt to destroy it; instead the refcount of the wrapped - pointer will be tied to a fake 'ownership pointer' that will do nothing - when it ultimately goes out of scope. - - The main reason for doing this, other than not to destroy the true object - with our wrapper pointer, is to avoid meddling with the internal reference - count in a polymorphic type that inherits from std::enable_shared_from_this. - - @param dptr A void pointer to the contents of the shared_ptr to serialize */ - PolymorphicSharedPointerWrapper( T const * dptr ) : refCount(), wrappedPtr( refCount, dptr ) - { } - - //! Get the wrapped shared_ptr */ - inline std::shared_ptr const & operator()() const { return wrappedPtr; } - - private: - std::shared_ptr refCount; //!< The ownership pointer - std::shared_ptr wrappedPtr; //!< The wrapped pointer - }; - - //! Does the actual work of saving a polymorphic shared_ptr - /*! This function will properly create a shared_ptr from the void * that is passed in - before passing it to the archive for serialization. - - In addition, this will also preserve the state of any internal enable_shared_from_this mechanisms - - @param ar The archive to serialize to - @param dptr Pointer to the actual data held by the shared_ptr */ - static inline void savePolymorphicSharedPtr( Archive & ar, T const * dptr, std::true_type /* has_shared_from_this */ ) - { - ::cereal::memory_detail::EnableSharedStateHelper state( const_cast(dptr) ); - PolymorphicSharedPointerWrapper psptr( dptr ); - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( psptr() ) ) ); - } - - //! Does the actual work of saving a polymorphic shared_ptr - /*! This function will properly create a shared_ptr from the void * that is passed in - before passing it to the archive for serialization. - - This version is for types that do not inherit from std::enable_shared_from_this. - - @param ar The archive to serialize to - @param dptr Pointer to the actual data held by the shared_ptr */ - static inline void savePolymorphicSharedPtr( Archive & ar, T const * dptr, std::false_type /* has_shared_from_this */ ) - { - PolymorphicSharedPointerWrapper psptr( dptr ); - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( psptr() ) ) ); - } - - //! Initialize the binding - OutputBindingCreator() - { - auto & map = StaticObject>::getInstance().map; - auto key = std::type_index(typeid(T)); - auto lb = map.lower_bound(key); - - if (lb != map.end() && lb->first == key) - return; - - typename OutputBindingMap::Serializers serializers; - - serializers.shared_ptr = - [&](void * arptr, void const * dptr, std::type_info const & baseInfo) - { - Archive & ar = *static_cast(arptr); - writeMetadata(ar); - - auto ptr = PolymorphicCasters::template downcast( dptr, baseInfo ); - - #if defined(_MSC_VER) && _MSC_VER < 1916 && !defined(__clang__) - savePolymorphicSharedPtr( ar, ptr, ::cereal::traits::has_shared_from_this::type() ); // MSVC doesn't like typename here - #else // not _MSC_VER - savePolymorphicSharedPtr( ar, ptr, typename ::cereal::traits::has_shared_from_this::type() ); - #endif // _MSC_VER - }; - - serializers.unique_ptr = - [&](void * arptr, void const * dptr, std::type_info const & baseInfo) - { - Archive & ar = *static_cast(arptr); - writeMetadata(ar); - - std::unique_ptr> const ptr( PolymorphicCasters::template downcast( dptr, baseInfo ) ); - - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); - }; - - map.insert( { std::move(key), std::move(serializers) } ); - } - }; - - //! Used to help out argument dependent lookup for finding potential overloads - //! of instantiate_polymorphic_binding - struct adl_tag {}; - - //! Tag for init_binding, bind_to_archives and instantiate_polymorphic_binding. - //! For C++14 and below, we must instantiate a unique StaticObject per TU that is - //! otherwise identical -- otherwise we get multiple definition problems (ODR violations). - //! To achieve this, put a tag in an anonymous namespace and use it as a template argument. - //! - //! For C++17, we can use static inline global variables to unify these definitions across - //! all TUs in the same shared object (DLL). The tag is therefore not necessary. - //! For convenience, keep it to not complicate other code, but don't put it in - //! an anonymous namespace. Now the template instantiations will correspond - //! to the same type, and since they are marked inline with C++17, they will be merged - //! across all TUs. -#ifdef CEREAL_HAS_CPP17 - struct polymorphic_binding_tag {}; -#else - namespace { struct polymorphic_binding_tag {}; } -#endif - - - //! Causes the static object bindings between an archive type and a serializable type T - template - struct create_bindings - { - static const InputBindingCreator & - load(std::true_type) - { - return cereal::detail::StaticObject>::getInstance(); - } - - static const OutputBindingCreator & - save(std::true_type) - { - return cereal::detail::StaticObject>::getInstance(); - } - - inline static void load(std::false_type) {} - inline static void save(std::false_type) {} - }; - - //! When specialized, causes the compiler to instantiate its parameter - template - struct instantiate_function {}; - - /*! This struct is used as the return type of instantiate_polymorphic_binding - for specific Archive types. When the compiler looks for overloads of - instantiate_polymorphic_binding, it will be forced to instantiate this - struct during overload resolution, even though it will not be part of a valid - overload */ - template - struct polymorphic_serialization_support - { - #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) - //! Creates the appropriate bindings depending on whether the archive supports - //! saving or loading - virtual CEREAL_DLL_EXPORT void instantiate() CEREAL_USED; - #else // NOT _MSC_VER - //! Creates the appropriate bindings depending on whether the archive supports - //! saving or loading - static CEREAL_DLL_EXPORT void instantiate() CEREAL_USED; - //! This typedef causes the compiler to instantiate this static function - typedef instantiate_function unused; - #endif // _MSC_VER - }; - - // instantiate implementation - template - CEREAL_DLL_EXPORT void polymorphic_serialization_support::instantiate() - { - create_bindings::save( std::integral_constant::value && - traits::is_output_serializable::value>{} ); - - create_bindings::load( std::integral_constant::value && - traits::is_input_serializable::value>{} ); - } - - //! Begins the binding process of a type to all registered archives - /*! Archives need to be registered prior to this struct being instantiated via - the CEREAL_REGISTER_ARCHIVE macro. Overload resolution will then force - several static objects to be made that allow us to bind together all - registered archive types with the parameter type T. */ - template - struct bind_to_archives - { - //! Binding for non abstract types - void bind(std::false_type) const - { - instantiate_polymorphic_binding(static_cast(nullptr), 0, Tag{}, adl_tag{}); - } - - //! Binding for abstract types - void bind(std::true_type) const - { } - - //! Binds the type T to all registered archives - /*! If T is abstract, we will not serialize it and thus - do not need to make a binding */ - bind_to_archives const & bind() const - { - static_assert( std::is_polymorphic::value, - "Attempting to register non polymorphic type" ); - bind( std::is_abstract() ); - return *this; - } - }; - - //! Used to hide the static object used to bind T to registered archives - template - struct init_binding; - - //! Base case overload for instantiation - /*! This will end up always being the best overload due to the second - parameter always being passed as an int. All other overloads will - accept pointers to archive types and have lower precedence than int. - - Since the compiler needs to check all possible overloads, the - other overloads created via CEREAL_REGISTER_ARCHIVE, which will have - lower precedence due to requiring a conversion from int to (Archive*), - will cause their return types to be instantiated through the static object - mechanisms even though they are never called. - - See the documentation for the other functions to try and understand this */ - template - void instantiate_polymorphic_binding( T*, int, BindingTag, adl_tag ) {} - } // namespace detail -} // namespace cereal - -#endif // CEREAL_DETAILS_POLYMORPHIC_IMPL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp b/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp deleted file mode 100644 index 83ae7fad5..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*! \file polymorphic_impl_fwd.hpp - \brief Internal polymorphism support forward declarations - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This code is heavily inspired by the boost serialization implementation by the following authors - - (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . - Use, modification and distribution is subject to the Boost Software - License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt) - - See http://www.boost.org for updates, documentation, and revision history. - - (C) Copyright 2006 David Abrahams - http://www.boost.org. - - See /boost/serialization/export.hpp and /boost/archive/detail/register_archive.hpp for their - implementation. -*/ - -#ifndef CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ -#define CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ - -namespace cereal -{ - namespace detail - { - //! Forward declaration, see polymorphic_impl.hpp for more information - template - struct RegisterPolymorphicCaster; - - //! Forward declaration, see polymorphic_impl.hpp for more information - struct PolymorphicCasters; - - //! Forward declaration, see polymorphic_impl.hpp for more information - template - struct PolymorphicRelation; - } // namespace detail -} // namespace cereal - -#endif // CEREAL_DETAILS_POLYMORPHIC_IMPL_FWD_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/static_object.hpp b/cpp/src/cylon/thridparty/cereal/details/static_object.hpp deleted file mode 100644 index 727cf15d0..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/static_object.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/*! \file static_object.hpp - \brief Internal polymorphism static object support - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_DETAILS_STATIC_OBJECT_HPP_ -#define CEREAL_DETAILS_STATIC_OBJECT_HPP_ - -#include "cylon/thridparty/cereal/macros.hpp" - -#if CEREAL_THREAD_SAFE -#include -#endif - -//! Prevent link optimization from removing non-referenced static objects -/*! Especially for polymorphic support, we create static objects which - may not ever be explicitly referenced. Most linkers will detect this - and remove the code causing various unpleasant runtime errors. These - macros, adopted from Boost (see force_include.hpp) prevent this - (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . - Use, modification and distribution is subject to the Boost Software - License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) */ - -#if defined(_MSC_VER) && !defined(__clang__) -# define CEREAL_DLL_EXPORT __declspec(dllexport) -# define CEREAL_USED -#else // clang or gcc -# define CEREAL_DLL_EXPORT __attribute__ ((visibility("default"))) -# define CEREAL_USED __attribute__ ((__used__)) -#endif - -namespace cereal -{ - namespace detail - { - //! A static, pre-execution object - /*! This class will create a single copy (singleton) of some - type and ensures that merely referencing this type will - cause it to be instantiated and initialized pre-execution. - For example, this is used heavily in the polymorphic pointer - serialization mechanisms to bind various archive types with - different polymorphic classes */ - template - class CEREAL_DLL_EXPORT StaticObject - { - private: - - static T & create() - { - static T t; - //! Forces instantiation at pre-execution time - (void)instance; - return t; - } - - StaticObject( StaticObject const & /*other*/ ) {} - - public: - static T & getInstance() - { - return create(); - } - - //! A class that acts like std::lock_guard - class LockGuard - { - #if CEREAL_THREAD_SAFE - public: - LockGuard(std::mutex & m) : lock(m) {} - private: - std::unique_lock lock; - #else - public: - LockGuard() = default; - LockGuard(LockGuard const &) = default; // prevents implicit copy ctor warning - ~LockGuard() CEREAL_NOEXCEPT {} // prevents variable not used - #endif - }; - - //! Attempts to lock this static object for the current scope - /*! @note This function is a no-op if cereal is not compiled with - thread safety enabled (CEREAL_THREAD_SAFE = 1). - - This function returns an object that holds a lock for - this StaticObject that will release its lock upon destruction. This - call will block until the lock is available. */ - static LockGuard lock() - { - #if CEREAL_THREAD_SAFE - static std::mutex instanceMutex; - return LockGuard{instanceMutex}; - #else - return LockGuard{}; - #endif - } - - private: - static T & instance; - }; - - template T & StaticObject::instance = StaticObject::create(); - } // namespace detail -} // namespace cereal - -#endif // CEREAL_DETAILS_STATIC_OBJECT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/traits.hpp b/cpp/src/cylon/thridparty/cereal/details/traits.hpp deleted file mode 100644 index ae5cabc1f..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/traits.hpp +++ /dev/null @@ -1,1411 +0,0 @@ -/*! \file traits.hpp - \brief Internal type trait support - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_DETAILS_TRAITS_HPP_ -#define CEREAL_DETAILS_TRAITS_HPP_ - -#ifndef __clang__ -#if (__GNUC__ == 4 && __GNUC_MINOR__ <= 7) -#define CEREAL_OLDER_GCC -#endif // gcc 4.7 or earlier -#endif // __clang__ - -#include -#include - -#include "cylon/thridparty/cereal/macros.hpp" -#include "cylon/thridparty/cereal/access.hpp" - -namespace cereal -{ - namespace traits - { - using yes = std::true_type; - using no = std::false_type; - - namespace detail - { - // ###################################################################### - //! Used to delay a static_assert until template instantiation - template - struct delay_static_assert : std::false_type {}; - - // ###################################################################### - // SFINAE Helpers - #ifdef CEREAL_OLDER_GCC // when VS supports better SFINAE, we can use this as the default - template struct Void { typedef void type; }; - #endif // CEREAL_OLDER_GCC - - //! Return type for SFINAE Enablers - enum class sfinae {}; - - // ###################################################################### - // Helper functionality for boolean integral constants and Enable/DisableIf - template struct meta_bool_and : std::integral_constant::value> {}; - template struct meta_bool_and : std::integral_constant {}; - - template struct meta_bool_or : std::integral_constant::value> {}; - template struct meta_bool_or : std::integral_constant {}; - - // workaround needed due to bug in MSVC 2013, see - // http://connect.microsoft.com/VisualStudio/feedback/details/800231/c-11-alias-template-issue - template - struct EnableIfHelper : std::enable_if::value, sfinae> {}; - - template - struct DisableIfHelper : std::enable_if::value, sfinae> {}; - } // namespace detail - - //! Used as the default value for EnableIf and DisableIf template parameters - /*! @relates EnableIf - @relates DisableIf */ - static const detail::sfinae sfinae = {}; - - // ###################################################################### - //! Provides a way to enable a function if conditions are met - /*! This is intended to be used in a near identical fashion to std::enable_if - while being significantly easier to read at the cost of not allowing for as - complicated of a condition. - - This will compile (allow the function) if every condition evaluates to true. - at compile time. This should be used with SFINAE to ensure that at least - one other candidate function works when one fails due to an EnableIf. - - This should be used as the las template parameter to a function as - an unnamed parameter with a default value of cereal::traits::sfinae: - - @code{cpp} - // using by making the last template argument variadic - template ::value> = sfinae> - void func(T t ); - @endcode - - Note that this performs a logical AND of all conditions, so you will need - to construct more complicated requirements with this fact in mind. - - @relates DisableIf - @relates sfinae - @tparam Conditions The conditions which will be logically ANDed to enable the function. */ - template - using EnableIf = typename detail::EnableIfHelper::type; - - // ###################################################################### - //! Provides a way to disable a function if conditions are met - /*! This is intended to be used in a near identical fashion to std::enable_if - while being significantly easier to read at the cost of not allowing for as - complicated of a condition. - - This will compile (allow the function) if every condition evaluates to false. - This should be used with SFINAE to ensure that at least one other candidate - function works when one fails due to a DisableIf. - - This should be used as the las template parameter to a function as - an unnamed parameter with a default value of cereal::traits::sfinae: - - @code{cpp} - // using by making the last template argument variadic - template ::value> = sfinae> - void func(T t ); - @endcode - - This is often used in conjunction with EnableIf to form an enable/disable pair of - overloads. - - Note that this performs a logical AND of all conditions, so you will need - to construct more complicated requirements with this fact in mind. If all conditions - hold, the function will be disabled. - - @relates EnableIf - @relates sfinae - @tparam Conditions The conditions which will be logically ANDed to disable the function. */ - template - using DisableIf = typename detail::DisableIfHelper::type; - - // ###################################################################### - namespace detail - { - template - struct get_output_from_input : no - { - static_assert( detail::delay_static_assert::value, - "Could not find an associated output archive for input archive." ); - }; - - template - struct get_input_from_output : no - { - static_assert( detail::delay_static_assert::value, - "Could not find an associated input archive for output archive." ); - }; - } - - //! Sets up traits that relate an input archive to an output archive - #define CEREAL_SETUP_ARCHIVE_TRAITS(InputArchive, OutputArchive) \ - namespace cereal { namespace traits { namespace detail { \ - template <> struct get_output_from_input \ - { using type = OutputArchive; }; \ - template <> struct get_input_from_output \ - { using type = InputArchive; }; } } } /* end namespaces */ - - // ###################################################################### - //! Used to convert a MAKE_HAS_XXX macro into a versioned variant - #define CEREAL_MAKE_VERSIONED_TEST ,0 - - // ###################################################################### - //! Creates a test for whether a non const member function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param name The name of the function to test for (e.g. serialize, load, save) - @param test_name The name to give the test for the function being tested for (e.g. serialize, versioned_serialize) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #ifdef CEREAL_OLDER_GCC - #define CEREAL_MAKE_HAS_MEMBER_TEST(name, test_name, versioned) \ - template \ - struct has_member_##test_name : no {}; \ - template \ - struct has_member_##test_name(), std::declval() versioned ) ) >::type> : yes {} - #else // NOT CEREAL_OLDER_GCC - #define CEREAL_MAKE_HAS_MEMBER_TEST(name, test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##name##_##versioned##_impl \ - { \ - template \ - static auto test(int) -> decltype( cereal::access::member_##name( std::declval(), std::declval() versioned ), yes()); \ - template \ - static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - }; \ - } /* end namespace detail */ \ - template \ - struct has_member_##test_name : std::integral_constant::value> {} - #endif // NOT CEREAL_OLDER_GCC - - // ###################################################################### - //! Creates a test for whether a non const non-member function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper non-member function for the given archive. */ - #define CEREAL_MAKE_HAS_NON_MEMBER_TEST(test_name, func, versioned) \ - namespace detail \ - { \ - template \ - struct has_non_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( func( std::declval(), std::declval() versioned ), yes()); \ - template \ - static no test( ... ); \ - static const bool value = std::is_same( 0 ) ), yes>::value; \ - }; \ - } /* end namespace detail */ \ - template \ - struct has_non_member_##test_name : std::integral_constant::value> {} - - // ###################################################################### - // Member Serialize - CEREAL_MAKE_HAS_MEMBER_TEST(serialize, serialize,); - - // ###################################################################### - // Member Serialize (versioned) - CEREAL_MAKE_HAS_MEMBER_TEST(serialize, versioned_serialize, CEREAL_MAKE_VERSIONED_TEST); - - // ###################################################################### - // Non Member Serialize - CEREAL_MAKE_HAS_NON_MEMBER_TEST(serialize, CEREAL_SERIALIZE_FUNCTION_NAME,); - - // ###################################################################### - // Non Member Serialize (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_TEST(versioned_serialize, CEREAL_SERIALIZE_FUNCTION_NAME, CEREAL_MAKE_VERSIONED_TEST); - - // ###################################################################### - // Member Load - CEREAL_MAKE_HAS_MEMBER_TEST(load, load,); - - // ###################################################################### - // Member Load (versioned) - CEREAL_MAKE_HAS_MEMBER_TEST(load, versioned_load, CEREAL_MAKE_VERSIONED_TEST); - - // ###################################################################### - // Non Member Load - CEREAL_MAKE_HAS_NON_MEMBER_TEST(load, CEREAL_LOAD_FUNCTION_NAME,); - - // ###################################################################### - // Non Member Load (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_TEST(versioned_load, CEREAL_LOAD_FUNCTION_NAME, CEREAL_MAKE_VERSIONED_TEST); - - // ###################################################################### - #undef CEREAL_MAKE_HAS_NON_MEMBER_TEST - #undef CEREAL_MAKE_HAS_MEMBER_TEST - - // ###################################################################### - //! Creates a test for whether a member save function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param test_name The name to give the test (e.g. save or versioned_save) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #ifdef CEREAL_OLDER_GCC - #define CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##test_name##_impl \ - { \ - template struct test : no {}; \ - template \ - struct test(), \ - std::declval() versioned ) ) >::type> : yes {}; \ - static const bool value = test(); \ - \ - template struct test2 : no {}; \ - template \ - struct test2(), \ - std::declval::type&>() versioned ) ) >::type> : yes {}; \ - static const bool not_const_type = test2(); \ - }; \ - } /* end namespace detail */ - #else /* NOT CEREAL_OLDER_GCC =================================== */ - #define CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( cereal::access::member_save( std::declval(), \ - std::declval() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - \ - template \ - static auto test2(int) -> decltype( cereal::access::member_save_non_const( \ - std::declval(), \ - std::declval::type&>() versioned ), yes()); \ - template static no test2(...); \ - static const bool not_const_type = std::is_same(0)), yes>::value; \ - }; \ - } /* end namespace detail */ - #endif /* NOT CEREAL_OLDER_GCC */ - - // ###################################################################### - // Member Save - CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(save, ) - - template - struct has_member_save : std::integral_constant::value> - { - typedef typename detail::has_member_save_impl check; - static_assert( check::value || !check::not_const_type, - "cereal detected a non-const save. \n " - "save member functions must always be const" ); - }; - - // ###################################################################### - // Member Save (versioned) - CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL(versioned_save, CEREAL_MAKE_VERSIONED_TEST) - - template - struct has_member_versioned_save : std::integral_constant::value> - { - typedef typename detail::has_member_versioned_save_impl check; - static_assert( check::value || !check::not_const_type, - "cereal detected a versioned non-const save. \n " - "save member functions must always be const" ); - }; - - // ###################################################################### - #undef CEREAL_MAKE_HAS_MEMBER_SAVE_IMPL - - // ###################################################################### - //! Creates a test for whether a non-member save function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper non-member function for the given archive. - - @param test_name The name to give the test (e.g. save or versioned_save) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #define CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_non_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( CEREAL_SAVE_FUNCTION_NAME( \ - std::declval(), \ - std::declval() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - \ - template \ - static auto test2(int) -> decltype( CEREAL_SAVE_FUNCTION_NAME( \ - std::declval(), \ - std::declval::type&>() versioned ), yes()); \ - template static no test2(...); \ - static const bool not_const_type = std::is_same(0)), yes>::value; \ - }; \ - } /* end namespace detail */ \ - \ - template \ - struct has_non_member_##test_name : std::integral_constant::value> \ - { \ - using check = typename detail::has_non_member_##test_name##_impl; \ - static_assert( check::value || !check::not_const_type, \ - "cereal detected a non-const type parameter in non-member " #test_name ". \n " \ - #test_name " non-member functions must always pass their types as const" ); \ - }; - - // ###################################################################### - // Non Member Save - CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(save, ) - - // ###################################################################### - // Non Member Save (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST(versioned_save, CEREAL_MAKE_VERSIONED_TEST) - - // ###################################################################### - #undef CEREAL_MAKE_HAS_NON_MEMBER_SAVE_TEST - - // ###################################################################### - // Minimal Utilities - namespace detail - { - // Determines if the provided type is an std::string - template struct is_string : std::false_type {}; - - template - struct is_string> : std::true_type {}; - } - - // Determines if the type is valid for use with a minimal serialize function - template - struct is_minimal_type : std::integral_constant::value || std::is_arithmetic::value> {}; - - // ###################################################################### - //! Creates implementation details for whether a member save_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #ifdef CEREAL_OLDER_GCC - #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##test_name##_impl \ - { \ - template struct test : no {}; \ - template \ - struct test(), \ - std::declval() versioned ) ) >::type> : yes {}; \ - \ - static const bool value = test(); \ - \ - template struct test2 : no {}; \ - template \ - struct test2(), \ - std::declval::type&>() versioned ) ) >::type> : yes {}; \ - static const bool not_const_type = test2(); \ - \ - static const bool valid = value || !not_const_type; \ - }; \ - } /* end namespace detail */ - #else /* NOT CEREAL_OLDER_GCC =================================== */ - #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( cereal::access::member_save_minimal( \ - std::declval(), \ - std::declval() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - \ - template \ - static auto test2(int) -> decltype( cereal::access::member_save_minimal_non_const( \ - std::declval(), \ - std::declval::type&>() versioned ), yes()); \ - template static no test2(...); \ - static const bool not_const_type = std::is_same(0)), yes>::value; \ - \ - static const bool valid = value || !not_const_type; \ - }; \ - } /* end namespace detail */ - #endif // NOT CEREAL_OLDER_GCC - - // ###################################################################### - //! Creates helpers for minimal save functions - /*! The get_member_*_type structs allow access to the return type of a save_minimal, - assuming that the function actually exists. If the function does not - exist, the type will be void. - - @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct get_member_##test_name##_type { using type = void; }; \ - \ - template \ - struct get_member_##test_name##_type \ - { \ - using type = decltype( cereal::access::member_save_minimal( std::declval(), \ - std::declval() versioned ) ); \ - }; \ - } /* end namespace detail */ - - // ###################################################################### - //! Creates a test for whether a member save_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) */ - #define CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(test_name) \ - template \ - struct has_member_##test_name : std::integral_constant::value> \ - { \ - using check = typename detail::has_member_##test_name##_impl; \ - static_assert( check::valid, \ - "cereal detected a non-const member " #test_name ". \n " \ - #test_name " member functions must always be const" ); \ - \ - using type = typename detail::get_member_##test_name##_type::type; \ - static_assert( (check::value && is_minimal_type::value) || !check::value, \ - "cereal detected a member " #test_name " with an invalid return type. \n " \ - "return type must be arithmetic or string" ); \ - }; - - // ###################################################################### - // Member Save Minimal - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(save_minimal, ) - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(save_minimal, ) - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(save_minimal) - - // ###################################################################### - // Member Save Minimal (versioned) - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) - CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST(versioned_save_minimal) - - // ###################################################################### - #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_IMPL - #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_HELPERS_IMPL - #undef CEREAL_MAKE_HAS_MEMBER_SAVE_MINIMAL_TEST - - // ###################################################################### - //! Creates a test for whether a non-member save_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param test_name The name to give the test (e.g. save_minimal or versioned_save_minimal) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #define CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_non_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( \ - std::declval(), \ - std::declval() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - \ - template \ - static auto test2(int) -> decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( \ - std::declval(), \ - std::declval::type&>() versioned ), yes()); \ - template static no test2(...); \ - static const bool not_const_type = std::is_same(0)), yes>::value; \ - \ - static const bool valid = value || !not_const_type; \ - }; \ - \ - template \ - struct get_non_member_##test_name##_type { using type = void; }; \ - \ - template \ - struct get_non_member_##test_name##_type \ - { \ - using type = decltype( CEREAL_SAVE_MINIMAL_FUNCTION_NAME( std::declval(), \ - std::declval() versioned ) ); \ - }; \ - } /* end namespace detail */ \ - \ - template \ - struct has_non_member_##test_name : std::integral_constant::value> \ - { \ - using check = typename detail::has_non_member_##test_name##_impl; \ - static_assert( check::valid, \ - "cereal detected a non-const type parameter in non-member " #test_name ". \n " \ - #test_name " non-member functions must always pass their types as const" ); \ - \ - using type = typename detail::get_non_member_##test_name##_type::type; \ - static_assert( (check::value && is_minimal_type::value) || !check::value, \ - "cereal detected a non-member " #test_name " with an invalid return type. \n " \ - "return type must be arithmetic or string" ); \ - }; - - // ###################################################################### - // Non-Member Save Minimal - CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(save_minimal, ) - - // ###################################################################### - // Non-Member Save Minimal (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST(versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) - - // ###################################################################### - #undef CEREAL_MAKE_HAS_NON_MEMBER_SAVE_MINIMAL_TEST - - // ###################################################################### - // Load Minimal Utilities - namespace detail - { - //! Used to help strip away conversion wrappers - /*! If someone writes a non-member load/save minimal function that accepts its - parameter as some generic template type and needs to perform trait checks - on that type, our NoConvert wrappers will interfere with this. Using - the struct strip_minmal, users can strip away our wrappers to get to - the underlying type, allowing traits to work properly */ - struct NoConvertBase {}; - - //! A struct that prevents implicit conversion - /*! Any type instantiated with this struct will be unable to implicitly convert - to another type. Is designed to only allow conversion to Source const &. - - @tparam Source the type of the original source */ - template - struct NoConvertConstRef : NoConvertBase - { - using type = Source; //!< Used to get underlying type easily - - template ::value>::type> - operator Dest () = delete; - - //! only allow conversion if the types are the same and we are converting into a const reference - template ::value>::type> - operator Dest const & (); - }; - - //! A struct that prevents implicit conversion - /*! Any type instantiated with this struct will be unable to implicitly convert - to another type. Is designed to only allow conversion to Source &. - - @tparam Source the type of the original source */ - template - struct NoConvertRef : NoConvertBase - { - using type = Source; //!< Used to get underlying type easily - - template ::value>::type> - operator Dest () = delete; - - #ifdef __clang__ - template ::value>::type> - operator Dest const & () = delete; - #endif // __clang__ - - //! only allow conversion if the types are the same and we are converting into a const reference - template ::value>::type> - operator Dest & (); - }; - - //! A type that can implicitly convert to anything else - struct AnyConvert - { - template - operator Dest & (); - - template - operator Dest const & () const; - }; - } // namespace detail - - // ###################################################################### - //! Creates a test for whether a member load_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - Our strategy here is to first check if a function matching the signature more or less exists - (allow anything like load_minimal(xxx) using AnyConvert, and then secondly enforce - that it has the correct signature using NoConvertConstRef - - @param test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #ifdef CEREAL_OLDER_GCC - #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template struct has_member_##test_name##_impl : no {}; \ - template \ - struct has_member_##test_name##_impl(), \ - std::declval(), AnyConvert() versioned ) ) >::type> : yes {}; \ - \ - template struct has_member_##test_name##_type_impl : no {}; \ - template \ - struct has_member_##test_name##_type_impl(), \ - std::declval(), NoConvertConstRef() versioned ) ) >::type> : yes {}; \ - } /* end namespace detail */ - #else /* NOT CEREAL_OLDER_GCC =================================== */ - #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( cereal::access::member_load_minimal( \ - std::declval(), \ - std::declval(), AnyConvert() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - }; \ - template \ - struct has_member_##test_name##_type_impl \ - { \ - template \ - static auto test(int) -> decltype( cereal::access::member_load_minimal( \ - std::declval(), \ - std::declval(), NoConvertConstRef() versioned ), yes()); \ - template static no test(...); \ - static const bool value = std::is_same(0)), yes>::value; \ - \ - }; \ - } /* end namespace detail */ - #endif // NOT CEREAL_OLDER_GCC - - // ###################################################################### - //! Creates helpers for minimal load functions - /*! The has_member_*_wrapper structs ensure that the load and save types for the - requested function type match appropriately. - - @param load_test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) - @param save_test_name The name to give the test (e.g. save_minimal or versioned_save_minimal, - should match the load name. - @param save_test_prefix The name to give the test (e.g. save_minimal or versioned_save_minimal, - should match the load name, without the trailing "_minimal" (e.g. - save or versioned_save). Needed because the preprocessor is an abomination. - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(load_test_name, save_test_name, save_test_prefix, versioned) \ - namespace detail \ - { \ - template \ - struct has_member_##load_test_name##_wrapper : std::false_type {}; \ - \ - template \ - struct has_member_##load_test_name##_wrapper \ - { \ - using AOut = typename detail::get_output_from_input::type; \ - \ - static_assert( has_member_##save_test_prefix##_minimal::value, \ - "cereal detected member " #load_test_name " but no valid member " #save_test_name ". \n " \ - "cannot evaluate correctness of " #load_test_name " without valid " #save_test_name "." ); \ - \ - using SaveType = typename detail::get_member_##save_test_prefix##_minimal_type::type; \ - const static bool value = has_member_##load_test_name##_impl::value; \ - const static bool valid = has_member_##load_test_name##_type_impl::value; \ - \ - static_assert( valid || !value, "cereal detected different or invalid types in corresponding member " \ - #load_test_name " and " #save_test_name " functions. \n " \ - "the paramater to " #load_test_name " must be a constant reference to the type that " \ - #save_test_name " returns." ); \ - }; \ - } /* end namespace detail */ - - // ###################################################################### - //! Creates a test for whether a member load_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - @param load_test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) - @param load_test_prefix The above parameter minus the trailing "_minimal" */ - #define CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(load_test_name, load_test_prefix) \ - template \ - struct has_member_##load_test_prefix##_minimal : std::integral_constant::value>::value> {}; - - // ###################################################################### - // Member Load Minimal - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(load_minimal, ) - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(load_minimal, save_minimal, save, ) - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(load_minimal, load) - - // ###################################################################### - // Member Load Minimal (versioned) - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL(versioned_load_minimal, CEREAL_MAKE_VERSIONED_TEST) - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL(versioned_load_minimal, versioned_save_minimal, versioned_save, CEREAL_MAKE_VERSIONED_TEST) - CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST(versioned_load_minimal, versioned_load) - - // ###################################################################### - #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_IMPL - #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_HELPERS_IMPL - #undef CEREAL_MAKE_HAS_MEMBER_LOAD_MINIMAL_TEST - - // ###################################################################### - // Non-Member Load Minimal - namespace detail - { - #ifdef CEREAL_OLDER_GCC - void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(); // prevents nonsense complaining about not finding this - void CEREAL_SAVE_MINIMAL_FUNCTION_NAME(); - #endif // CEREAL_OLDER_GCC - } // namespace detail - - // ###################################################################### - //! Creates a test for whether a non-member load_minimal function exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper member function for the given archive. - - See notes from member load_minimal implementation. - - Note that there should be an additional const check on load_minimal after the valid check, - but this currently interferes with many valid uses of minimal serialization. It has been - removed (see #565 on github) and previously was: - - @code - static_assert( check::const_valid || !check::exists, - "cereal detected an invalid serialization type parameter in non-member " #test_name ". " - #test_name " non-member functions must accept their serialization type by non-const reference" ); - @endcode - - See #132, #436, #263, and #565 on https://github.com/USCiLab/cereal for more details. - - @param test_name The name to give the test (e.g. load_minimal or versioned_load_minimal) - @param save_name The corresponding name the save test would have (e.g. save_minimal or versioned_save_minimal) - @param versioned Either blank or the macro CEREAL_MAKE_VERSIONED_TEST */ - #define CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(test_name, save_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_non_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ - std::declval(), std::declval(), AnyConvert() versioned ), yes() ); \ - template static no test( ... ); \ - static const bool exists = std::is_same( 0 ) ), yes>::value; \ - \ - template \ - static auto test2(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ - std::declval(), std::declval(), NoConvertConstRef() versioned ), yes() ); \ - template static no test2( ... ); \ - static const bool valid = std::is_same( 0 ) ), yes>::value; \ - \ - template \ - static auto test3(int) -> decltype( CEREAL_LOAD_MINIMAL_FUNCTION_NAME( \ - std::declval(), NoConvertRef(), AnyConvert() versioned ), yes() ); \ - template static no test3( ... ); \ - static const bool const_valid = std::is_same( 0 ) ), yes>::value; \ - }; \ - \ - template \ - struct has_non_member_##test_name##_wrapper : std::false_type {}; \ - \ - template \ - struct has_non_member_##test_name##_wrapper \ - { \ - using AOut = typename detail::get_output_from_input::type; \ - \ - static_assert( detail::has_non_member_##save_name##_impl::valid, \ - "cereal detected non-member " #test_name " but no valid non-member " #save_name ". \n " \ - "cannot evaluate correctness of " #test_name " without valid " #save_name "." ); \ - \ - using SaveType = typename detail::get_non_member_##save_name##_type::type; \ - using check = has_non_member_##test_name##_impl; \ - static const bool value = check::exists; \ - \ - static_assert( check::valid || !check::exists, "cereal detected different types in corresponding non-member " \ - #test_name " and " #save_name " functions. \n " \ - "the paramater to " #test_name " must be a constant reference to the type that " #save_name " returns." ); \ - }; \ - } /* namespace detail */ \ - \ - template \ - struct has_non_member_##test_name : std::integral_constant::exists>::value> {}; - - // ###################################################################### - // Non-Member Load Minimal - CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(load_minimal, save_minimal, ) - - // ###################################################################### - // Non-Member Load Minimal (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST(versioned_load_minimal, versioned_save_minimal, CEREAL_MAKE_VERSIONED_TEST) - - // ###################################################################### - #undef CEREAL_MAKE_HAS_NON_MEMBER_LOAD_MINIMAL_TEST - - // ###################################################################### - namespace detail - { - // const stripped away before reaching here, prevents errors on conversion from - // construct to construct - template - struct has_member_load_and_construct_impl : std::integral_constant( std::declval(), std::declval< ::cereal::construct&>() ) ), void>::value> - { }; - - template - struct has_member_versioned_load_and_construct_impl : std::integral_constant( std::declval(), std::declval< ::cereal::construct&>(), 0 ) ), void>::value> - { }; - } // namespace detail - - //! Member load and construct check - template - struct has_member_load_and_construct : detail::has_member_load_and_construct_impl::type, A> - { }; - - //! Member load and construct check (versioned) - template - struct has_member_versioned_load_and_construct : detail::has_member_versioned_load_and_construct_impl::type, A> - { }; - - // ###################################################################### - //! Creates a test for whether a non-member load_and_construct specialization exists - /*! This creates a class derived from std::integral_constant that will be true if - the type has the proper non-member function for the given archive. */ - #define CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(test_name, versioned) \ - namespace detail \ - { \ - template \ - struct has_non_member_##test_name##_impl \ - { \ - template \ - static auto test(int) -> decltype( LoadAndConstruct::load_and_construct( \ - std::declval(), std::declval< ::cereal::construct&>() versioned ), yes()); \ - template \ - static no test( ... ); \ - static const bool value = std::is_same( 0 ) ), yes>::value; \ - }; \ - } /* end namespace detail */ \ - template \ - struct has_non_member_##test_name : \ - std::integral_constant::type, A>::value> {}; - - // ###################################################################### - //! Non member load and construct check - CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(load_and_construct, ) - - // ###################################################################### - //! Non member load and construct check (versioned) - CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST(versioned_load_and_construct, CEREAL_MAKE_VERSIONED_TEST) - - // ###################################################################### - //! Has either a member or non member load and construct - template - struct has_load_and_construct : std::integral_constant::value || has_non_member_load_and_construct::value || - has_member_versioned_load_and_construct::value || has_non_member_versioned_load_and_construct::value> - { }; - - // ###################################################################### - #undef CEREAL_MAKE_HAS_NON_MEMBER_LOAD_AND_CONSTRUCT_TEST - - // ###################################################################### - // End of serialization existence tests - #undef CEREAL_MAKE_VERSIONED_TEST - - // ###################################################################### - template - struct has_member_split : std::integral_constant::value && has_member_save::value) || - (has_member_versioned_load::value && has_member_versioned_save::value)> {}; - - // ###################################################################### - template - struct has_non_member_split : std::integral_constant::value && has_non_member_save::value) || - (has_non_member_versioned_load::value && has_non_member_versioned_save::value)> {}; - - // ###################################################################### - template - struct has_invalid_output_versioning : std::integral_constant::value && has_member_save::value) || - (has_non_member_versioned_save::value && has_non_member_save::value) || - (has_member_versioned_serialize::value && has_member_serialize::value) || - (has_non_member_versioned_serialize::value && has_non_member_serialize::value) || - (has_member_versioned_save_minimal::value && has_member_save_minimal::value) || - (has_non_member_versioned_save_minimal::value && has_non_member_save_minimal::value)> {}; - - // ###################################################################### - template - struct has_invalid_input_versioning : std::integral_constant::value && has_member_load::value) || - (has_non_member_versioned_load::value && has_non_member_load::value) || - (has_member_versioned_serialize::value && has_member_serialize::value) || - (has_non_member_versioned_serialize::value && has_non_member_serialize::value) || - (has_member_versioned_load_minimal::value && has_member_load_minimal::value) || - (has_non_member_versioned_load_minimal::value && has_non_member_load_minimal::value)> {}; - - // ###################################################################### - namespace detail - { - //! Create a test for a cereal::specialization entry - #define CEREAL_MAKE_IS_SPECIALIZED_IMPL(name) \ - template \ - struct is_specialized_##name : std::integral_constant>::value> {} - - CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_serialize); - CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_load_save); - CEREAL_MAKE_IS_SPECIALIZED_IMPL(member_load_save_minimal); - CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_serialize); - CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_load_save); - CEREAL_MAKE_IS_SPECIALIZED_IMPL(non_member_load_save_minimal); - - #undef CEREAL_MAKE_IS_SPECIALIZED_IMPL - - //! Number of specializations detected - template - struct count_specializations : std::integral_constant::value + - is_specialized_member_load_save::value + - is_specialized_member_load_save_minimal::value + - is_specialized_non_member_serialize::value + - is_specialized_non_member_load_save::value + - is_specialized_non_member_load_save_minimal::value> {}; - } // namespace detail - - //! Check if any specialization exists for a type - template - struct is_specialized : std::integral_constant::value || - detail::is_specialized_member_load_save::value || - detail::is_specialized_member_load_save_minimal::value || - detail::is_specialized_non_member_serialize::value || - detail::is_specialized_non_member_load_save::value || - detail::is_specialized_non_member_load_save_minimal::value> - { - static_assert(detail::count_specializations::value <= 1, "More than one explicit specialization detected for type."); - }; - - //! Create the static assertion for some specialization - /*! This assertion will fail if the type is indeed specialized and does not have the appropriate - type of serialization functions */ - #define CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, print_name, spec_name) \ - static_assert( (is_specialized::value && detail::is_specialized_##spec_name::value && \ - (has_##name::value || has_##versioned_name::value)) \ - || !(is_specialized::value && detail::is_specialized_##spec_name::value), \ - "cereal detected " #print_name " specialization but no " #print_name " serialize function" ) - - //! Generates a test for specialization for versioned and unversioned functions - /*! This creates checks that can be queried to see if a given type of serialization function - has been specialized for this type */ - #define CEREAL_MAKE_IS_SPECIALIZED(name, versioned_name, spec_name) \ - template \ - struct is_specialized_##name : std::integral_constant::value && detail::is_specialized_##spec_name::value> \ - { CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, name, spec_name); }; \ - template \ - struct is_specialized_##versioned_name : std::integral_constant::value && detail::is_specialized_##spec_name::value> \ - { CEREAL_MAKE_IS_SPECIALIZED_ASSERT(name, versioned_name, versioned_name, spec_name); } - - CEREAL_MAKE_IS_SPECIALIZED(member_serialize, member_versioned_serialize, member_serialize); - CEREAL_MAKE_IS_SPECIALIZED(non_member_serialize, non_member_versioned_serialize, non_member_serialize); - - CEREAL_MAKE_IS_SPECIALIZED(member_save, member_versioned_save, member_load_save); - CEREAL_MAKE_IS_SPECIALIZED(non_member_save, non_member_versioned_save, non_member_load_save); - CEREAL_MAKE_IS_SPECIALIZED(member_load, member_versioned_load, member_load_save); - CEREAL_MAKE_IS_SPECIALIZED(non_member_load, non_member_versioned_load, non_member_load_save); - - CEREAL_MAKE_IS_SPECIALIZED(member_save_minimal, member_versioned_save_minimal, member_load_save_minimal); - CEREAL_MAKE_IS_SPECIALIZED(non_member_save_minimal, non_member_versioned_save_minimal, non_member_load_save_minimal); - CEREAL_MAKE_IS_SPECIALIZED(member_load_minimal, member_versioned_load_minimal, member_load_save_minimal); - CEREAL_MAKE_IS_SPECIALIZED(non_member_load_minimal, non_member_versioned_load_minimal, non_member_load_save_minimal); - - #undef CEREAL_MAKE_IS_SPECIALIZED_ASSERT - #undef CEREAL_MAKE_IS_SPECIALIZED - - // ###################################################################### - // detects if a type has any active minimal output serialization - template - struct has_minimal_output_serialization : std::integral_constant::value || - ((has_member_save_minimal::value || - has_non_member_save_minimal::value || - has_member_versioned_save_minimal::value || - has_non_member_versioned_save_minimal::value) && - !(is_specialized_member_serialize::value || - is_specialized_member_save::value))> {}; - - // ###################################################################### - // detects if a type has any active minimal input serialization - template - struct has_minimal_input_serialization : std::integral_constant::value || - ((has_member_load_minimal::value || - has_non_member_load_minimal::value || - has_member_versioned_load_minimal::value || - has_non_member_versioned_load_minimal::value) && - !(is_specialized_member_serialize::value || - is_specialized_member_load::value))> {}; - - // ###################################################################### - namespace detail - { - //! The number of output serialization functions available - /*! If specialization is being used, we'll count only those; otherwise we'll count everything */ - template - struct count_output_serializers : std::integral_constant::value ? count_specializations::value : - has_member_save::value + - has_non_member_save::value + - has_member_serialize::value + - has_non_member_serialize::value + - has_member_save_minimal::value + - has_non_member_save_minimal::value + - /*-versioned---------------------------------------------------------*/ - has_member_versioned_save::value + - has_non_member_versioned_save::value + - has_member_versioned_serialize::value + - has_non_member_versioned_serialize::value + - has_member_versioned_save_minimal::value + - has_non_member_versioned_save_minimal::value> {}; - } - - template - struct is_output_serializable : std::integral_constant::value == 1> {}; - - // ###################################################################### - namespace detail - { - //! The number of input serialization functions available - /*! If specialization is being used, we'll count only those; otherwise we'll count everything */ - template - struct count_input_serializers : std::integral_constant::value ? count_specializations::value : - has_member_load::value + - has_non_member_load::value + - has_member_serialize::value + - has_non_member_serialize::value + - has_member_load_minimal::value + - has_non_member_load_minimal::value + - /*-versioned---------------------------------------------------------*/ - has_member_versioned_load::value + - has_non_member_versioned_load::value + - has_member_versioned_serialize::value + - has_non_member_versioned_serialize::value + - has_member_versioned_load_minimal::value + - has_non_member_versioned_load_minimal::value> {}; - } - - template - struct is_input_serializable : std::integral_constant::value == 1> {}; - - // ###################################################################### - // Base Class Support - namespace detail - { - struct base_class_id - { - template - base_class_id(T const * const t) : - type(typeid(T)), - ptr(t), - hash(std::hash()(typeid(T)) ^ (std::hash()(t) << 1)) - { } - - bool operator==(base_class_id const & other) const - { return (type == other.type) && (ptr == other.ptr); } - - std::type_index type; - void const * ptr; - size_t hash; - }; - struct base_class_id_hash { size_t operator()(base_class_id const & id) const { return id.hash; } }; - } // namespace detail - - namespace detail - { - //! Common base type for base class casting - struct BaseCastBase {}; - - template - struct get_base_class; - - template class Cast, class Base> - struct get_base_class> - { - using type = Base; - }; - - //! Base class cast, behave as the test - template class Test, class Archive, - bool IsBaseCast = std::is_base_of::value> - struct has_minimal_base_class_serialization_impl : Test::type, Archive> - { }; - - //! Not a base class cast - template class Test, class Archive> - struct has_minimal_base_class_serialization_impl : std::false_type - { }; - } - - //! Checks to see if the base class used in a cast has a minimal serialization - /*! @tparam Cast Either base_class or virtual_base_class wrapped type - @tparam Test A has_minimal test (for either input or output) - @tparam Archive The archive to use with the test */ - template class Test, class Archive> - struct has_minimal_base_class_serialization : detail::has_minimal_base_class_serialization_impl - { }; - - - // ###################################################################### - namespace detail - { - struct shared_from_this_wrapper - { - template - static auto (check)( U const & t ) -> decltype( ::cereal::access::shared_from_this(t), std::true_type() ); - - static auto (check)( ... ) -> decltype( std::false_type() ); - - template - static auto get( U const & t ) -> decltype( t.shared_from_this() ); - }; - } - - //! Determine if T or any base class of T has inherited from std::enable_shared_from_this - template - struct has_shared_from_this : decltype((detail::shared_from_this_wrapper::check)(std::declval())) - { }; - - //! Get the type of the base class of T which inherited from std::enable_shared_from_this - template - struct get_shared_from_this_base - { - private: - using PtrType = decltype(detail::shared_from_this_wrapper::get(std::declval())); - public: - //! The type of the base of T that inherited from std::enable_shared_from_this - using type = typename std::decay::type; - }; - - // ###################################################################### - //! Extracts the true type from something possibly wrapped in a cereal NoConvert - /*! Internally cereal uses some wrapper classes to test the validity of non-member - minimal load and save functions. This can interfere with user type traits on - templated load and save minimal functions. To get to the correct underlying type, - users should use strip_minimal when performing any enable_if type type trait checks. - - See the enum serialization in types/common.hpp for an example of using this */ - template ::value> - struct strip_minimal - { - using type = T; - }; - - //! Specialization for types wrapped in a NoConvert - template - struct strip_minimal - { - using type = typename T::type; - }; - - // ###################################################################### - //! Determines whether the class T can be default constructed by cereal::access - template - struct is_default_constructible - { - #ifdef CEREAL_OLDER_GCC - template - struct test : no {}; - template - struct test() ) >::type> : yes {}; - static const bool value = test(); - #else // NOT CEREAL_OLDER_GCC ========================================= - template - static auto test(int) -> decltype( cereal::access::construct(), yes()); - template - static no test(...); - static const bool value = std::is_same(0)), yes>::value; - #endif // NOT CEREAL_OLDER_GCC - }; - - // ###################################################################### - namespace detail - { - //! Removes all qualifiers and minimal wrappers from an archive - template - using decay_archive = typename std::decay::type>::type; - } - - //! Checks if the provided archive type is equal to some cereal archive type - /*! This automatically does things such as std::decay and removing any other wrappers that may be - on the Archive template parameter. - - Example use: - @code{cpp} - // example use to disable a serialization function - template ::value> = sfinae> - void save( Archive & ar, MyType const & mt ); - @endcode */ - template - struct is_same_archive : std::integral_constant, CerealArchiveT>::value> - { }; - - // ###################################################################### - //! A macro to use to restrict which types of archives your function will work for. - /*! This requires you to have a template class parameter named Archive and replaces the void return - type for your function. - - INTYPE refers to the input archive type you wish to restrict on. - OUTTYPE refers to the output archive type you wish to restrict on. - - For example, if we want to limit a serialize to only work with binary serialization: - - @code{.cpp} - template - CEREAL_ARCHIVE_RESTRICT(BinaryInputArchive, BinaryOutputArchive) - serialize( Archive & ar, MyCoolType & m ) - { - ar & m; - } - @endcode - - If you need to do more restrictions in your enable_if, you will need to do this by hand. - */ - #define CEREAL_ARCHIVE_RESTRICT(INTYPE, OUTTYPE) \ - typename std::enable_if::value || cereal::traits::is_same_archive::value, void>::type - - //! Type traits only struct used to mark an archive as human readable (text based) - /*! Archives that wish to identify as text based/human readable should inherit from - this struct */ - struct TextArchive {}; - - //! Checks if an archive is a text archive (human readable) - template - struct is_text_archive : std::integral_constant>::value> - { }; - } // namespace traits - - // ###################################################################### - namespace detail - { - template ::value, - bool MemberVersioned = traits::has_member_versioned_load_and_construct::value, - bool NonMember = traits::has_non_member_load_and_construct::value, - bool NonMemberVersioned = traits::has_non_member_versioned_load_and_construct::value> - struct Construct - { - static_assert( cereal::traits::detail::delay_static_assert::value, - "cereal found more than one compatible load_and_construct function for the provided type and archive combination. \n\n " - "Types must either have a member load_and_construct function or a non-member specialization of LoadAndConstruct (you may not mix these). \n " - "In addition, you may not mix versioned with non-versioned load_and_construct functions. \n\n " ); - static T * load_andor_construct( A & /*ar*/, construct & /*construct*/ ) - { return nullptr; } - }; - - // no load and construct case - template - struct Construct - { - static_assert( ::cereal::traits::is_default_constructible::value, - "Trying to serialize a an object with no default constructor. \n\n " - "Types must either be default constructible or define either a member or non member Construct function. \n " - "Construct functions generally have the signature: \n\n " - "template \n " - "static void load_and_construct(Archive & ar, cereal::construct & construct) \n " - "{ \n " - " var a; \n " - " ar( a ) \n " - " construct( a ); \n " - "} \n\n" ); - static T * load_andor_construct() - { return ::cereal::access::construct(); } - }; - - // member non-versioned - template - struct Construct - { - static void load_andor_construct( A & ar, construct & construct ) - { - access::load_and_construct( ar, construct ); - } - }; - - // member versioned - template - struct Construct - { - static void load_andor_construct( A & ar, construct & construct ) - { - const auto version = ar.template loadClassVersion(); - access::load_and_construct( ar, construct, version ); - } - }; - - // non-member non-versioned - template - struct Construct - { - static void load_andor_construct( A & ar, construct & construct ) - { - LoadAndConstruct::load_and_construct( ar, construct ); - } - }; - - // non-member versioned - template - struct Construct - { - static void load_andor_construct( A & ar, construct & construct ) - { - const auto version = ar.template loadClassVersion(); - LoadAndConstruct::load_and_construct( ar, construct, version ); - } - }; - } // namespace detail -} // namespace cereal - -#endif // CEREAL_DETAILS_TRAITS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/details/util.hpp b/cpp/src/cylon/thridparty/cereal/details/util.hpp deleted file mode 100644 index e4aebe91c..000000000 --- a/cpp/src/cylon/thridparty/cereal/details/util.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*! \file util.hpp - \brief Internal misc utilities - \ingroup Internal */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_DETAILS_UTIL_HPP_ -#define CEREAL_DETAILS_UTIL_HPP_ - -#include -#include - -#ifdef _MSC_VER -namespace cereal -{ - namespace util - { - //! Demangles the type encoded in a string - /*! @internal */ - inline std::string demangle( std::string const & name ) - { return name; } - - //! Gets the demangled name of a type - /*! @internal */ - template inline - std::string demangledName() - { return typeid( T ).name(); } - } // namespace util -} // namespace cereal -#else // clang or gcc -#include -#include -namespace cereal -{ - namespace util - { - //! Demangles the type encoded in a string - /*! @internal */ - inline std::string demangle(std::string mangledName) - { - int status = 0; - char *demangledName = nullptr; - std::size_t len; - - demangledName = abi::__cxa_demangle(mangledName.c_str(), 0, &len, &status); - - std::string retName(demangledName); - free(demangledName); - - return retName; - } - - //! Gets the demangled name of a type - /*! @internal */ - template inline - std::string demangledName() - { return demangle(typeid(T).name()); } - } -} // namespace cereal -#endif // clang or gcc branch of _MSC_VER -#endif // CEREAL_DETAILS_UTIL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/external/LICENSE b/cpp/src/cylon/thridparty/cereal/external/LICENSE deleted file mode 100644 index 66300b68b..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (C) 2004-2008 René Nyffenegger - -This source code is provided 'as-is', without any express or implied -warranty. In no event will the author be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this source code must not be misrepresented; you must not - claim that you wrote the original source code. If you use this source code - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original source code. - -3. This notice may not be removed or altered from any source distribution. - -René Nyffenegger rene.nyffenegger@adp-gmbh.ch diff --git a/cpp/src/cylon/thridparty/cereal/external/base64.hpp b/cpp/src/cylon/thridparty/cereal/external/base64.hpp deleted file mode 100644 index ce32324f6..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/base64.hpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright (C) 2004-2008 René Nyffenegger - - This source code is provided 'as-is', without any express or implied - warranty. In no event will the author be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this source code must not be misrepresented; you must not - claim that you wrote the original source code. If you use this source code - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original source code. - - 3. This notice may not be removed or altered from any source distribution. - - René Nyffenegger rene.nyffenegger@adp-gmbh.ch -*/ - -#ifndef CEREAL_EXTERNAL_BASE64_HPP_ -#define CEREAL_EXTERNAL_BASE64_HPP_ - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - -#include - -namespace cereal -{ - namespace base64 - { - static const std::string chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - - static inline bool is_base64(unsigned char c) { - return (isalnum(c) || (c == '+') || (c == '/')); - } - - inline std::string encode(unsigned char const* bytes_to_encode, size_t in_len) { - std::string ret; - int i = 0; - int j = 0; - unsigned char char_array_3[3]; - unsigned char char_array_4[4]; - - while (in_len--) { - char_array_3[i++] = *(bytes_to_encode++); - if (i == 3) { - char_array_4[0] = static_cast((char_array_3[0] & 0xfc) >> 2); - char_array_4[1] = static_cast( ( ( char_array_3[0] & 0x03 ) << 4 ) + ( ( char_array_3[1] & 0xf0 ) >> 4 ) ); - char_array_4[2] = static_cast( ( ( char_array_3[1] & 0x0f ) << 2 ) + ( ( char_array_3[2] & 0xc0 ) >> 6 ) ); - char_array_4[3] = static_cast( char_array_3[2] & 0x3f ); - - for(i = 0; (i <4) ; i++) - ret += chars[char_array_4[i]]; - i = 0; - } - } - - if (i) - { - for(j = i; j < 3; j++) - char_array_3[j] = '\0'; - - char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for (j = 0; (j < i + 1); j++) - ret += chars[char_array_4[j]]; - - while((i++ < 3)) - ret += '='; - } - - return ret; - } - - inline std::string decode(std::string const& encoded_string) { - size_t in_len = encoded_string.size(); - size_t i = 0; - size_t j = 0; - int in_ = 0; - unsigned char char_array_4[4], char_array_3[3]; - std::string ret; - - while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { - char_array_4[i++] = encoded_string[in_]; in_++; - if (i ==4) { - for (i = 0; i <4; i++) - char_array_4[i] = static_cast(chars.find( char_array_4[i] )); - - char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); - char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); - char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; - - for (i = 0; (i < 3); i++) - ret += char_array_3[i]; - i = 0; - } - } - - if (i) { - for (j = i; j <4; j++) - char_array_4[j] = 0; - - for (j = 0; j <4; j++) - char_array_4[j] = static_cast(chars.find( char_array_4[j] )); - - char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); - char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); - char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; - - for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; - } - - return ret; - } - } // namespace base64 -} // namespace cereal -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#endif // CEREAL_EXTERNAL_BASE64_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE b/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE deleted file mode 100644 index 4546f15a2..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Tencent is pleased to support the open source community by making RapidJSON available. - -Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. - -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at - -http://opensource.org/licenses/MIT - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h deleted file mode 100644 index d375e28a1..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/allocators.h +++ /dev/null @@ -1,284 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ALLOCATORS_H_ -#define CEREAL_RAPIDJSON_ALLOCATORS_H_ - -#include "rapidjson.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Allocator - -/*! \class rapidjson::Allocator - \brief Concept for allocating, resizing and freeing memory block. - - Note that Malloc() and Realloc() are non-static but Free() is static. - - So if an allocator need to support Free(), it needs to put its pointer in - the header of memory block. - -\code -concept Allocator { - static const bool kNeedFree; //!< Whether this allocator needs to call Free(). - - // Allocate a memory block. - // \param size of the memory block in bytes. - // \returns pointer to the memory block. - void* Malloc(size_t size); - - // Resize a memory block. - // \param originalPtr The pointer to current memory block. Null pointer is permitted. - // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) - // \param newSize the new size in bytes. - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); - - // Free a memory block. - // \param pointer to the memory block. Null pointer is permitted. - static void Free(void *ptr); -}; -\endcode -*/ - - -/*! \def CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief User-defined kDefaultChunkCapacity definition. - - User can define this as any \c size that is a power of 2. -*/ - -#ifndef CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY -#define CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024) -#endif - - -/////////////////////////////////////////////////////////////////////////////// -// CrtAllocator - -//! C-runtime library allocator. -/*! This class is just wrapper for standard C library memory routines. - \note implements Allocator concept -*/ -class CrtAllocator { -public: - static const bool kNeedFree = true; - void* Malloc(size_t size) { - if (size) // behavior of malloc(0) is implementation defined. - return std::malloc(size); - else - return NULL; // standardize to returning NULL. - } - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - (void)originalSize; - if (newSize == 0) { - std::free(originalPtr); - return NULL; - } - return std::realloc(originalPtr, newSize); - } - static void Free(void *ptr) { std::free(ptr); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// MemoryPoolAllocator - -//! Default memory allocator used by the parser and DOM. -/*! This allocator allocate memory blocks from pre-allocated memory chunks. - - It does not free memory blocks. And Realloc() only allocate new memory. - - The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. - - User may also supply a buffer as the first chunk. - - If the user-buffer is full then additional chunks are allocated by BaseAllocator. - - The user-buffer is not deallocated by this allocator. - - \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. - \note implements Allocator concept -*/ -template -class MemoryPoolAllocator { -public: - static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) - - //! Constructor with chunkSize. - /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0) - { - } - - //! Constructor with user-supplied buffer. - /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. - - The user buffer will not be deallocated when this allocator is destructed. - - \param buffer User supplied buffer. - \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). - \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0) - { - CEREAL_RAPIDJSON_ASSERT(buffer != 0); - CEREAL_RAPIDJSON_ASSERT(size > sizeof(ChunkHeader)); - chunkHead_ = reinterpret_cast(buffer); - chunkHead_->capacity = size - sizeof(ChunkHeader); - chunkHead_->size = 0; - chunkHead_->next = 0; - } - - //! Destructor. - /*! This deallocates all memory chunks, excluding the user-supplied buffer. - */ - ~MemoryPoolAllocator() { - Clear(); - CEREAL_RAPIDJSON_DELETE(ownBaseAllocator_); - } - - //! Deallocates all memory chunks, excluding the user-supplied buffer. - void Clear() { - while (chunkHead_ && chunkHead_ != userBuffer_) { - ChunkHeader* next = chunkHead_->next; - baseAllocator_->Free(chunkHead_); - chunkHead_ = next; - } - if (chunkHead_ && chunkHead_ == userBuffer_) - chunkHead_->size = 0; // Clear user buffer - } - - //! Computes the total capacity of allocated memory chunks. - /*! \return total capacity in bytes. - */ - size_t Capacity() const { - size_t capacity = 0; - for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) - capacity += c->capacity; - return capacity; - } - - //! Computes the memory blocks allocated. - /*! \return total used bytes. - */ - size_t Size() const { - size_t size = 0; - for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) - size += c->size; - return size; - } - - //! Allocates a memory block. (concept Allocator) - void* Malloc(size_t size) { - if (!size) - return NULL; - - size = CEREAL_RAPIDJSON_ALIGN(size); - if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity) - if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size)) - return NULL; - - void *buffer = reinterpret_cast(chunkHead_) + CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size; - chunkHead_->size += size; - return buffer; - } - - //! Resizes a memory block (concept Allocator) - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - if (originalPtr == 0) - return Malloc(newSize); - - if (newSize == 0) - return NULL; - - originalSize = CEREAL_RAPIDJSON_ALIGN(originalSize); - newSize = CEREAL_RAPIDJSON_ALIGN(newSize); - - // Do not shrink if new size is smaller than original - if (originalSize >= newSize) - return originalPtr; - - // Simply expand it if it is the last allocation and there is sufficient space - if (originalPtr == reinterpret_cast(chunkHead_) + CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size - originalSize) { - size_t increment = static_cast(newSize - originalSize); - if (chunkHead_->size + increment <= chunkHead_->capacity) { - chunkHead_->size += increment; - return originalPtr; - } - } - - // Realloc process: allocate and copy memory, do not free original buffer. - if (void* newBuffer = Malloc(newSize)) { - if (originalSize) - std::memcpy(newBuffer, originalPtr, originalSize); - return newBuffer; - } - else - return NULL; - } - - //! Frees a memory block (concept Allocator) - static void Free(void *ptr) { (void)ptr; } // Do nothing - -private: - //! Copy constructor is not permitted. - MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */; - //! Copy assignment operator is not permitted. - MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */; - - //! Creates a new chunk. - /*! \param capacity Capacity of the chunk in bytes. - \return true if success. - */ - bool AddChunk(size_t capacity) { - if (!baseAllocator_) - ownBaseAllocator_ = baseAllocator_ = CEREAL_RAPIDJSON_NEW(BaseAllocator)(); - if (ChunkHeader* chunk = reinterpret_cast(baseAllocator_->Malloc(CEREAL_RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity))) { - chunk->capacity = capacity; - chunk->size = 0; - chunk->next = chunkHead_; - chunkHead_ = chunk; - return true; - } - else - return false; - } - - static const int kDefaultChunkCapacity = CEREAL_RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity. - - //! Chunk header for perpending to each chunk. - /*! Chunks are stored as a singly linked list. - */ - struct ChunkHeader { - size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). - size_t size; //!< Current size of allocated memory in bytes. - ChunkHeader *next; //!< Next chunk in the linked list. - }; - - ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation. - size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. - void *userBuffer_; //!< User supplied buffer. - BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. - BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object. -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_ENCODINGS_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h deleted file mode 100644 index f3d20f7f3..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/cursorstreamwrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ -#define CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ - -#include "stream.h" - -#if defined(__GNUC__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code -CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - - -//! Cursor stream wrapper for counting line and column number if error exists. -/*! - \tparam InputStream Any stream that implements Stream Concept -*/ -template > -class CursorStreamWrapper : public GenericStreamWrapper { -public: - typedef typename Encoding::Ch Ch; - - CursorStreamWrapper(InputStream& is): - GenericStreamWrapper(is), line_(1), col_(0) {} - - // counting line and column number - Ch Take() { - Ch ch = this->is_.Take(); - if(ch == '\n') { - line_ ++; - col_ = 0; - } else { - col_ ++; - } - return ch; - } - - //! Get the error line number, if error exists. - size_t GetLine() const { return line_; } - //! Get the error column number, if error exists. - size_t GetColumn() const { return col_; } - -private: - size_t line_; //!< Current Line - size_t col_; //!< Current Column -}; - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#if defined(__GNUC__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h deleted file mode 100644 index 91c4be80f..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/document.h +++ /dev/null @@ -1,2659 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_DOCUMENT_H_ -#define CEREAL_RAPIDJSON_DOCUMENT_H_ - -/*! \file document.h */ - -#include "reader.h" -#include "internal/meta.h" -#include "internal/strfunc.h" -#include "memorystream.h" -#include "encodedstream.h" -#include // placement new -#include -#ifdef __cpp_lib_three_way_comparison -#include -#endif - -CEREAL_RAPIDJSON_DIAG_PUSH -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_OFF(padded) -CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -CEREAL_RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif // __GNUC__ - -#ifndef CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS -#include // std::random_access_iterator_tag -#endif - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -// Forward declaration. -template -class GenericValue; - -template -class GenericDocument; - -//! Name-value pair in a JSON object value. -/*! - This class was internal to GenericValue. It used to be a inner struct. - But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. - https://code.google.com/p/rapidjson/issues/detail?id=64 -*/ -template -struct GenericMember { - GenericValue name; //!< name of member (must be a string) - GenericValue value; //!< value of member. - - // swap() for std::sort() and other potential use in STL. - friend inline void swap(GenericMember& a, GenericMember& b) CEREAL_RAPIDJSON_NOEXCEPT { - a.name.Swap(b.name); - a.value.Swap(b.value); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericMemberIterator - -#ifndef CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS - -//! (Constant) member iterator for a JSON object value -/*! - \tparam Const Is this a constant iterator? - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. - - This class implements a Random Access Iterator for GenericMember elements - of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. - - \note This iterator implementation is mainly intended to avoid implicit - conversions from iterator values to \c NULL, - e.g. from GenericValue::FindMember. - - \note Define \c CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a - pointer-based implementation, if your platform doesn't provide - the C++ header. - - \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator - */ -template -class GenericMemberIterator { - - friend class GenericValue; - template friend class GenericMemberIterator; - - typedef GenericMember PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - -public: - //! Iterator type itself - typedef GenericMemberIterator Iterator; - //! Constant iterator type - typedef GenericMemberIterator ConstIterator; - //! Non-constant iterator type - typedef GenericMemberIterator NonConstIterator; - - /** \name std::iterator_traits support */ - //@{ - typedef ValueType value_type; - typedef ValueType * pointer; - typedef ValueType & reference; - typedef std::ptrdiff_t difference_type; - typedef std::random_access_iterator_tag iterator_category; - //@} - - //! Pointer to (const) GenericMember - typedef pointer Pointer; - //! Reference to (const) GenericMember - typedef reference Reference; - //! Signed integer type (e.g. \c ptrdiff_t) - typedef difference_type DifferenceType; - - //! Default constructor (singular value) - /*! Creates an iterator pointing to no element. - \note All operations, except for comparisons, are undefined on such values. - */ - GenericMemberIterator() : ptr_() {} - - //! Iterator conversions to more const - /*! - \param it (Non-const) iterator to copy from - - Allows the creation of an iterator from another GenericMemberIterator - that is "less const". Especially, creating a non-constant iterator - from a constant iterator are disabled: - \li const -> non-const (not ok) - \li const -> const (ok) - \li non-const -> const (ok) - \li non-const -> non-const (ok) - - \note If the \c Const template parameter is already \c false, this - constructor effectively defines a regular copy-constructor. - Otherwise, the copy constructor is implicitly defined. - */ - GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} - Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; } - - //! @name stepping - //@{ - Iterator& operator++(){ ++ptr_; return *this; } - Iterator& operator--(){ --ptr_; return *this; } - Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } - Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } - //@} - - //! @name increment/decrement - //@{ - Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } - Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } - - Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } - Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } - //@} - - //! @name relations - //@{ - template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } - template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } - template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } - template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } - template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } - template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } - -#ifdef __cpp_lib_three_way_comparison - template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } -#endif - //@} - - //! @name dereference - //@{ - Reference operator*() const { return *ptr_; } - Pointer operator->() const { return ptr_; } - Reference operator[](DifferenceType n) const { return ptr_[n]; } - //@} - - //! Distance - DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } - -private: - //! Internal constructor from plain pointer - explicit GenericMemberIterator(Pointer p) : ptr_(p) {} - - Pointer ptr_; //!< raw pointer -}; - -#else // CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS - -// class-based member iterator implementation disabled, use plain pointers - -template -class GenericMemberIterator; - -//! non-const GenericMemberIterator -template -class GenericMemberIterator { - //! use plain pointer as iterator type - typedef GenericMember* Iterator; -}; -//! const GenericMemberIterator -template -class GenericMemberIterator { - //! use plain const pointer as iterator type - typedef const GenericMember* Iterator; -}; - -#endif // CEREAL_RAPIDJSON_NOMEMBERITERATORCLASS - -/////////////////////////////////////////////////////////////////////////////// -// GenericStringRef - -//! Reference to a constant string (not taking a copy) -/*! - \tparam CharType character type of the string - - This helper class is used to automatically infer constant string - references for string literals, especially from \c const \b (!) - character arrays. - - The main use is for creating JSON string values without copying the - source string via an \ref Allocator. This requires that the referenced - string pointers have a sufficient lifetime, which exceeds the lifetime - of the associated GenericValue. - - \b Example - \code - Value v("foo"); // ok, no need to copy & calculate length - const char foo[] = "foo"; - v.SetString(foo); // ok - - const char* bar = foo; - // Value x(bar); // not ok, can't rely on bar's lifetime - Value x(StringRef(bar)); // lifetime explicitly guaranteed by user - Value y(StringRef(bar, 3)); // ok, explicitly pass length - \endcode - - \see StringRef, GenericValue::SetString -*/ -template -struct GenericStringRef { - typedef CharType Ch; //!< character type of the string - - //! Create string reference from \c const character array -#ifndef __clang__ // -Wdocumentation - /*! - This constructor implicitly creates a constant string reference from - a \c const character array. It has better performance than - \ref StringRef(const CharType*) by inferring the string \ref length - from the array length, and also supports strings containing null - characters. - - \tparam N length of the string, automatically inferred - - \param str Constant character array, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note Constant complexity. - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ -#endif - template - GenericStringRef(const CharType (&str)[N]) CEREAL_RAPIDJSON_NOEXCEPT - : s(str), length(N-1) {} - - //! Explicitly create string reference from \c const character pointer -#ifndef __clang__ // -Wdocumentation - /*! - This constructor can be used to \b explicitly create a reference to - a constant string pointer. - - \see StringRef(const CharType*) - - \param str Constant character pointer, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ -#endif - explicit GenericStringRef(const CharType* str) - : s(str), length(NotNullStrLen(str)) {} - - //! Create constant string reference from pointer and length -#ifndef __clang__ // -Wdocumentation - /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param len length of the string, excluding the trailing NULL terminator - - \post \ref s == str && \ref length == len - \note Constant complexity. - */ -#endif - GenericStringRef(const CharType* str, SizeType len) - : s(CEREAL_RAPIDJSON_LIKELY(str) ? str : emptyString), length(len) { CEREAL_RAPIDJSON_ASSERT(str != 0 || len == 0u); } - - GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} - - //! implicit conversion to plain CharType pointer - operator const Ch *() const { return s; } - - const Ch* const s; //!< plain CharType pointer - const SizeType length; //!< length of the string (excluding the trailing NULL terminator) - -private: - SizeType NotNullStrLen(const CharType* str) { - CEREAL_RAPIDJSON_ASSERT(str != 0); - return internal::StrLen(str); - } - - /// Empty string - used when passing in a NULL pointer - static const Ch emptyString[]; - - //! Disallow construction from non-const array - template - GenericStringRef(CharType (&str)[N]) /* = delete */; - //! Copy assignment operator not permitted - immutable type - GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; -}; - -template -const CharType GenericStringRef::emptyString[] = { CharType() }; - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - \tparam CharType Character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - - \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember -*/ -template -inline GenericStringRef StringRef(const CharType* str) { - return GenericStringRef(str); -} - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - This version has better performance with supplied length, and also - supports string containing null characters. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param length The length of source string. - \return GenericStringRef string reference object - \relatesalso GenericStringRef -*/ -template -inline GenericStringRef StringRef(const CharType* str, size_t length) { - return GenericStringRef(str, SizeType(length)); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -//! Mark a string object as constant string -/*! Mark a string object (e.g. \c std::string) as a "string literal". - This function can be used to avoid copying a string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. -*/ -template -inline GenericStringRef StringRef(const std::basic_string& str) { - return GenericStringRef(str.data(), SizeType(str.size())); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue type traits -namespace internal { - -template -struct IsGenericValueImpl : FalseType {}; - -// select candidates according to nested encoding and allocator types -template struct IsGenericValueImpl::Type, typename Void::Type> - : IsBaseOf, T>::Type {}; - -// helper to match arbitrary GenericValue instantiations, including derived classes -template struct IsGenericValue : IsGenericValueImpl::Type {}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// TypeHelper - -namespace internal { - -template -struct TypeHelper {}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsBool(); } - static bool Get(const ValueType& v) { return v.GetBool(); } - static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); } - static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt(); } - static int Get(const ValueType& v) { return v.GetInt(); } - static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); } - static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint(); } - static unsigned Get(const ValueType& v) { return v.GetUint(); } - static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); } - static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); } -}; - -#ifdef _MSC_VER -CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int)); -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt(); } - static long Get(const ValueType& v) { return v.GetInt(); } - static ValueType& Set(ValueType& v, long data) { return v.SetInt(data); } - static ValueType& Set(ValueType& v, long data, typename ValueType::AllocatorType&) { return v.SetInt(data); } -}; - -CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned)); -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint(); } - static unsigned long Get(const ValueType& v) { return v.GetUint(); } - static ValueType& Set(ValueType& v, unsigned long data) { return v.SetUint(data); } - static ValueType& Set(ValueType& v, unsigned long data, typename ValueType::AllocatorType&) { return v.SetUint(data); } -}; -#endif - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt64(); } - static int64_t Get(const ValueType& v) { return v.GetInt64(); } - static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); } - static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint64(); } - static uint64_t Get(const ValueType& v) { return v.GetUint64(); } - static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); } - static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsDouble(); } - static double Get(const ValueType& v) { return v.GetDouble(); } - static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); } - static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsFloat(); } - static float Get(const ValueType& v) { return v.GetFloat(); } - static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); } - static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); } -}; - -template -struct TypeHelper { - typedef const typename ValueType::Ch* StringType; - static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return v.GetString(); } - static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); } - static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } -}; - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -struct TypeHelper > { - typedef std::basic_string StringType; - static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } - static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } -}; -#endif - -template -struct TypeHelper { - typedef typename ValueType::Array ArrayType; - static bool Is(const ValueType& v) { return v.IsArray(); } - static ArrayType Get(ValueType& v) { return v.GetArray(); } - static ValueType& Set(ValueType& v, ArrayType data) { return v = data; } - static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; } -}; - -template -struct TypeHelper { - typedef typename ValueType::ConstArray ArrayType; - static bool Is(const ValueType& v) { return v.IsArray(); } - static ArrayType Get(const ValueType& v) { return v.GetArray(); } -}; - -template -struct TypeHelper { - typedef typename ValueType::Object ObjectType; - static bool Is(const ValueType& v) { return v.IsObject(); } - static ObjectType Get(ValueType& v) { return v.GetObject(); } - static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } - static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } -}; - -template -struct TypeHelper { - typedef typename ValueType::ConstObject ObjectType; - static bool Is(const ValueType& v) { return v.IsObject(); } - static ObjectType Get(const ValueType& v) { return v.GetObject(); } -}; - -} // namespace internal - -// Forward declarations -template class GenericArray; -template class GenericObject; - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue - -//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. -/*! - A JSON value can be one of 7 types. This class is a variant type supporting - these types. - - Use the Value if UTF8 and default allocator - - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. -*/ -template > -class GenericValue { -public: - //! Name-value pair in an object. - typedef GenericMember Member; - typedef Encoding EncodingType; //!< Encoding type from template parameter. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericStringRef StringRefType; //!< Reference to a constant string - typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. - typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. - typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. - typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. - typedef GenericValue ValueType; //!< Value type of itself. - typedef GenericArray Array; - typedef GenericArray ConstArray; - typedef GenericObject Object; - typedef GenericObject ConstObject; - - //!@name Constructors and destructor. - //@{ - - //! Default constructor creates a null value. - GenericValue() CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericValue(GenericValue&& rhs) CEREAL_RAPIDJSON_NOEXCEPT : data_(rhs.data_) { - rhs.data_.f.flags = kNullFlag; // give up contents - } -#endif - -private: - //! Copy constructor is not permitted. - GenericValue(const GenericValue& rhs); - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Moving from a GenericDocument is not permitted. - template - GenericValue(GenericDocument&& rhs); - - //! Move assignment from a GenericDocument is not permitted. - template - GenericValue& operator=(GenericDocument&& rhs); -#endif - -public: - - //! Constructor with JSON value type. - /*! This creates a Value of specified type with default content. - \param type Type of the value. - \note Default content for number is zero. - */ - explicit GenericValue(Type type) CEREAL_RAPIDJSON_NOEXCEPT : data_() { - static const uint16_t defaultFlags[] = { - kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, - kNumberAnyFlag - }; - CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType); - data_.f.flags = defaultFlags[type]; - - // Use ShortString to store empty string. - if (type == kStringType) - data_.ss.SetLength(0); - } - - //! Explicit copy constructor (with allocator) - /*! Creates a copy of a Value by using the given Allocator - \tparam SourceAllocator allocator of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). - \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) - \see CopyFrom() - */ - template - GenericValue(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { - switch (rhs.GetType()) { - case kObjectType: { - SizeType count = rhs.data_.o.size; - Member* lm = reinterpret_cast(allocator.Malloc(count * sizeof(Member))); - const typename GenericValue::Member* rm = rhs.GetMembersPointer(); - for (SizeType i = 0; i < count; i++) { - new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings); - new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings); - } - data_.f.flags = kObjectFlag; - data_.o.size = data_.o.capacity = count; - SetMembersPointer(lm); - } - break; - case kArrayType: { - SizeType count = rhs.data_.a.size; - GenericValue* le = reinterpret_cast(allocator.Malloc(count * sizeof(GenericValue))); - const GenericValue* re = rhs.GetElementsPointer(); - for (SizeType i = 0; i < count; i++) - new (&le[i]) GenericValue(re[i], allocator, copyConstStrings); - data_.f.flags = kArrayFlag; - data_.a.size = data_.a.capacity = count; - SetElementsPointer(le); - } - break; - case kStringType: - if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) { - data_.f.flags = rhs.data_.f.flags; - data_ = *reinterpret_cast(&rhs.data_); - } - else - SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); - break; - default: - data_.f.flags = rhs.data_.f.flags; - data_ = *reinterpret_cast(&rhs.data_); - break; - } - } - - //! Constructor for boolean value. - /*! \param b Boolean value - \note This constructor is limited to \em real boolean values and rejects - implicitly converted types like arbitrary pointers. Use an explicit cast - to \c bool, if you want to construct a boolean JSON value in such cases. - */ -#ifndef CEREAL_RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen - template - explicit GenericValue(T b, CEREAL_RAPIDJSON_ENABLEIF((internal::IsSame))) CEREAL_RAPIDJSON_NOEXCEPT // See #472 -#else - explicit GenericValue(bool b) CEREAL_RAPIDJSON_NOEXCEPT -#endif - : data_() { - // safe-guard against failing SFINAE - CEREAL_RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); - data_.f.flags = b ? kTrueFlag : kFalseFlag; - } - - //! Constructor for int value. - explicit GenericValue(int i) CEREAL_RAPIDJSON_NOEXCEPT : data_() { - data_.n.i64 = i; - data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag; - } - - //! Constructor for unsigned value. - explicit GenericValue(unsigned u) CEREAL_RAPIDJSON_NOEXCEPT : data_() { - data_.n.u64 = u; - data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag); - } - - //! Constructor for int64_t value. - explicit GenericValue(int64_t i64) CEREAL_RAPIDJSON_NOEXCEPT : data_() { - data_.n.i64 = i64; - data_.f.flags = kNumberInt64Flag; - if (i64 >= 0) { - data_.f.flags |= kNumberUint64Flag; - if (!(static_cast(i64) & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - data_.f.flags |= kUintFlag; - if (!(static_cast(i64) & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - else if (i64 >= static_cast(CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - - //! Constructor for uint64_t value. - explicit GenericValue(uint64_t u64) CEREAL_RAPIDJSON_NOEXCEPT : data_() { - data_.n.u64 = u64; - data_.f.flags = kNumberUint64Flag; - if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) - data_.f.flags |= kInt64Flag; - if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - data_.f.flags |= kUintFlag; - if (!(u64 & CEREAL_RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - - //! Constructor for double value. - explicit GenericValue(double d) CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; } - - //! Constructor for float value. - explicit GenericValue(float f) CEREAL_RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast(f); data_.f.flags = kNumberDoubleFlag; } - - //! Constructor for constant string (i.e. do not make a copy of string) - GenericValue(const Ch* s, SizeType length) CEREAL_RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); } - - //! Constructor for constant string (i.e. do not make a copy of string) - explicit GenericValue(StringRefType s) CEREAL_RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Constructor for copy-string from a string object (i.e. do make a copy of string) - /*! \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. - */ - GenericValue(const std::basic_string& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } -#endif - - //! Constructor for Array. - /*! - \param a An array obtained by \c GetArray(). - \note \c Array is always pass-by-value. - \note the source array is moved into this value and the sourec array becomes empty. - */ - GenericValue(Array a) CEREAL_RAPIDJSON_NOEXCEPT : data_(a.value_.data_) { - a.value_.data_ = Data(); - a.value_.data_.f.flags = kArrayFlag; - } - - //! Constructor for Object. - /*! - \param o An object obtained by \c GetObject(). - \note \c Object is always pass-by-value. - \note the source object is moved into this value and the sourec object becomes empty. - */ - GenericValue(Object o) CEREAL_RAPIDJSON_NOEXCEPT : data_(o.value_.data_) { - o.value_.data_ = Data(); - o.value_.data_.f.flags = kObjectFlag; - } - - //! Destructor. - /*! Need to destruct elements of array, members of object, or copy-string. - */ - ~GenericValue() { - if (Allocator::kNeedFree) { // Shortcut by Allocator's trait - switch(data_.f.flags) { - case kArrayFlag: - { - GenericValue* e = GetElementsPointer(); - for (GenericValue* v = e; v != e + data_.a.size; ++v) - v->~GenericValue(); - Allocator::Free(e); - } - break; - - case kObjectFlag: - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - Allocator::Free(GetMembersPointer()); - break; - - case kCopyStringFlag: - Allocator::Free(const_cast(GetStringPointer())); - break; - - default: - break; // Do nothing for other types. - } - } - } - - //@} - - //!@name Assignment operators - //@{ - - //! Assignment with move semantics. - /*! \param rhs Source of the assignment. It will become a null value after assignment. - */ - GenericValue& operator=(GenericValue& rhs) CEREAL_RAPIDJSON_NOEXCEPT { - if (CEREAL_RAPIDJSON_LIKELY(this != &rhs)) { - this->~GenericValue(); - RawAssign(rhs); - } - return *this; - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericValue& operator=(GenericValue&& rhs) CEREAL_RAPIDJSON_NOEXCEPT { - return *this = rhs.Move(); - } -#endif - - //! Assignment of constant string reference (no copy) - /*! \param str Constant string reference to be assigned - \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. - \see GenericStringRef, operator=(T) - */ - GenericValue& operator=(StringRefType str) CEREAL_RAPIDJSON_NOEXCEPT { - GenericValue s(str); - return *this = s; - } - - //! Assignment with primitive types. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value The value to be assigned. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref SetString(const Ch*, Allocator&) (for copying) or - \ref StringRef() (to explicitly mark the pointer as constant) instead. - All other pointer types would implicitly convert to \c bool, - use \ref SetBool() instead. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) - operator=(T value) { - GenericValue v(value); - return *this = v; - } - - //! Deep-copy assignment from Value - /*! Assigns a \b copy of the Value to the current Value object - \tparam SourceAllocator Allocator type of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator to use for copying - \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) - */ - template - GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { - CEREAL_RAPIDJSON_ASSERT(static_cast(this) != static_cast(&rhs)); - this->~GenericValue(); - new (this) GenericValue(rhs, allocator, copyConstStrings); - return *this; - } - - //! Exchange the contents of this value with those of other. - /*! - \param other Another value. - \note Constant complexity. - */ - GenericValue& Swap(GenericValue& other) CEREAL_RAPIDJSON_NOEXCEPT { - GenericValue temp; - temp.RawAssign(*this); - RawAssign(other); - other.RawAssign(temp); - return *this; - } - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.value, b.value); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericValue& a, GenericValue& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //! Prepare Value for move semantics - /*! \return *this */ - GenericValue& Move() CEREAL_RAPIDJSON_NOEXCEPT { return *this; } - //@} - - //!@name Equal-to and not-equal-to operators - //@{ - //! Equal-to operator - /*! - \note If an object contains duplicated named member, comparing equality with any object is always \c false. - \note Complexity is quadratic in Object's member number and linear for the rest (number of all values in the subtree and total lengths of all strings). - */ - template - bool operator==(const GenericValue& rhs) const { - typedef GenericValue RhsType; - if (GetType() != rhs.GetType()) - return false; - - switch (GetType()) { - case kObjectType: // Warning: O(n^2) inner-loop - if (data_.o.size != rhs.data_.o.size) - return false; - for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { - typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); - if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) - return false; - } - return true; - - case kArrayType: - if (data_.a.size != rhs.data_.a.size) - return false; - for (SizeType i = 0; i < data_.a.size; i++) - if ((*this)[i] != rhs[i]) - return false; - return true; - - case kStringType: - return StringEqual(rhs); - - case kNumberType: - if (IsDouble() || rhs.IsDouble()) { - double a = GetDouble(); // May convert from integer to double. - double b = rhs.GetDouble(); // Ditto - return a >= b && a <= b; // Prevent -Wfloat-equal - } - else - return data_.n.u64 == rhs.data_.n.u64; - - default: - return true; - } - } - - //! Equal-to operator with const C-string pointer - bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Equal-to operator with string object - /*! \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. - */ - bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } -#endif - - //! Equal-to operator with primitive types - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false - */ - template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } - - //! Not-equal-to operator - /*! \return !(*this == rhs) - */ - template - bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with const C-string pointer - bool operator!=(const Ch* rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with arbitrary types - /*! \return !(*this == rhs) - */ - template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } - - //! Equal-to operator with arbitrary types (symmetric version) - /*! \return (rhs == lhs) - */ - template friend CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } - - //! Not-Equal-to operator with arbitrary types (symmetric version) - /*! \return !(rhs == lhs) - */ - template friend CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } - //@} - - //!@name Type - //@{ - - Type GetType() const { return static_cast(data_.f.flags & kTypeMask); } - bool IsNull() const { return data_.f.flags == kNullFlag; } - bool IsFalse() const { return data_.f.flags == kFalseFlag; } - bool IsTrue() const { return data_.f.flags == kTrueFlag; } - bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; } - bool IsObject() const { return data_.f.flags == kObjectFlag; } - bool IsArray() const { return data_.f.flags == kArrayFlag; } - bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; } - bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; } - bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; } - bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; } - bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; } - bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; } - bool IsString() const { return (data_.f.flags & kStringFlag) != 0; } - - // Checks whether a number can be losslessly converted to a double. - bool IsLosslessDouble() const { - if (!IsNumber()) return false; - if (IsUint64()) { - uint64_t u = GetUint64(); - volatile double d = static_cast(u); - return (d >= 0.0) - && (d < static_cast((std::numeric_limits::max)())) - && (u == static_cast(d)); - } - if (IsInt64()) { - int64_t i = GetInt64(); - volatile double d = static_cast(i); - return (d >= static_cast((std::numeric_limits::min)())) - && (d < static_cast((std::numeric_limits::max)())) - && (i == static_cast(d)); - } - return true; // double, int, uint are always lossless - } - - // Checks whether a number is a float (possible lossy). - bool IsFloat() const { - if ((data_.f.flags & kDoubleFlag) == 0) - return false; - double d = GetDouble(); - return d >= -3.4028234e38 && d <= 3.4028234e38; - } - // Checks whether a number can be losslessly converted to a float. - bool IsLosslessFloat() const { - if (!IsNumber()) return false; - double a = GetDouble(); - if (a < static_cast(-(std::numeric_limits::max)()) - || a > static_cast((std::numeric_limits::max)())) - return false; - double b = static_cast(static_cast(a)); - return a >= b && a <= b; // Prevent -Wfloat-equal - } - - //@} - - //!@name Null - //@{ - - GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } - - //@} - - //!@name Bool - //@{ - - bool GetBool() const { CEREAL_RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; } - //!< Set boolean value - /*! \post IsBool() == true */ - GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } - - //@} - - //!@name Object - //@{ - - //! Set this value as an empty object. - /*! \post IsObject() == true */ - GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } - - //! Get the number of members in the object. - SizeType MemberCount() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } - - //! Get the capacity of object. - SizeType MemberCapacity() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.capacity; } - - //! Check whether the object is empty. - bool ObjectEmpty() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) - \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. - Since 0.2, if the name is not correct, it will assert. - If user is unsure whether a member exists, user should use HasMember() first. - A better approach is to use FindMember(). - \note Linear time complexity. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { - GenericValue n(StringRef(name)); - return (*this)[n]; - } - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam SourceAllocator Allocator of the \c name value - - \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). - And it can also handle strings with embedded null characters. - - \note Linear time complexity. - */ - template - GenericValue& operator[](const GenericValue& name) { - MemberIterator member = FindMember(name); - if (member != MemberEnd()) - return member->value; - else { - CEREAL_RAPIDJSON_ASSERT(false); // see above note - - // This will generate -Wexit-time-destructors in clang - // static GenericValue NullValue; - // return NullValue; - - // Use static buffer and placement-new to prevent destruction - static char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); - } - } - template - const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Get a value from an object associated with name (string object). - GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } - const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } -#endif - - //! Const member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberBegin() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); } - //! Const \em past-the-end member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberEnd() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); } - //! Member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberBegin() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); } - //! \em Past-the-end member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberEnd() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); } - - //! Request the object to have enough capacity to store members. - /*! \param newCapacity The capacity that the object at least need to have. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note Linear time complexity. - */ - GenericValue& MemberReserve(SizeType newCapacity, Allocator &allocator) { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - if (newCapacity > data_.o.capacity) { - SetMembersPointer(reinterpret_cast(allocator.Realloc(GetMembersPointer(), data_.o.capacity * sizeof(Member), newCapacity * sizeof(Member)))); - data_.o.capacity = newCapacity; - } - return *this; - } - - //! Check whether a member exists in the object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Check whether a member exists in the object with string object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } -#endif - - //! Check whether a member exists in the object with GenericValue name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - template - bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } - - //! Find member by name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - MemberIterator FindMember(const Ch* name) { - GenericValue n(StringRef(name)); - return FindMember(n); - } - - ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } - - //! Find member by name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - template - MemberIterator FindMember(const GenericValue& name) { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - CEREAL_RAPIDJSON_ASSERT(name.IsString()); - MemberIterator member = MemberBegin(); - for ( ; member != MemberEnd(); ++member) - if (name.StringEqual(member->name)) - break; - return member; - } - template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Find member by string object name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - */ - MemberIterator FindMember(const std::basic_string& name) { return FindMember(GenericValue(StringRef(name))); } - ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(GenericValue(StringRef(name))); } -#endif - - //! Add a member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c name and \c value will be transferred to this object on success. - \pre IsObject() && name.IsString() - \post name.IsNull() && value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - CEREAL_RAPIDJSON_ASSERT(name.IsString()); - - ObjectData& o = data_.o; - if (o.size >= o.capacity) - MemberReserve(o.capacity == 0 ? kDefaultObjectCapacity : (o.capacity + (o.capacity + 1) / 2), allocator); - Member* members = GetMembersPointer(); - members[o.size].name.RawAssign(name); - members[o.size].value.RawAssign(value); - o.size++; - return *this; - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Add a string object as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { - GenericValue v(value, allocator); - return AddMember(name, v, allocator); - } -#endif - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A string value as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(GenericValue& name, T value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - - - //! Add a member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this object on success. - \pre IsObject() - \post value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A constant string reference as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(StringRefType name, T value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Remove all members in the object. - /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void RemoveAllMembers() { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - data_.o.size = 0; - } - - //! Remove a member in object by its name. - /*! \param name Name of member to be removed. - \return Whether the member existed. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Linear time complexity. - */ - bool RemoveMember(const Ch* name) { - GenericValue n(StringRef(name)); - return RemoveMember(n); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } -#endif - - template - bool RemoveMember(const GenericValue& name) { - MemberIterator m = FindMember(name); - if (m != MemberEnd()) { - RemoveMember(m); - return true; - } - else - return false; - } - - //! Remove a member in object by iterator. - /*! \param m member iterator (obtained by FindMember() or MemberBegin()). - \return the new iterator after removal. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Constant time complexity. - */ - MemberIterator RemoveMember(MemberIterator m) { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - CEREAL_RAPIDJSON_ASSERT(data_.o.size > 0); - CEREAL_RAPIDJSON_ASSERT(GetMembersPointer() != 0); - CEREAL_RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); - - MemberIterator last(GetMembersPointer() + (data_.o.size - 1)); - if (data_.o.size > 1 && m != last) - *m = *last; // Move the last one to this place - else - m->~Member(); // Only one left, just destroy - --data_.o.size; - return m; - } - - //! Remove a member from an object by iterator. - /*! \param pos iterator to the member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() - \return Iterator following the removed element. - If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. - \note This function preserves the relative order of the remaining object - members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator pos) { - return EraseMember(pos, pos +1); - } - - //! Remove members in the range [first, last) from an object. - /*! \param first iterator to the first member to remove - \param last iterator following the last member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() - \return Iterator following the last removed element. - \note This function preserves the relative order of the remaining object - members. - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { - CEREAL_RAPIDJSON_ASSERT(IsObject()); - CEREAL_RAPIDJSON_ASSERT(data_.o.size > 0); - CEREAL_RAPIDJSON_ASSERT(GetMembersPointer() != 0); - CEREAL_RAPIDJSON_ASSERT(first >= MemberBegin()); - CEREAL_RAPIDJSON_ASSERT(first <= last); - CEREAL_RAPIDJSON_ASSERT(last <= MemberEnd()); - - MemberIterator pos = MemberBegin() + (first - MemberBegin()); - for (MemberIterator itr = pos; itr != last; ++itr) - itr->~Member(); - std::memmove(static_cast(&*pos), &*last, static_cast(MemberEnd() - last) * sizeof(Member)); - data_.o.size -= static_cast(last - first); - return pos; - } - - //! Erase a member in object by its name. - /*! \param name Name of member to be removed. - \return Whether the member existed. - \note Linear time complexity. - */ - bool EraseMember(const Ch* name) { - GenericValue n(StringRef(name)); - return EraseMember(n); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool EraseMember(const std::basic_string& name) { return EraseMember(GenericValue(StringRef(name))); } -#endif - - template - bool EraseMember(const GenericValue& name) { - MemberIterator m = FindMember(name); - if (m != MemberEnd()) { - EraseMember(m); - return true; - } - else - return false; - } - - Object GetObject() { CEREAL_RAPIDJSON_ASSERT(IsObject()); return Object(*this); } - ConstObject GetObject() const { CEREAL_RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } - - //@} - - //!@name Array - //@{ - - //! Set this value as an empty array. - /*! \post IsArray == true */ - GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } - - //! Get the number of elements in array. - SizeType Size() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } - - //! Get the capacity of array. - SizeType Capacity() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } - - //! Check whether the array is empty. - bool Empty() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } - - //! Remove all elements in the array. - /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void Clear() { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - GenericValue* e = GetElementsPointer(); - for (GenericValue* v = e; v != e + data_.a.size; ++v) - v->~GenericValue(); - data_.a.size = 0; - } - - //! Get an element from array by index. - /*! \pre IsArray() == true - \param index Zero-based index of element. - \see operator[](T*) - */ - GenericValue& operator[](SizeType index) { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - CEREAL_RAPIDJSON_ASSERT(index < data_.a.size); - return GetElementsPointer()[index]; - } - const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } - - //! Element iterator - /*! \pre IsArray() == true */ - ValueIterator Begin() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); } - //! \em Past-the-end element iterator - /*! \pre IsArray() == true */ - ValueIterator End() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; } - //! Constant element iterator - /*! \pre IsArray() == true */ - ConstValueIterator Begin() const { return const_cast(*this).Begin(); } - //! Constant \em past-the-end element iterator - /*! \pre IsArray() == true */ - ConstValueIterator End() const { return const_cast(*this).End(); } - - //! Request the array to have enough capacity to store elements. - /*! \param newCapacity The capacity that the array at least need to have. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note Linear time complexity. - */ - GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - if (newCapacity > data_.a.capacity) { - SetElementsPointer(reinterpret_cast(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)))); - data_.a.capacity = newCapacity; - } - return *this; - } - - //! Append a GenericValue at the end of the array. - /*! \param value Value to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \post value.IsNull() == true - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this array on success. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - */ - GenericValue& PushBack(GenericValue& value, Allocator& allocator) { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - if (data_.a.size >= data_.a.capacity) - Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); - GetElementsPointer()[data_.a.size++].RawAssign(value); - return *this; - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { - return PushBack(value, allocator); - } -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - - //! Append a constant string reference at the end of the array. - /*! \param value Constant string reference to be appended. - \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - \see GenericStringRef - */ - GenericValue& PushBack(StringRefType value, Allocator& allocator) { - return (*this).template PushBack(value, allocator); - } - - //! Append a primitive value at the end of the array. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value Value of primitive type T to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref PushBack(GenericValue&, Allocator&) or \ref - PushBack(StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized constant time complexity. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - PushBack(T value, Allocator& allocator) { - GenericValue v(value); - return PushBack(v, allocator); - } - - //! Remove the last element in the array. - /*! - \note Constant time complexity. - */ - GenericValue& PopBack() { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - CEREAL_RAPIDJSON_ASSERT(!Empty()); - GetElementsPointer()[--data_.a.size].~GenericValue(); - return *this; - } - - //! Remove an element of array by iterator. - /*! - \param pos iterator to the element to remove - \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() - \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator pos) { - return Erase(pos, pos + 1); - } - - //! Remove elements in the range [first, last) of the array. - /*! - \param first iterator to the first element to remove - \param last iterator following the last element to remove - \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() - \return Iterator following the last removed element. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { - CEREAL_RAPIDJSON_ASSERT(IsArray()); - CEREAL_RAPIDJSON_ASSERT(data_.a.size > 0); - CEREAL_RAPIDJSON_ASSERT(GetElementsPointer() != 0); - CEREAL_RAPIDJSON_ASSERT(first >= Begin()); - CEREAL_RAPIDJSON_ASSERT(first <= last); - CEREAL_RAPIDJSON_ASSERT(last <= End()); - ValueIterator pos = Begin() + (first - Begin()); - for (ValueIterator itr = pos; itr != last; ++itr) - itr->~GenericValue(); - std::memmove(static_cast(pos), last, static_cast(End() - last) * sizeof(GenericValue)); - data_.a.size -= static_cast(last - first); - return pos; - } - - Array GetArray() { CEREAL_RAPIDJSON_ASSERT(IsArray()); return Array(*this); } - ConstArray GetArray() const { CEREAL_RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); } - - //@} - - //!@name Number - //@{ - - int GetInt() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; } - unsigned GetUint() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; } - int64_t GetInt64() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; } - uint64_t GetUint64() const { CEREAL_RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; } - - //! Get the value as double type. - /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless. - */ - double GetDouble() const { - CEREAL_RAPIDJSON_ASSERT(IsNumber()); - if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. - if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double - if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double - if ((data_.f.flags & kInt64Flag) != 0) return static_cast(data_.n.i64); // int64_t -> double (may lose precision) - CEREAL_RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast(data_.n.u64); // uint64_t -> double (may lose precision) - } - - //! Get the value as float type. - /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless. - */ - float GetFloat() const { - return static_cast(GetDouble()); - } - - GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } - GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } - GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } - GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } - GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } - GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast(f)); return *this; } - - //@} - - //!@name String - //@{ - - const Ch* GetString() const { CEREAL_RAPIDJSON_ASSERT(IsString()); return (data_.f.flags & kInlineStrFlag) ? data_.ss.str : GetStringPointer(); } - - //! Get the length of string. - /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). - */ - SizeType GetStringLength() const { CEREAL_RAPIDJSON_ASSERT(IsString()); return ((data_.f.flags & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); } - - //! Set this value as a string without copying source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string pointer. - \param length The length of source string, excluding the trailing null terminator. - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == length - \see SetString(StringRefType) - */ - GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } - - //! Set this value as a string without copying source string. - /*! \param s source string reference - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == s.length - */ - GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } - - //! Set this value as a string by copying from source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string. - \param length The length of source string, excluding the trailing null terminator. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); } - - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(StringRef(s), allocator); } - - //! Set this value as a string by copying from source string. - /*! \param s source string reference - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s.s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(StringRefType s, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, allocator); return *this; } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() - \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. - */ - GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(StringRef(s), allocator); } -#endif - - //@} - - //!@name Array - //@{ - - //! Templated version for checking whether this value is type T. - /*! - \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string - */ - template - bool Is() const { return internal::TypeHelper::Is(*this); } - - template - T Get() const { return internal::TypeHelper::Get(*this); } - - template - T Get() { return internal::TypeHelper::Get(*this); } - - template - ValueType& Set(const T& data) { return internal::TypeHelper::Set(*this, data); } - - template - ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper::Set(*this, data, allocator); } - - //@} - - //! Generate events of this value to a Handler. - /*! This function adopts the GoF visitor pattern. - Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. - It can also be used to deep clone this value via GenericDocument, which is also a Handler. - \tparam Handler type of handler. - \param handler An object implementing concept Handler. - */ - template - bool Accept(Handler& handler) const { - switch(GetType()) { - case kNullType: return handler.Null(); - case kFalseType: return handler.Bool(false); - case kTrueType: return handler.Bool(true); - - case kObjectType: - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartObject())) - return false; - for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { - CEREAL_RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0))) - return false; - if (CEREAL_RAPIDJSON_UNLIKELY(!m->value.Accept(handler))) - return false; - } - return handler.EndObject(data_.o.size); - - case kArrayType: - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartArray())) - return false; - for (const GenericValue* v = Begin(); v != End(); ++v) - if (CEREAL_RAPIDJSON_UNLIKELY(!v->Accept(handler))) - return false; - return handler.EndArray(data_.a.size); - - case kStringType: - return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0); - - default: - CEREAL_RAPIDJSON_ASSERT(GetType() == kNumberType); - if (IsDouble()) return handler.Double(data_.n.d); - else if (IsInt()) return handler.Int(data_.n.i.i); - else if (IsUint()) return handler.Uint(data_.n.u.u); - else if (IsInt64()) return handler.Int64(data_.n.i64); - else return handler.Uint64(data_.n.u64); - } - } - -private: - template friend class GenericValue; - template friend class GenericDocument; - - enum { - kBoolFlag = 0x0008, - kNumberFlag = 0x0010, - kIntFlag = 0x0020, - kUintFlag = 0x0040, - kInt64Flag = 0x0080, - kUint64Flag = 0x0100, - kDoubleFlag = 0x0200, - kStringFlag = 0x0400, - kCopyFlag = 0x0800, - kInlineStrFlag = 0x1000, - - // Initial flags of different types. - kNullFlag = kNullType, - kTrueFlag = kTrueType | kBoolFlag, - kFalseFlag = kFalseType | kBoolFlag, - kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, - kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, - kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag, - kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, - kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, - kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, - kConstStringFlag = kStringType | kStringFlag, - kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, - kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, - kObjectFlag = kObjectType, - kArrayFlag = kArrayType, - - kTypeMask = 0x07 - }; - - static const SizeType kDefaultArrayCapacity = 16; - static const SizeType kDefaultObjectCapacity = 16; - - struct Flag { -#if CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION - char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer -#elif CEREAL_RAPIDJSON_64BIT - char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes -#else - char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes -#endif - uint16_t flags; - }; - - struct String { - SizeType length; - SizeType hashcode; //!< reserved - const Ch* str; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars - // (excluding the terminating zero) and store a value to determine the length of the contained - // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string - // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as - // the string terminator as well. For getting the string length back from that value just use - // "MaxSize - str[LenPos]". - // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, - // 13-chars strings for CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). - struct ShortString { - enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; - Ch str[MaxChars]; - - inline static bool Usable(SizeType len) { return (MaxSize >= len); } - inline void SetLength(SizeType len) { str[LenPos] = static_cast(MaxSize - len); } - inline SizeType GetLength() const { return static_cast(MaxSize - str[LenPos]); } - }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // By using proper binary layout, retrieval of different integer types do not need conversions. - union Number { -#if CEREAL_RAPIDJSON_ENDIAN == CEREAL_RAPIDJSON_LITTLEENDIAN - struct I { - int i; - char padding[4]; - }i; - struct U { - unsigned u; - char padding2[4]; - }u; -#else - struct I { - char padding[4]; - int i; - }i; - struct U { - char padding2[4]; - unsigned u; - }u; -#endif - int64_t i64; - uint64_t u64; - double d; - }; // 8 bytes - - struct ObjectData { - SizeType size; - SizeType capacity; - Member* members; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - struct ArrayData { - SizeType size; - SizeType capacity; - GenericValue* elements; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - union Data { - String s; - ShortString ss; - Number n; - ObjectData o; - ArrayData a; - Flag f; - }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION - - CEREAL_RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(Ch, data_.s.str); } - CEREAL_RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return CEREAL_RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); } - CEREAL_RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); } - CEREAL_RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return CEREAL_RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); } - CEREAL_RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return CEREAL_RAPIDJSON_GETPOINTER(Member, data_.o.members); } - CEREAL_RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return CEREAL_RAPIDJSON_SETPOINTER(Member, data_.o.members, members); } - - // Initialize this value as array with initial data, without calling destructor. - void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { - data_.f.flags = kArrayFlag; - if (count) { - GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); - SetElementsPointer(e); - std::memcpy(static_cast(e), values, count * sizeof(GenericValue)); - } - else - SetElementsPointer(0); - data_.a.size = data_.a.capacity = count; - } - - //! Initialize this value as object with initial data, without calling destructor. - void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { - data_.f.flags = kObjectFlag; - if (count) { - Member* m = static_cast(allocator.Malloc(count * sizeof(Member))); - SetMembersPointer(m); - std::memcpy(static_cast(m), members, count * sizeof(Member)); - } - else - SetMembersPointer(0); - data_.o.size = data_.o.capacity = count; - } - - //! Initialize this value as constant string, without calling destructor. - void SetStringRaw(StringRefType s) CEREAL_RAPIDJSON_NOEXCEPT { - data_.f.flags = kConstStringFlag; - SetStringPointer(s); - data_.s.length = s.length; - } - - //! Initialize this value as copy string with initial data, without calling destructor. - void SetStringRaw(StringRefType s, Allocator& allocator) { - Ch* str = 0; - if (ShortString::Usable(s.length)) { - data_.f.flags = kShortStringFlag; - data_.ss.SetLength(s.length); - str = data_.ss.str; - } else { - data_.f.flags = kCopyStringFlag; - data_.s.length = s.length; - str = static_cast(allocator.Malloc((s.length + 1) * sizeof(Ch))); - SetStringPointer(str); - } - std::memcpy(str, s, s.length * sizeof(Ch)); - str[s.length] = '\0'; - } - - //! Assignment without calling destructor - void RawAssign(GenericValue& rhs) CEREAL_RAPIDJSON_NOEXCEPT { - data_ = rhs.data_; - // data_.f.flags = rhs.data_.f.flags; - rhs.data_.f.flags = kNullFlag; - } - - template - bool StringEqual(const GenericValue& rhs) const { - CEREAL_RAPIDJSON_ASSERT(IsString()); - CEREAL_RAPIDJSON_ASSERT(rhs.IsString()); - - const SizeType len1 = GetStringLength(); - const SizeType len2 = rhs.GetStringLength(); - if(len1 != len2) { return false; } - - const Ch* const str1 = GetString(); - const Ch* const str2 = rhs.GetString(); - if(str1 == str2) { return true; } // fast path for constant string - - return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); - } - - Data data_; -}; - -//! GenericValue with UTF8 encoding -typedef GenericValue > Value; - -/////////////////////////////////////////////////////////////////////////////// -// GenericDocument - -//! A document for parsing JSON text as DOM. -/*! - \note implements Handler concept - \tparam Encoding Encoding for both parsing and string storage. - \tparam Allocator Allocator for allocating memory for the DOM - \tparam StackAllocator Allocator for allocating memory for stack during parsing. - \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. -*/ -template , typename StackAllocator = CrtAllocator> -class GenericDocument : public GenericValue { -public: - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericValue ValueType; //!< Value type of the document. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - - //! Constructor - /*! Creates an empty document of specified type. - \param type Mandatory type of object to create. - \param allocator Optional allocator for allocating memory. - \param stackCapacity Optional initial capacity of stack in bytes. - \param stackAllocator Optional allocator for allocating memory for stack. - */ - explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : - GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() - { - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - } - - //! Constructor - /*! Creates an empty document which type is Null. - \param allocator Optional allocator for allocating memory. - \param stackCapacity Optional initial capacity of stack in bytes. - \param stackAllocator Optional allocator for allocating memory for stack. - */ - GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : - allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() - { - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericDocument(GenericDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT - : ValueType(std::forward(rhs)), // explicit cast to avoid prohibited move from Document - allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(std::move(rhs.stack_)), - parseResult_(rhs.parseResult_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - } -#endif - - ~GenericDocument() { - Destroy(); - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericDocument& operator=(GenericDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT - { - // The cast to ValueType is necessary here, because otherwise it would - // attempt to call GenericValue's templated assignment operator. - ValueType::operator=(std::forward(rhs)); - - // Calling the destructor here would prematurely call stack_'s destructor - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = std::move(rhs.stack_); - parseResult_ = rhs.parseResult_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - - return *this; - } -#endif - - //! Exchange the contents of this document with those of another. - /*! - \param rhs Another document. - \note Constant complexity. - \see GenericValue::Swap - */ - GenericDocument& Swap(GenericDocument& rhs) CEREAL_RAPIDJSON_NOEXCEPT { - ValueType::Swap(rhs); - stack_.Swap(rhs.stack_); - internal::Swap(allocator_, rhs.allocator_); - internal::Swap(ownAllocator_, rhs.ownAllocator_); - internal::Swap(parseResult_, rhs.parseResult_); - return *this; - } - - // Allow Swap with ValueType. - // Refer to Effective C++ 3rd Edition/Item 33: Avoid hiding inherited names. - using ValueType::Swap; - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.doc, b.doc); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericDocument& a, GenericDocument& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //! Populate this document by a generator which produces SAX events. - /*! \tparam Generator A functor with bool f(Handler) prototype. - \param g Generator functor which sends SAX events to the parameter. - \return The document itself for fluent API. - */ - template - GenericDocument& Populate(Generator& g) { - ClearStackOnExit scope(*this); - if (g(*this)) { - CEREAL_RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object - ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document - } - return *this; - } - - //!@name Parse from stream - //!@{ - - //! Parse JSON text from an input stream (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam SourceEncoding Encoding of input stream - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - GenericReader reader( - stack_.HasAllocator() ? &stack_.GetAllocator() : 0); - ClearStackOnExit scope(*this); - parseResult_ = reader.template Parse(is, *this); - if (parseResult_) { - CEREAL_RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object - ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document - } - return *this; - } - - //! Parse JSON text from an input stream - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - - //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - //!@} - - //!@name Parse in-place from mutable string - //!@{ - - //! Parse JSON text from a mutable string - /*! \tparam parseFlags Combination of \ref ParseFlag. - \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseInsitu(Ch* str) { - GenericInsituStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) - /*! \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - GenericDocument& ParseInsitu(Ch* str) { - return ParseInsitu(str); - } - //!@} - - //!@name Parse from read-only string - //!@{ - - //! Parse JSON text from a read-only string (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \tparam SourceEncoding Transcoding from input Encoding - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const typename SourceEncoding::Ch* str) { - CEREAL_RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); - GenericStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a read-only string - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - - //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) - /*! \param str Read-only zero-terminated string to be parsed. - */ - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - - template - GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) { - CEREAL_RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); - MemoryStream ms(reinterpret_cast(str), length * sizeof(typename SourceEncoding::Ch)); - EncodedInputStream is(ms); - ParseStream(is); - return *this; - } - - template - GenericDocument& Parse(const Ch* str, size_t length) { - return Parse(str, length); - } - - GenericDocument& Parse(const Ch* str, size_t length) { - return Parse(str, length); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - template - GenericDocument& Parse(const std::basic_string& str) { - // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t) - return Parse(str.c_str()); - } - - template - GenericDocument& Parse(const std::basic_string& str) { - return Parse(str.c_str()); - } - - GenericDocument& Parse(const std::basic_string& str) { - return Parse(str); - } -#endif // CEREAL_RAPIDJSON_HAS_STDSTRING - - //!@} - - //!@name Handling parse errors - //!@{ - - //! Whether a parse error has occurred in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseError() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - - //! Implicit conversion to get the last parse result -#ifndef __clang // -Wdocumentation - /*! \return \ref ParseResult of the last parse operation - - \code - Document doc; - ParseResult ok = doc.Parse(json); - if (!ok) - printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset()); - \endcode - */ -#endif - operator ParseResult() const { return parseResult_; } - //!@} - - //! Get the allocator of this document. - Allocator& GetAllocator() { - CEREAL_RAPIDJSON_ASSERT(allocator_); - return *allocator_; - } - - //! Get the capacity of stack in bytes. - size_t GetStackCapacity() const { return stack_.GetCapacity(); } - -private: - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} - ~ClearStackOnExit() { d_.ClearStack(); } - private: - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - GenericDocument& d_; - }; - - // callers of the following private Handler functions - // template friend class GenericReader; // for parsing - template friend class GenericValue; // for deep copying - -public: - // Implementation of Handler - bool Null() { new (stack_.template Push()) ValueType(); return true; } - bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } - bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } - bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } - - bool RawNumber(const Ch* str, SizeType length, bool copy) { - if (copy) - new (stack_.template Push()) ValueType(str, length, GetAllocator()); - else - new (stack_.template Push()) ValueType(str, length); - return true; - } - - bool String(const Ch* str, SizeType length, bool copy) { - if (copy) - new (stack_.template Push()) ValueType(str, length, GetAllocator()); - else - new (stack_.template Push()) ValueType(str, length); - return true; - } - - bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } - - bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } - - bool EndObject(SizeType memberCount) { - typename ValueType::Member* members = stack_.template Pop(memberCount); - stack_.template Top()->SetObjectRaw(members, memberCount, GetAllocator()); - return true; - } - - bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } - - bool EndArray(SizeType elementCount) { - ValueType* elements = stack_.template Pop(elementCount); - stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); - return true; - } - -private: - //! Prohibit copying - GenericDocument(const GenericDocument&); - //! Prohibit assignment - GenericDocument& operator=(const GenericDocument&); - - void ClearStack() { - if (Allocator::kNeedFree) - while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) - (stack_.template Pop(1))->~ValueType(); - else - stack_.Clear(); - stack_.ShrinkToFit(); - } - - void Destroy() { - CEREAL_RAPIDJSON_DELETE(ownAllocator_); - } - - static const size_t kDefaultStackCapacity = 1024; - Allocator* allocator_; - Allocator* ownAllocator_; - internal::Stack stack_; - ParseResult parseResult_; -}; - -//! GenericDocument with UTF8 encoding -typedef GenericDocument > Document; - -//! Helper class for accessing Value of array type. -/*! - Instance of this helper class is obtained by \c GenericValue::GetArray(). - In addition to all APIs for array type, it provides range-based for loop if \c CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR=1. -*/ -template -class GenericArray { -public: - typedef GenericArray ConstArray; - typedef GenericArray Array; - typedef ValueT PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - typedef ValueType* ValueIterator; // This may be const or non-const iterator - typedef const ValueT* ConstValueIterator; - typedef typename ValueType::AllocatorType AllocatorType; - typedef typename ValueType::StringRefType StringRefType; - - template - friend class GenericValue; - - GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} - GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } - ~GenericArray() {} - - SizeType Size() const { return value_.Size(); } - SizeType Capacity() const { return value_.Capacity(); } - bool Empty() const { return value_.Empty(); } - void Clear() const { value_.Clear(); } - ValueType& operator[](SizeType index) const { return value_[index]; } - ValueIterator Begin() const { return value_.Begin(); } - ValueIterator End() const { return value_.End(); } - GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; } - GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } - template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } - GenericArray PopBack() const { value_.PopBack(); return *this; } - ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); } - ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR - ValueIterator begin() const { return value_.Begin(); } - ValueIterator end() const { return value_.End(); } -#endif - -private: - GenericArray(); - GenericArray(ValueType& value) : value_(value) {} - ValueType& value_; -}; - -//! Helper class for accessing Value of object type. -/*! - Instance of this helper class is obtained by \c GenericValue::GetObject(). - In addition to all APIs for array type, it provides range-based for loop if \c CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR=1. -*/ -template -class GenericObject { -public: - typedef GenericObject ConstObject; - typedef GenericObject Object; - typedef ValueT PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - typedef GenericMemberIterator MemberIterator; // This may be const or non-const iterator - typedef GenericMemberIterator ConstMemberIterator; - typedef typename ValueType::AllocatorType AllocatorType; - typedef typename ValueType::StringRefType StringRefType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename ValueType::Ch Ch; - - template - friend class GenericValue; - - GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} - GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } - ~GenericObject() {} - - SizeType MemberCount() const { return value_.MemberCount(); } - SizeType MemberCapacity() const { return value_.MemberCapacity(); } - bool ObjectEmpty() const { return value_.ObjectEmpty(); } - template ValueType& operator[](T* name) const { return value_[name]; } - template ValueType& operator[](const GenericValue& name) const { return value_[name]; } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - ValueType& operator[](const std::basic_string& name) const { return value_[name]; } -#endif - MemberIterator MemberBegin() const { return value_.MemberBegin(); } - MemberIterator MemberEnd() const { return value_.MemberEnd(); } - GenericObject MemberReserve(SizeType newCapacity, AllocatorType &allocator) const { value_.MemberReserve(newCapacity, allocator); return *this; } - bool HasMember(const Ch* name) const { return value_.HasMember(name); } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool HasMember(const std::basic_string& name) const { return value_.HasMember(name); } -#endif - template bool HasMember(const GenericValue& name) const { return value_.HasMember(name); } - MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); } - template MemberIterator FindMember(const GenericValue& name) const { return value_.FindMember(name); } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - MemberIterator FindMember(const std::basic_string& name) const { return value_.FindMember(name); } -#endif - GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - GenericObject AddMember(ValueType& name, std::basic_string& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#endif - template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - template CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - void RemoveAllMembers() { value_.RemoveAllMembers(); } - bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool RemoveMember(const std::basic_string& name) const { return value_.RemoveMember(name); } -#endif - template bool RemoveMember(const GenericValue& name) const { return value_.RemoveMember(name); } - MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); } - MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); } - MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); } - bool EraseMember(const Ch* name) const { return value_.EraseMember(name); } -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool EraseMember(const std::basic_string& name) const { return EraseMember(ValueType(StringRef(name))); } -#endif - template bool EraseMember(const GenericValue& name) const { return value_.EraseMember(name); } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR - MemberIterator begin() const { return value_.MemberBegin(); } - MemberIterator end() const { return value_.MemberEnd(); } -#endif - -private: - GenericObject(); - GenericObject(ValueType& value) : value_(value) {} - ValueType& value_; -}; - -CEREAL_RAPIDJSON_NAMESPACE_END -CEREAL_RAPIDJSON_DIAG_POP - -#endif // CEREAL_RAPIDJSON_DOCUMENT_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h deleted file mode 100644 index b04774be3..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodedstream.h +++ /dev/null @@ -1,299 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ENCODEDSTREAM_H_ -#define CEREAL_RAPIDJSON_ENCODEDSTREAM_H_ - -#include "stream.h" -#include "memorystream.h" - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Input byte stream wrapper with a statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam InputByteStream Type of input byte stream. For example, FileReadStream. -*/ -template -class EncodedInputStream { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedInputStream(InputByteStream& is) : is_(is) { - current_ = Encoding::TakeBOM(is_); - } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } - size_t Tell() const { return is_.Tell(); } - - // Not implemented - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedInputStream(const EncodedInputStream&); - EncodedInputStream& operator=(const EncodedInputStream&); - - InputByteStream& is_; - Ch current_; -}; - -//! Specialized for UTF8 MemoryStream. -template <> -class EncodedInputStream, MemoryStream> { -public: - typedef UTF8<>::Ch Ch; - - EncodedInputStream(MemoryStream& is) : is_(is) { - if (static_cast(is_.Peek()) == 0xEFu) is_.Take(); - if (static_cast(is_.Peek()) == 0xBBu) is_.Take(); - if (static_cast(is_.Peek()) == 0xBFu) is_.Take(); - } - Ch Peek() const { return is_.Peek(); } - Ch Take() { return is_.Take(); } - size_t Tell() const { return is_.Tell(); } - - // Not implemented - void Put(Ch) {} - void Flush() {} - Ch* PutBegin() { return 0; } - size_t PutEnd(Ch*) { return 0; } - - MemoryStream& is_; - -private: - EncodedInputStream(const EncodedInputStream&); - EncodedInputStream& operator=(const EncodedInputStream&); -}; - -//! Output byte stream wrapper with statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream. -*/ -template -class EncodedOutputStream { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { - if (putBOM) - Encoding::PutBOM(os_); - } - - void Put(Ch c) { Encoding::Put(os_, c); } - void Flush() { os_.Flush(); } - - // Not implemented - Ch Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0;} - Ch Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0;} - size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedOutputStream(const EncodedOutputStream&); - EncodedOutputStream& operator=(const EncodedOutputStream&); - - OutputByteStream& os_; -}; - -#define CEREAL_RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - -//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for reading. - \tparam InputByteStream type of input byte stream to be wrapped. -*/ -template -class AutoUTFInputStream { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param is input stream to be wrapped. - \param type UTF encoding type if it is not detected from the stream. - */ - AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { - CEREAL_RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - DetectType(); - static const TakeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Take) }; - takeFunc_ = f[type_]; - current_ = takeFunc_(*is_); - } - - UTFType GetType() const { return type_; } - bool HasBOM() const { return hasBOM_; } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } - size_t Tell() const { return is_->Tell(); } - - // Not implemented - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFInputStream(const AutoUTFInputStream&); - AutoUTFInputStream& operator=(const AutoUTFInputStream&); - - // Detect encoding type with BOM or RFC 4627 - void DetectType() { - // BOM (Byte Order Mark): - // 00 00 FE FF UTF-32BE - // FF FE 00 00 UTF-32LE - // FE FF UTF-16BE - // FF FE UTF-16LE - // EF BB BF UTF-8 - - const unsigned char* c = reinterpret_cast(is_->Peek4()); - if (!c) - return; - - unsigned bom = static_cast(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); - hasBOM_ = false; - if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } - - // RFC 4627: Section 3 - // "Since the first two characters of a JSON text will always be ASCII - // characters [RFC0020], it is possible to determine whether an octet - // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking - // at the pattern of nulls in the first four octets." - // 00 00 00 xx UTF-32BE - // 00 xx 00 xx UTF-16BE - // xx 00 00 00 UTF-32LE - // xx 00 xx 00 UTF-16LE - // xx xx xx xx UTF-8 - - if (!hasBOM_) { - int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); - switch (pattern) { - case 0x08: type_ = kUTF32BE; break; - case 0x0A: type_ = kUTF16BE; break; - case 0x01: type_ = kUTF32LE; break; - case 0x05: type_ = kUTF16LE; break; - case 0x0F: type_ = kUTF8; break; - default: break; // Use type defined by user. - } - } - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - } - - typedef Ch (*TakeFunc)(InputByteStream& is); - InputByteStream* is_; - UTFType type_; - Ch current_; - TakeFunc takeFunc_; - bool hasBOM_; -}; - -//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for writing. - \tparam OutputByteStream type of output byte stream to be wrapped. -*/ -template -class AutoUTFOutputStream { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param os output stream to be wrapped. - \param type UTF encoding type. - \param putBOM Whether to write BOM at the beginning of the stream. - */ - AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { - CEREAL_RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) CEREAL_RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - - static const PutFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Put) }; - putFunc_ = f[type_]; - - if (putBOM) - PutBOM(); - } - - UTFType GetType() const { return type_; } - - void Put(Ch c) { putFunc_(*os_, c); } - void Flush() { os_->Flush(); } - - // Not implemented - Ch Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0;} - Ch Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0;} - size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFOutputStream(const AutoUTFOutputStream&); - AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); - - void PutBOM() { - typedef void (*PutBOMFunc)(OutputByteStream&); - static const PutBOMFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; - f[type_](*os_); - } - - typedef void (*PutFunc)(OutputByteStream&, Ch); - - OutputByteStream* os_; - UTFType type_; - PutFunc putFunc_; -}; - -#undef CEREAL_RAPIDJSON_ENCODINGS_FUNC - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h deleted file mode 100644 index a1c27ecf8..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/encodings.h +++ /dev/null @@ -1,716 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ENCODINGS_H_ -#define CEREAL_RAPIDJSON_ENCODINGS_H_ - -#include "rapidjson.h" - -#if defined(_MSC_VER) && !defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data -CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code -#elif defined(__GNUC__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -CEREAL_RAPIDJSON_DIAG_OFF(overflow) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Encoding - -/*! \class rapidjson::Encoding - \brief Concept for encoding of Unicode characters. - -\code -concept Encoding { - typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. - - enum { supportUnicode = 1 }; // or 0 if not supporting unicode - - //! \brief Encode a Unicode codepoint to an output stream. - //! \param os Output stream. - //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. - template - static void Encode(OutputStream& os, unsigned codepoint); - - //! \brief Decode a Unicode codepoint from an input stream. - //! \param is Input stream. - //! \param codepoint Output of the unicode codepoint. - //! \return true if a valid codepoint can be decoded from the stream. - template - static bool Decode(InputStream& is, unsigned* codepoint); - - //! \brief Validate one Unicode codepoint from an encoded stream. - //! \param is Input stream to obtain codepoint. - //! \param os Output for copying one codepoint. - //! \return true if it is valid. - //! \note This function just validating and copying the codepoint without actually decode it. - template - static bool Validate(InputStream& is, OutputStream& os); - - // The following functions are deal with byte streams. - - //! Take a character from input byte stream, skip BOM if exist. - template - static CharType TakeBOM(InputByteStream& is); - - //! Take a character from input byte stream. - template - static Ch Take(InputByteStream& is); - - //! Put BOM to output byte stream. - template - static void PutBOM(OutputByteStream& os); - - //! Put a character to output byte stream. - template - static void Put(OutputByteStream& os, Ch c); -}; -\endcode -*/ - -/////////////////////////////////////////////////////////////////////////////// -// UTF8 - -//! UTF-8 encoding. -/*! http://en.wikipedia.org/wiki/UTF-8 - http://tools.ietf.org/html/rfc3629 - \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. - \note implements Encoding concept -*/ -template -struct UTF8 { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - if (codepoint <= 0x7F) - os.Put(static_cast(codepoint & 0xFF)); - else if (codepoint <= 0x7FF) { - os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); - } - else if (codepoint <= 0xFFFF) { - os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - else { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - if (codepoint <= 0x7F) - PutUnsafe(os, static_cast(codepoint & 0xFF)); - else if (codepoint <= 0x7FF) { - PutUnsafe(os, static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint & 0x3F)))); - } - else if (codepoint <= 0xFFFF) { - PutUnsafe(os, static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); - } - else { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - PutUnsafe(os, static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 12) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { -#define CEREAL_RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast(c) & 0x3Fu) -#define CEREAL_RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) -#define CEREAL_RAPIDJSON_TAIL() CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x70) - typename InputStream::Ch c = is.Take(); - if (!(c & 0x80)) { - *codepoint = static_cast(c); - return true; - } - - unsigned char type = GetRange(static_cast(c)); - if (type >= 32) { - *codepoint = 0; - } else { - *codepoint = (0xFFu >> type) & static_cast(c); - } - bool result = true; - switch (type) { - case 2: CEREAL_RAPIDJSON_TAIL(); return result; - case 3: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 4: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x50); CEREAL_RAPIDJSON_TAIL(); return result; - case 5: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x10); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 6: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 10: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x20); CEREAL_RAPIDJSON_TAIL(); return result; - case 11: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x60); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - default: return false; - } -#undef CEREAL_RAPIDJSON_COPY -#undef CEREAL_RAPIDJSON_TRANS -#undef CEREAL_RAPIDJSON_TAIL - } - - template - static bool Validate(InputStream& is, OutputStream& os) { -#define CEREAL_RAPIDJSON_COPY() os.Put(c = is.Take()) -#define CEREAL_RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) -#define CEREAL_RAPIDJSON_TAIL() CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x70) - Ch c; - CEREAL_RAPIDJSON_COPY(); - if (!(c & 0x80)) - return true; - - bool result = true; - switch (GetRange(static_cast(c))) { - case 2: CEREAL_RAPIDJSON_TAIL(); return result; - case 3: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 4: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x50); CEREAL_RAPIDJSON_TAIL(); return result; - case 5: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x10); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 6: CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - case 10: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x20); CEREAL_RAPIDJSON_TAIL(); return result; - case 11: CEREAL_RAPIDJSON_COPY(); CEREAL_RAPIDJSON_TRANS(0x60); CEREAL_RAPIDJSON_TAIL(); CEREAL_RAPIDJSON_TAIL(); return result; - default: return false; - } -#undef CEREAL_RAPIDJSON_COPY -#undef CEREAL_RAPIDJSON_TRANS -#undef CEREAL_RAPIDJSON_TAIL - } - - static unsigned char GetRange(unsigned char c) { - // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ - // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. - static const unsigned char type[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, - }; - return type[c]; - } - - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - typename InputByteStream::Ch c = Take(is); - if (static_cast(c) != 0xEFu) return c; - c = is.Take(); - if (static_cast(c) != 0xBBu) return c; - c = is.Take(); - if (static_cast(c) != 0xBFu) return c; - c = is.Take(); - return c; - } - - template - static Ch Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return static_cast(is.Take()); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xEFu)); - os.Put(static_cast(0xBBu)); - os.Put(static_cast(0xBFu)); - } - - template - static void Put(OutputByteStream& os, Ch c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF16 - -//! UTF-16 encoding. -/*! http://en.wikipedia.org/wiki/UTF-16 - http://tools.ietf.org/html/rfc2781 - \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF16LE and UTF16BE, which handle endianness. -*/ -template -struct UTF16 { - typedef CharType Ch; - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - if (codepoint <= 0xFFFF) { - CEREAL_RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - os.Put(static_cast(codepoint)); - } - else { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - unsigned v = codepoint - 0x10000; - os.Put(static_cast((v >> 10) | 0xD800)); - os.Put(static_cast((v & 0x3FF) | 0xDC00)); - } - } - - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - if (codepoint <= 0xFFFF) { - CEREAL_RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - PutUnsafe(os, static_cast(codepoint)); - } - else { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - unsigned v = codepoint - 0x10000; - PutUnsafe(os, static_cast((v >> 10) | 0xD800)); - PutUnsafe(os, static_cast((v & 0x3FF) | 0xDC00)); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - typename InputStream::Ch c = is.Take(); - if (c < 0xD800 || c > 0xDFFF) { - *codepoint = static_cast(c); - return true; - } - else if (c <= 0xDBFF) { - *codepoint = (static_cast(c) & 0x3FF) << 10; - c = is.Take(); - *codepoint |= (static_cast(c) & 0x3FF); - *codepoint += 0x10000; - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - typename InputStream::Ch c; - os.Put(static_cast(c = is.Take())); - if (c < 0xD800 || c > 0xDFFF) - return true; - else if (c <= 0xDBFF) { - os.Put(c = is.Take()); - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } -}; - -//! UTF-16 little endian encoding. -template -struct UTF16LE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(is.Take()); - c |= static_cast(static_cast(is.Take())) << 8; - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFFu)); - os.Put(static_cast(0xFEu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(static_cast(c) & 0xFFu)); - os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); - } -}; - -//! UTF-16 big endian encoding. -template -struct UTF16BE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())); - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0xFFu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); - os.Put(static_cast(static_cast(c) & 0xFFu)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF32 - -//! UTF-32 encoding. -/*! http://en.wikipedia.org/wiki/UTF-32 - \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF32LE and UTF32BE, which handle endianness. -*/ -template -struct UTF32 { - typedef CharType Ch; - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(codepoint); - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - PutUnsafe(os, codepoint); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c = is.Take(); - *codepoint = c; - return c <= 0x10FFFF; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c; - os.Put(c = is.Take()); - return c <= 0x10FFFF; - } -}; - -//! UTF-32 little endian enocoding. -template -struct UTF32LE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(is.Take()); - c |= static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())) << 16; - c |= static_cast(static_cast(is.Take())) << 24; - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFFu)); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0x00u)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c & 0xFFu)); - os.Put(static_cast((c >> 8) & 0xFFu)); - os.Put(static_cast((c >> 16) & 0xFFu)); - os.Put(static_cast((c >> 24) & 0xFFu)); - } -}; - -//! UTF-32 big endian encoding. -template -struct UTF32BE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(static_cast(is.Take())) << 24; - c |= static_cast(static_cast(is.Take())) << 16; - c |= static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())); - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0xFFu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast((c >> 24) & 0xFFu)); - os.Put(static_cast((c >> 16) & 0xFFu)); - os.Put(static_cast((c >> 8) & 0xFFu)); - os.Put(static_cast(c & 0xFFu)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// ASCII - -//! ASCII encoding. -/*! http://en.wikipedia.org/wiki/ASCII - \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. - \note implements Encoding concept -*/ -template -struct ASCII { - typedef CharType Ch; - - enum { supportUnicode = 0 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x7F); - os.Put(static_cast(codepoint & 0xFF)); - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - CEREAL_RAPIDJSON_ASSERT(codepoint <= 0x7F); - PutUnsafe(os, static_cast(codepoint & 0xFF)); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - uint8_t c = static_cast(is.Take()); - *codepoint = c; - return c <= 0X7F; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - uint8_t c = static_cast(is.Take()); - os.Put(static_cast(c)); - return c <= 0x7F; - } - - template - static CharType TakeBOM(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - uint8_t c = static_cast(Take(is)); - return static_cast(c); - } - - template - static Ch Take(InputByteStream& is) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return static_cast(is.Take()); - } - - template - static void PutBOM(OutputByteStream& os) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - (void)os; - } - - template - static void Put(OutputByteStream& os, Ch c) { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// AutoUTF - -//! Runtime-specified UTF encoding type of a stream. -enum UTFType { - kUTF8 = 0, //!< UTF-8. - kUTF16LE = 1, //!< UTF-16 little endian. - kUTF16BE = 2, //!< UTF-16 big endian. - kUTF32LE = 3, //!< UTF-32 little endian. - kUTF32BE = 4 //!< UTF-32 big endian. -}; - -//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. -/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType(). -*/ -template -struct AutoUTF { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - -#define CEREAL_RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - - template - static CEREAL_RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { - typedef void (*EncodeFunc)(OutputStream&, unsigned); - static const EncodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Encode) }; - (*f[os.GetType()])(os, codepoint); - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - typedef void (*EncodeFunc)(OutputStream&, unsigned); - static const EncodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) }; - (*f[os.GetType()])(os, codepoint); - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { - typedef bool (*DecodeFunc)(InputStream&, unsigned*); - static const DecodeFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Decode) }; - return (*f[is.GetType()])(is, codepoint); - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - typedef bool (*ValidateFunc)(InputStream&, OutputStream&); - static const ValidateFunc f[] = { CEREAL_RAPIDJSON_ENCODINGS_FUNC(Validate) }; - return (*f[is.GetType()])(is, os); - } - -#undef CEREAL_RAPIDJSON_ENCODINGS_FUNC -}; - -/////////////////////////////////////////////////////////////////////////////// -// Transcoder - -//! Encoding conversion. -template -struct Transcoder { - //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - TargetEncoding::Encode(os, codepoint); - return true; - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - TargetEncoding::EncodeUnsafe(os, codepoint); - return true; - } - - //! Validate one Unicode codepoint from an encoded stream. - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - return Transcode(is, os); // Since source/target encoding is different, must transcode. - } -}; - -// Forward declaration. -template -inline void PutUnsafe(Stream& stream, typename Stream::Ch c); - -//! Specialization of Transcoder with same source and target encoding. -template -struct Transcoder { - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { - os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. - return true; - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { - PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class. - return true; - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - return Encoding::Validate(is, os); // source/target encoding are the same - } -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__GNUC__) || (defined(_MSC_VER) && !defined(__clang__)) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_ENCODINGS_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h deleted file mode 100644 index ea93bf85e..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/en.h +++ /dev/null @@ -1,74 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ERROR_EN_H_ -#define CEREAL_RAPIDJSON_ERROR_EN_H_ - -#include "error.h" - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) -CEREAL_RAPIDJSON_DIAG_OFF(covered-switch-default) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Maps error code of parsing into error message. -/*! - \ingroup CEREAL_RAPIDJSON_ERRORS - \param parseErrorCode Error code obtained in parsing. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ -inline const CEREAL_RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { - switch (parseErrorCode) { - case kParseErrorNone: return CEREAL_RAPIDJSON_ERROR_STRING("No error."); - - case kParseErrorDocumentEmpty: return CEREAL_RAPIDJSON_ERROR_STRING("The document is empty."); - case kParseErrorDocumentRootNotSingular: return CEREAL_RAPIDJSON_ERROR_STRING("The document root must not be followed by other values."); - - case kParseErrorValueInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid value."); - - case kParseErrorObjectMissName: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a name for object member."); - case kParseErrorObjectMissColon: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); - case kParseErrorObjectMissCommaOrCurlyBracket: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); - - case kParseErrorArrayMissCommaOrSquareBracket: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); - - case kParseErrorStringUnicodeEscapeInvalidHex: return CEREAL_RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); - case kParseErrorStringUnicodeSurrogateInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); - case kParseErrorStringEscapeInvalid: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid escape character in string."); - case kParseErrorStringMissQuotationMark: return CEREAL_RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); - case kParseErrorStringInvalidEncoding: return CEREAL_RAPIDJSON_ERROR_STRING("Invalid encoding in string."); - - case kParseErrorNumberTooBig: return CEREAL_RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); - case kParseErrorNumberMissFraction: return CEREAL_RAPIDJSON_ERROR_STRING("Miss fraction part in number."); - case kParseErrorNumberMissExponent: return CEREAL_RAPIDJSON_ERROR_STRING("Miss exponent in number."); - - case kParseErrorTermination: return CEREAL_RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); - case kParseErrorUnspecificSyntaxError: return CEREAL_RAPIDJSON_ERROR_STRING("Unspecific syntax error."); - - default: return CEREAL_RAPIDJSON_ERROR_STRING("Unknown error."); - } -} - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_ERROR_EN_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h deleted file mode 100644 index 7e7cc2432..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/error/error.h +++ /dev/null @@ -1,161 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ERROR_ERROR_H_ -#define CEREAL_RAPIDJSON_ERROR_ERROR_H_ - -#include "../rapidjson.h" - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#endif - -/*! \file error.h */ - -/*! \defgroup CEREAL_RAPIDJSON_ERRORS RapidJSON error handling */ - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_ERROR_CHARTYPE - -//! Character type of error messages. -/*! \ingroup CEREAL_RAPIDJSON_ERRORS - The default character type is \c char. - On Windows, user can define this macro as \c TCHAR for supporting both - unicode/non-unicode settings. -*/ -#ifndef CEREAL_RAPIDJSON_ERROR_CHARTYPE -#define CEREAL_RAPIDJSON_ERROR_CHARTYPE char -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_ERROR_STRING - -//! Macro for converting string literial to \ref CEREAL_RAPIDJSON_ERROR_CHARTYPE[]. -/*! \ingroup CEREAL_RAPIDJSON_ERRORS - By default this conversion macro does nothing. - On Windows, user can define this macro as \c _T(x) for supporting both - unicode/non-unicode settings. -*/ -#ifndef CEREAL_RAPIDJSON_ERROR_STRING -#define CEREAL_RAPIDJSON_ERROR_STRING(x) x -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseErrorCode - -//! Error code of parsing. -/*! \ingroup CEREAL_RAPIDJSON_ERRORS - \see GenericReader::Parse, GenericReader::GetParseErrorCode -*/ -enum ParseErrorCode { - kParseErrorNone = 0, //!< No error. - - kParseErrorDocumentEmpty, //!< The document is empty. - kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. - - kParseErrorValueInvalid, //!< Invalid value. - - kParseErrorObjectMissName, //!< Missing a name for object member. - kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. - kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. - - kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. - - kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. - kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. - kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. - kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. - kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. - - kParseErrorNumberTooBig, //!< Number too big to be stored in double. - kParseErrorNumberMissFraction, //!< Miss fraction part in number. - kParseErrorNumberMissExponent, //!< Miss exponent in number. - - kParseErrorTermination, //!< Parsing was terminated. - kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. -}; - -//! Result of parsing (wraps ParseErrorCode) -/*! - \ingroup CEREAL_RAPIDJSON_ERRORS - \code - Document doc; - ParseResult ok = doc.Parse("[42]"); - if (!ok) { - fprintf(stderr, "JSON parse error: %s (%u)", - GetParseError_En(ok.Code()), ok.Offset()); - exit(EXIT_FAILURE); - } - \endcode - \see GenericReader::Parse, GenericDocument::Parse -*/ -struct ParseResult { - //!! Unspecified boolean type - typedef bool (ParseResult::*BooleanType)() const; -public: - //! Default constructor, no error. - ParseResult() : code_(kParseErrorNone), offset_(0) {} - //! Constructor to set an error. - ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} - - //! Get the error code. - ParseErrorCode Code() const { return code_; } - //! Get the error offset, if \ref IsError(), 0 otherwise. - size_t Offset() const { return offset_; } - - //! Explicit conversion to \c bool, returns \c true, iff !\ref IsError(). - operator BooleanType() const { return !IsError() ? &ParseResult::IsError : NULL; } - //! Whether the result is an error. - bool IsError() const { return code_ != kParseErrorNone; } - - bool operator==(const ParseResult& that) const { return code_ == that.code_; } - bool operator==(ParseErrorCode code) const { return code_ == code; } - friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } - - bool operator!=(const ParseResult& that) const { return !(*this == that); } - bool operator!=(ParseErrorCode code) const { return !(*this == code); } - friend bool operator!=(ParseErrorCode code, const ParseResult & err) { return err != code; } - - //! Reset error code. - void Clear() { Set(kParseErrorNone); } - //! Update error code and offset. - void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } - -private: - ParseErrorCode code_; - size_t offset_; -}; - -//! Function pointer type of GetParseError(). -/*! \ingroup CEREAL_RAPIDJSON_ERRORS - - This is the prototype for \c GetParseError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetParseErrorFunc GetParseError = GetParseError_En; // or whatever - const CEREAL_RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); -\endcode -*/ -typedef const CEREAL_RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_ERROR_ERROR_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h deleted file mode 100644 index 253a7f9a1..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filereadstream.h +++ /dev/null @@ -1,99 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_FILEREADSTREAM_H_ -#define CEREAL_RAPIDJSON_FILEREADSTREAM_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) -CEREAL_RAPIDJSON_DIAG_OFF(missing-noreturn) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! File byte stream for input using fread(). -/*! - \note implements Stream concept -*/ -class FileReadStream { -public: - typedef char Ch; //!< Character type (byte). - - //! Constructor. - /*! - \param fp File pointer opened for read. - \param buffer user-supplied buffer. - \param bufferSize size of buffer in bytes. Must >=4 bytes. - */ - FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - CEREAL_RAPIDJSON_ASSERT(fp_ != 0); - CEREAL_RAPIDJSON_ASSERT(bufferSize >= 4); - Read(); - } - - Ch Peek() const { return *current_; } - Ch Take() { Ch c = *current_; Read(); return c; } - size_t Tell() const { return count_ + static_cast(current_ - buffer_); } - - // Not implemented - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; - } - -private: - void Read() { - if (current_ < bufferLast_) - ++current_; - else if (!eof_) { - count_ += readCount_; - readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); - bufferLast_ = buffer_ + readCount_ - 1; - current_ = buffer_; - - if (readCount_ < bufferSize_) { - buffer_[readCount_] = '\0'; - ++bufferLast_; - eof_ = true; - } - } - } - - std::FILE* fp_; - Ch *buffer_; - size_t bufferSize_; - Ch *bufferLast_; - Ch *current_; - size_t readCount_; - size_t count_; //!< Number of characters read - bool eof_; -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h deleted file mode 100644 index 44ae12792..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/filewritestream.h +++ /dev/null @@ -1,104 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_FILEWRITESTREAM_H_ -#define CEREAL_RAPIDJSON_FILEWRITESTREAM_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of C file stream for output using fwrite(). -/*! - \note implements Stream concept -*/ -class FileWriteStream { -public: - typedef char Ch; //!< Character type. Only support char. - - FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { - CEREAL_RAPIDJSON_ASSERT(fp_ != 0); - } - - void Put(char c) { - if (current_ >= bufferEnd_) - Flush(); - - *current_++ = c; - } - - void PutN(char c, size_t n) { - size_t avail = static_cast(bufferEnd_ - current_); - while (n > avail) { - std::memset(current_, c, avail); - current_ += avail; - Flush(); - n -= avail; - avail = static_cast(bufferEnd_ - current_); - } - - if (n > 0) { - std::memset(current_, c, n); - current_ += n; - } - } - - void Flush() { - if (current_ != buffer_) { - size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); - if (result < static_cast(current_ - buffer_)) { - // failure deliberately ignored at this time - // added to avoid warn_unused_result build errors - } - current_ = buffer_; - } - } - - // Not implemented - char Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - char Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - char* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(char*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - // Prohibit copy constructor & assignment operator. - FileWriteStream(const FileWriteStream&); - FileWriteStream& operator=(const FileWriteStream&); - - std::FILE* fp_; - char *buffer_; - char *bufferEnd_; - char *current_; -}; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(FileWriteStream& stream, char c, size_t n) { - stream.PutN(c, n); -} - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_FILESTREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h deleted file mode 100644 index 1b15c6668..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/fwd.h +++ /dev/null @@ -1,151 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_FWD_H_ -#define CEREAL_RAPIDJSON_FWD_H_ - -#include "rapidjson.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -// encodings.h - -template struct UTF8; -template struct UTF16; -template struct UTF16BE; -template struct UTF16LE; -template struct UTF32; -template struct UTF32BE; -template struct UTF32LE; -template struct ASCII; -template struct AutoUTF; - -template -struct Transcoder; - -// allocators.h - -class CrtAllocator; - -template -class MemoryPoolAllocator; - -// stream.h - -template -struct GenericStringStream; - -typedef GenericStringStream > StringStream; - -template -struct GenericInsituStringStream; - -typedef GenericInsituStringStream > InsituStringStream; - -// stringbuffer.h - -template -class GenericStringBuffer; - -typedef GenericStringBuffer, CrtAllocator> StringBuffer; - -// filereadstream.h - -class FileReadStream; - -// filewritestream.h - -class FileWriteStream; - -// memorybuffer.h - -template -struct GenericMemoryBuffer; - -typedef GenericMemoryBuffer MemoryBuffer; - -// memorystream.h - -struct MemoryStream; - -// reader.h - -template -struct BaseReaderHandler; - -template -class GenericReader; - -typedef GenericReader, UTF8, CrtAllocator> Reader; - -// writer.h - -template -class Writer; - -// prettywriter.h - -template -class PrettyWriter; - -// document.h - -template -struct GenericMember; - -template -class GenericMemberIterator; - -template -struct GenericStringRef; - -template -class GenericValue; - -typedef GenericValue, MemoryPoolAllocator > Value; - -template -class GenericDocument; - -typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; - -// pointer.h - -template -class GenericPointer; - -typedef GenericPointer Pointer; - -// schema.h - -template -class IGenericRemoteSchemaDocumentProvider; - -template -class GenericSchemaDocument; - -typedef GenericSchemaDocument SchemaDocument; -typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; - -template < - typename SchemaDocumentType, - typename OutputHandler, - typename StateAllocator> -class GenericSchemaValidator; - -typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_RAPIDJSONFWD_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h deleted file mode 100644 index 77a6519df..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/biginteger.h +++ /dev/null @@ -1,290 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_BIGINTEGER_H_ -#define CEREAL_RAPIDJSON_BIGINTEGER_H_ - -#include "../rapidjson.h" - -#if defined(_MSC_VER) && !__INTEL_COMPILER && defined(_M_AMD64) -#include // for _umul128 -#pragma intrinsic(_umul128) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class BigInteger { -public: - typedef uint64_t Type; - - BigInteger(const BigInteger& rhs) : count_(rhs.count_) { - std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); - } - - explicit BigInteger(uint64_t u) : count_(1) { - digits_[0] = u; - } - - BigInteger(const char* decimals, size_t length) : count_(1) { - CEREAL_RAPIDJSON_ASSERT(length > 0); - digits_[0] = 0; - size_t i = 0; - const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 - while (length >= kMaxDigitPerIteration) { - AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); - length -= kMaxDigitPerIteration; - i += kMaxDigitPerIteration; - } - - if (length > 0) - AppendDecimal64(decimals + i, decimals + i + length); - } - - BigInteger& operator=(const BigInteger &rhs) - { - if (this != &rhs) { - count_ = rhs.count_; - std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); - } - return *this; - } - - BigInteger& operator=(uint64_t u) { - digits_[0] = u; - count_ = 1; - return *this; - } - - BigInteger& operator+=(uint64_t u) { - Type backup = digits_[0]; - digits_[0] += u; - for (size_t i = 0; i < count_ - 1; i++) { - if (digits_[i] >= backup) - return *this; // no carry - backup = digits_[i + 1]; - digits_[i + 1] += 1; - } - - // Last carry - if (digits_[count_ - 1] < backup) - PushBack(1); - - return *this; - } - - BigInteger& operator*=(uint64_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - uint64_t hi; - digits_[i] = MulAdd64(digits_[i], u, k, &hi); - k = hi; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator*=(uint32_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - const uint64_t c = digits_[i] >> 32; - const uint64_t d = digits_[i] & 0xFFFFFFFF; - const uint64_t uc = u * c; - const uint64_t ud = u * d; - const uint64_t p0 = ud + k; - const uint64_t p1 = uc + (p0 >> 32); - digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); - k = p1 >> 32; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator<<=(size_t shift) { - if (IsZero() || shift == 0) return *this; - - size_t offset = shift / kTypeBit; - size_t interShift = shift % kTypeBit; - CEREAL_RAPIDJSON_ASSERT(count_ + offset <= kCapacity); - - if (interShift == 0) { - std::memmove(digits_ + offset, digits_, count_ * sizeof(Type)); - count_ += offset; - } - else { - digits_[count_] = 0; - for (size_t i = count_; i > 0; i--) - digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); - digits_[offset] = digits_[0] << interShift; - count_ += offset; - if (digits_[count_]) - count_++; - } - - std::memset(digits_, 0, offset * sizeof(Type)); - - return *this; - } - - bool operator==(const BigInteger& rhs) const { - return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; - } - - bool operator==(const Type rhs) const { - return count_ == 1 && digits_[0] == rhs; - } - - BigInteger& MultiplyPow5(unsigned exp) { - static const uint32_t kPow5[12] = { - 5, - 5 * 5, - 5 * 5 * 5, - 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 - }; - if (exp == 0) return *this; - for (; exp >= 27; exp -= 27) *this *= CEREAL_RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 - for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 - if (exp > 0) *this *= kPow5[exp - 1]; - return *this; - } - - // Compute absolute difference of this and rhs. - // Assume this != rhs - bool Difference(const BigInteger& rhs, BigInteger* out) const { - int cmp = Compare(rhs); - CEREAL_RAPIDJSON_ASSERT(cmp != 0); - const BigInteger *a, *b; // Makes a > b - bool ret; - if (cmp < 0) { a = &rhs; b = this; ret = true; } - else { a = this; b = &rhs; ret = false; } - - Type borrow = 0; - for (size_t i = 0; i < a->count_; i++) { - Type d = a->digits_[i] - borrow; - if (i < b->count_) - d -= b->digits_[i]; - borrow = (d > a->digits_[i]) ? 1 : 0; - out->digits_[i] = d; - if (d != 0) - out->count_ = i + 1; - } - - return ret; - } - - int Compare(const BigInteger& rhs) const { - if (count_ != rhs.count_) - return count_ < rhs.count_ ? -1 : 1; - - for (size_t i = count_; i-- > 0;) - if (digits_[i] != rhs.digits_[i]) - return digits_[i] < rhs.digits_[i] ? -1 : 1; - - return 0; - } - - size_t GetCount() const { return count_; } - Type GetDigit(size_t index) const { CEREAL_RAPIDJSON_ASSERT(index < count_); return digits_[index]; } - bool IsZero() const { return count_ == 1 && digits_[0] == 0; } - -private: - void AppendDecimal64(const char* begin, const char* end) { - uint64_t u = ParseUint64(begin, end); - if (IsZero()) - *this = u; - else { - unsigned exp = static_cast(end - begin); - (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u - } - } - - void PushBack(Type digit) { - CEREAL_RAPIDJSON_ASSERT(count_ < kCapacity); - digits_[count_++] = digit; - } - - static uint64_t ParseUint64(const char* begin, const char* end) { - uint64_t r = 0; - for (const char* p = begin; p != end; ++p) { - CEREAL_RAPIDJSON_ASSERT(*p >= '0' && *p <= '9'); - r = r * 10u + static_cast(*p - '0'); - } - return r; - } - - // Assume a * b + k < 2^128 - static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t low = _umul128(a, b, outHigh) + k; - if (low < k) - (*outHigh)++; - return low; -#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(a) * static_cast(b); - p += k; - *outHigh = static_cast(p >> 64); - return static_cast(p); -#else - const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; - uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; - x1 += (x0 >> 32); // can't give carry - x1 += x2; - if (x1 < x2) - x3 += (static_cast(1) << 32); - uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); - uint64_t hi = x3 + (x1 >> 32); - - lo += k; - if (lo < k) - hi++; - *outHigh = hi; - return lo; -#endif - } - - static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 - static const size_t kCapacity = kBitCount / sizeof(Type); - static const size_t kTypeBit = sizeof(Type) * 8; - - Type digits_[kCapacity]; - size_t count_; -}; - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_BIGINTEGER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h deleted file mode 100644 index 3f92a0783..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/diyfp.h +++ /dev/null @@ -1,271 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef CEREAL_RAPIDJSON_DIYFP_H_ -#define CEREAL_RAPIDJSON_DIYFP_H_ - -#include "../rapidjson.h" -#include - -#if defined(_MSC_VER) && defined(_M_AMD64) && !defined(__INTEL_COMPILER) -#include -#pragma intrinsic(_BitScanReverse64) -#pragma intrinsic(_umul128) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#endif - -struct DiyFp { - DiyFp() : f(), e() {} - - DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} - - explicit DiyFp(double d) { - union { - double d; - uint64_t u64; - } u = { d }; - - int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); - uint64_t significand = (u.u64 & kDpSignificandMask); - if (biased_e != 0) { - f = significand + kDpHiddenBit; - e = biased_e - kDpExponentBias; - } - else { - f = significand; - e = kDpMinExponent + 1; - } - } - - DiyFp operator-(const DiyFp& rhs) const { - return DiyFp(f - rhs.f, e); - } - - DiyFp operator*(const DiyFp& rhs) const { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t h; - uint64_t l = _umul128(f, rhs.f, &h); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(f) * static_cast(rhs.f); - uint64_t h = static_cast(p >> 64); - uint64_t l = static_cast(p); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#else - const uint64_t M32 = 0xFFFFFFFF; - const uint64_t a = f >> 32; - const uint64_t b = f & M32; - const uint64_t c = rhs.f >> 32; - const uint64_t d = rhs.f & M32; - const uint64_t ac = a * c; - const uint64_t bc = b * c; - const uint64_t ad = a * d; - const uint64_t bd = b * d; - uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); - tmp += 1U << 31; /// mult_round - return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); -#endif - } - - DiyFp Normalize() const { - CEREAL_RAPIDJSON_ASSERT(f != 0); // https://stackoverflow.com/a/26809183/291737 -#if defined(_MSC_VER) && defined(_M_AMD64) - unsigned long index; - _BitScanReverse64(&index, f); - return DiyFp(f << (63 - index), e - (63 - index)); -#elif defined(__GNUC__) && __GNUC__ >= 4 - int s = __builtin_clzll(f); - return DiyFp(f << s, e - s); -#else - DiyFp res = *this; - while (!(res.f & (static_cast(1) << 63))) { - res.f <<= 1; - res.e--; - } - return res; -#endif - } - - DiyFp NormalizeBoundary() const { - DiyFp res = *this; - while (!(res.f & (kDpHiddenBit << 1))) { - res.f <<= 1; - res.e--; - } - res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); - res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); - return res; - } - - void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { - DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); - DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); - mi.f <<= mi.e - pl.e; - mi.e = pl.e; - *plus = pl; - *minus = mi; - } - - double ToDouble() const { - union { - double d; - uint64_t u64; - }u; - CEREAL_RAPIDJSON_ASSERT(f <= kDpHiddenBit + kDpSignificandMask); - if (e < kDpDenormalExponent) { - // Underflow. - return 0.0; - } - if (e >= kDpMaxExponent) { - // Overflow. - return std::numeric_limits::infinity(); - } - const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : - static_cast(e + kDpExponentBias); - u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); - return u.d; - } - - static const int kDiySignificandSize = 64; - static const int kDpSignificandSize = 52; - static const int kDpExponentBias = 0x3FF + kDpSignificandSize; - static const int kDpMaxExponent = 0x7FF - kDpExponentBias; - static const int kDpMinExponent = -kDpExponentBias; - static const int kDpDenormalExponent = -kDpExponentBias + 1; - static const uint64_t kDpExponentMask = CEREAL_RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kDpSignificandMask = CEREAL_RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kDpHiddenBit = CEREAL_RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - uint64_t f; - int e; -}; - -inline DiyFp GetCachedPowerByIndex(size_t index) { - // 10^-348, 10^-340, ..., 10^340 - static const uint64_t kCachedPowers_F[] = { - CEREAL_RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), CEREAL_RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), - CEREAL_RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), CEREAL_RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), - CEREAL_RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), CEREAL_RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), - CEREAL_RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), CEREAL_RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), - CEREAL_RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), CEREAL_RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), - CEREAL_RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), CEREAL_RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), - CEREAL_RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), CEREAL_RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), - CEREAL_RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), CEREAL_RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), - CEREAL_RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), CEREAL_RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), - CEREAL_RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), CEREAL_RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), - CEREAL_RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), CEREAL_RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), - CEREAL_RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), CEREAL_RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), - CEREAL_RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), CEREAL_RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), - CEREAL_RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), CEREAL_RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), - CEREAL_RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), CEREAL_RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), - CEREAL_RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), CEREAL_RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), - CEREAL_RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), CEREAL_RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), - CEREAL_RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), CEREAL_RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), - CEREAL_RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), CEREAL_RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), - CEREAL_RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), CEREAL_RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), - CEREAL_RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), CEREAL_RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), - CEREAL_RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), CEREAL_RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), - CEREAL_RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), CEREAL_RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), - CEREAL_RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), CEREAL_RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), - CEREAL_RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), CEREAL_RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), - CEREAL_RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), CEREAL_RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), - CEREAL_RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), CEREAL_RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), - CEREAL_RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), CEREAL_RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), - CEREAL_RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), CEREAL_RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), - CEREAL_RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), CEREAL_RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), - CEREAL_RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), CEREAL_RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), - CEREAL_RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), CEREAL_RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), - CEREAL_RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), CEREAL_RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), - CEREAL_RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), CEREAL_RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), - CEREAL_RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), CEREAL_RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), - CEREAL_RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), CEREAL_RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), - CEREAL_RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), CEREAL_RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), - CEREAL_RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), CEREAL_RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), - CEREAL_RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), CEREAL_RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), - CEREAL_RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), CEREAL_RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), - CEREAL_RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), CEREAL_RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), - CEREAL_RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), CEREAL_RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), - CEREAL_RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), CEREAL_RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), - CEREAL_RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) - }; - static const int16_t kCachedPowers_E[] = { - -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, - -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, - -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, - -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, - -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, - 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, - 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, - 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, - 907, 933, 960, 986, 1013, 1039, 1066 - }; - CEREAL_RAPIDJSON_ASSERT(index < 87); - return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); -} - -inline DiyFp GetCachedPower(int e, int* K) { - - //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; - double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive - int k = static_cast(dk); - if (dk - k > 0.0) - k++; - - unsigned index = static_cast((k >> 3) + 1); - *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table - - return GetCachedPowerByIndex(index); -} - -inline DiyFp GetCachedPower10(int exp, int *outExp) { - CEREAL_RAPIDJSON_ASSERT(exp >= -348); - unsigned index = static_cast(exp + 348) / 8u; - *outExp = -348 + static_cast(index) * 8; - return GetCachedPowerByIndex(index); -} - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#endif - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_DIYFP_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h deleted file mode 100644 index ea62b349c..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/dtoa.h +++ /dev/null @@ -1,245 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef CEREAL_RAPIDJSON_DTOA_ -#define CEREAL_RAPIDJSON_DTOA_ - -#include "itoa.h" // GetDigitsLut() -#include "diyfp.h" -#include "ieee754.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -CEREAL_RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 -#endif - -inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { - while (rest < wp_w && delta - rest >= ten_kappa && - (rest + ten_kappa < wp_w || /// closer - wp_w - rest > rest + ten_kappa - wp_w)) { - buffer[len - 1]--; - rest += ten_kappa; - } -} - -inline int CountDecimalDigit32(uint32_t n) { - // Simple pure C++ implementation was faster than __builtin_clz version in this situation. - if (n < 10) return 1; - if (n < 100) return 2; - if (n < 1000) return 3; - if (n < 10000) return 4; - if (n < 100000) return 5; - if (n < 1000000) return 6; - if (n < 10000000) return 7; - if (n < 100000000) return 8; - // Will not reach 10 digits in DigitGen() - //if (n < 1000000000) return 9; - //return 10; - return 9; -} - -inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { - static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; - const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); - const DiyFp wp_w = Mp - W; - uint32_t p1 = static_cast(Mp.f >> -one.e); - uint64_t p2 = Mp.f & (one.f - 1); - int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] - *len = 0; - - while (kappa > 0) { - uint32_t d = 0; - switch (kappa) { - case 9: d = p1 / 100000000; p1 %= 100000000; break; - case 8: d = p1 / 10000000; p1 %= 10000000; break; - case 7: d = p1 / 1000000; p1 %= 1000000; break; - case 6: d = p1 / 100000; p1 %= 100000; break; - case 5: d = p1 / 10000; p1 %= 10000; break; - case 4: d = p1 / 1000; p1 %= 1000; break; - case 3: d = p1 / 100; p1 %= 100; break; - case 2: d = p1 / 10; p1 %= 10; break; - case 1: d = p1; p1 = 0; break; - default:; - } - if (d || *len) - buffer[(*len)++] = static_cast('0' + static_cast(d)); - kappa--; - uint64_t tmp = (static_cast(p1) << -one.e) + p2; - if (tmp <= delta) { - *K += kappa; - GrisuRound(buffer, *len, delta, tmp, static_cast(kPow10[kappa]) << -one.e, wp_w.f); - return; - } - } - - // kappa = 0 - for (;;) { - p2 *= 10; - delta *= 10; - char d = static_cast(p2 >> -one.e); - if (d || *len) - buffer[(*len)++] = static_cast('0' + d); - p2 &= one.f - 1; - kappa--; - if (p2 < delta) { - *K += kappa; - int index = -kappa; - GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? kPow10[index] : 0)); - return; - } - } -} - -inline void Grisu2(double value, char* buffer, int* length, int* K) { - const DiyFp v(value); - DiyFp w_m, w_p; - v.NormalizedBoundaries(&w_m, &w_p); - - const DiyFp c_mk = GetCachedPower(w_p.e, K); - const DiyFp W = v.Normalize() * c_mk; - DiyFp Wp = w_p * c_mk; - DiyFp Wm = w_m * c_mk; - Wm.f++; - Wp.f--; - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); -} - -inline char* WriteExponent(int K, char* buffer) { - if (K < 0) { - *buffer++ = '-'; - K = -K; - } - - if (K >= 100) { - *buffer++ = static_cast('0' + static_cast(K / 100)); - K %= 100; - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else if (K >= 10) { - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else - *buffer++ = static_cast('0' + static_cast(K)); - - return buffer; -} - -inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { - const int kk = length + k; // 10^(kk-1) <= v < 10^kk - - if (0 <= k && kk <= 21) { - // 1234e7 -> 12340000000 - for (int i = length; i < kk; i++) - buffer[i] = '0'; - buffer[kk] = '.'; - buffer[kk + 1] = '0'; - return &buffer[kk + 2]; - } - else if (0 < kk && kk <= 21) { - // 1234e-2 -> 12.34 - std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); - buffer[kk] = '.'; - if (0 > k + maxDecimalPlaces) { - // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 - // Remove extra trailing zeros (at least one) after truncation. - for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) - if (buffer[i] != '0') - return &buffer[i + 1]; - return &buffer[kk + 2]; // Reserve one zero - } - else - return &buffer[length + 1]; - } - else if (-6 < kk && kk <= 0) { - // 1234e-6 -> 0.001234 - const int offset = 2 - kk; - std::memmove(&buffer[offset], &buffer[0], static_cast(length)); - buffer[0] = '0'; - buffer[1] = '.'; - for (int i = 2; i < offset; i++) - buffer[i] = '0'; - if (length - kk > maxDecimalPlaces) { - // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 - // Remove extra trailing zeros (at least one) after truncation. - for (int i = maxDecimalPlaces + 1; i > 2; i--) - if (buffer[i] != '0') - return &buffer[i + 1]; - return &buffer[3]; // Reserve one zero - } - else - return &buffer[length + offset]; - } - else if (kk < -maxDecimalPlaces) { - // Truncate to zero - buffer[0] = '0'; - buffer[1] = '.'; - buffer[2] = '0'; - return &buffer[3]; - } - else if (length == 1) { - // 1e30 - buffer[1] = 'e'; - return WriteExponent(kk - 1, &buffer[2]); - } - else { - // 1234e30 -> 1.234e33 - std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); - buffer[1] = '.'; - buffer[length + 1] = 'e'; - return WriteExponent(kk - 1, &buffer[0 + length + 2]); - } -} - -inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { - CEREAL_RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - Double d(value); - if (d.IsZero()) { - if (d.Sign()) - *buffer++ = '-'; // -0.0, Issue #289 - buffer[0] = '0'; - buffer[1] = '.'; - buffer[2] = '0'; - return &buffer[3]; - } - else { - if (value < 0) { - *buffer++ = '-'; - value = -value; - } - int length, K; - Grisu2(value, buffer, &length, &K); - return Prettify(buffer, length, K, maxDecimalPlaces); - } -} - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_DTOA_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h deleted file mode 100644 index 6730dfdc5..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/ieee754.h +++ /dev/null @@ -1,78 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_IEEE754_ -#define CEREAL_RAPIDJSON_IEEE754_ - -#include "../rapidjson.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class Double { -public: - Double() {} - Double(double d) : d_(d) {} - Double(uint64_t u) : u_(u) {} - - double Value() const { return d_; } - uint64_t Uint64Value() const { return u_; } - - double NextPositiveDouble() const { - CEREAL_RAPIDJSON_ASSERT(!Sign()); - return Double(u_ + 1).Value(); - } - - bool Sign() const { return (u_ & kSignMask) != 0; } - uint64_t Significand() const { return u_ & kSignificandMask; } - int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } - - bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } - bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } - bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } - bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } - bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } - - uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } - int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } - uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } - - static int EffectiveSignificandSize(int order) { - if (order >= -1021) - return 53; - else if (order <= -1074) - return 0; - else - return order + 1074; - } - -private: - static const int kSignificandSize = 52; - static const int kExponentBias = 0x3FF; - static const int kDenormalExponent = 1 - kExponentBias; - static const uint64_t kSignMask = CEREAL_RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); - static const uint64_t kExponentMask = CEREAL_RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kSignificandMask = CEREAL_RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kHiddenBit = CEREAL_RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - union { - double d_; - uint64_t u_; - }; -}; - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_IEEE754_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h deleted file mode 100644 index f04e3fa83..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/itoa.h +++ /dev/null @@ -1,308 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ITOA_ -#define CEREAL_RAPIDJSON_ITOA_ - -#include "../rapidjson.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline const char* GetDigitsLut() { - static const char cDigitsLut[200] = { - '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', - '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', - '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', - '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', - '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', - '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', - '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', - '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', - '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', - '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' - }; - return cDigitsLut; -} - -inline char* u32toa(uint32_t value, char* buffer) { - CEREAL_RAPIDJSON_ASSERT(buffer != 0); - - const char* cDigitsLut = GetDigitsLut(); - - if (value < 10000) { - const uint32_t d1 = (value / 100) << 1; - const uint32_t d2 = (value % 100) << 1; - - if (value >= 1000) - *buffer++ = cDigitsLut[d1]; - if (value >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else if (value < 100000000) { - // value = bbbbcccc - const uint32_t b = value / 10000; - const uint32_t c = value % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - else { - // value = aabbbbcccc in decimal - - const uint32_t a = value / 100000000; // 1 to 42 - value %= 100000000; - - if (a >= 10) { - const unsigned i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else - *buffer++ = static_cast('0' + static_cast(a)); - - const uint32_t b = value / 10000; // 0 to 9999 - const uint32_t c = value % 10000; // 0 to 9999 - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - return buffer; -} - -inline char* i32toa(int32_t value, char* buffer) { - CEREAL_RAPIDJSON_ASSERT(buffer != 0); - uint32_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u32toa(u, buffer); -} - -inline char* u64toa(uint64_t value, char* buffer) { - CEREAL_RAPIDJSON_ASSERT(buffer != 0); - const char* cDigitsLut = GetDigitsLut(); - const uint64_t kTen8 = 100000000; - const uint64_t kTen9 = kTen8 * 10; - const uint64_t kTen10 = kTen8 * 100; - const uint64_t kTen11 = kTen8 * 1000; - const uint64_t kTen12 = kTen8 * 10000; - const uint64_t kTen13 = kTen8 * 100000; - const uint64_t kTen14 = kTen8 * 1000000; - const uint64_t kTen15 = kTen8 * 10000000; - const uint64_t kTen16 = kTen8 * kTen8; - - if (value < kTen8) { - uint32_t v = static_cast(value); - if (v < 10000) { - const uint32_t d1 = (v / 100) << 1; - const uint32_t d2 = (v % 100) << 1; - - if (v >= 1000) - *buffer++ = cDigitsLut[d1]; - if (v >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (v >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else { - // value = bbbbcccc - const uint32_t b = v / 10000; - const uint32_t c = v % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - } - else if (value < kTen16) { - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - if (value >= kTen15) - *buffer++ = cDigitsLut[d1]; - if (value >= kTen14) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= kTen13) - *buffer++ = cDigitsLut[d2]; - if (value >= kTen12) - *buffer++ = cDigitsLut[d2 + 1]; - if (value >= kTen11) - *buffer++ = cDigitsLut[d3]; - if (value >= kTen10) - *buffer++ = cDigitsLut[d3 + 1]; - if (value >= kTen9) - *buffer++ = cDigitsLut[d4]; - - *buffer++ = cDigitsLut[d4 + 1]; - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - else { - const uint32_t a = static_cast(value / kTen16); // 1 to 1844 - value %= kTen16; - - if (a < 10) - *buffer++ = static_cast('0' + static_cast(a)); - else if (a < 100) { - const uint32_t i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else if (a < 1000) { - *buffer++ = static_cast('0' + static_cast(a / 100)); - - const uint32_t i = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else { - const uint32_t i = (a / 100) << 1; - const uint32_t j = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - *buffer++ = cDigitsLut[j]; - *buffer++ = cDigitsLut[j + 1]; - } - - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - - return buffer; -} - -inline char* i64toa(int64_t value, char* buffer) { - CEREAL_RAPIDJSON_ASSERT(buffer != 0); - uint64_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u64toa(u, buffer); -} - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_ITOA_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h deleted file mode 100644 index f511ff8ff..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/meta.h +++ /dev/null @@ -1,186 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_INTERNAL_META_H_ -#define CEREAL_RAPIDJSON_INTERNAL_META_H_ - -#include "../rapidjson.h" - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(_MSC_VER) && !defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(6334) -#endif - -#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS -#include -#endif - -//@cond CEREAL_RAPIDJSON_INTERNAL -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching -template struct Void { typedef void Type; }; - -/////////////////////////////////////////////////////////////////////////////// -// BoolType, TrueType, FalseType -// -template struct BoolType { - static const bool Value = Cond; - typedef BoolType Type; -}; -typedef BoolType TrueType; -typedef BoolType FalseType; - - -/////////////////////////////////////////////////////////////////////////////// -// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr -// - -template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; -template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; -template struct SelectIfCond : SelectIfImpl::template Apply {}; -template struct SelectIf : SelectIfCond {}; - -template struct AndExprCond : FalseType {}; -template <> struct AndExprCond : TrueType {}; -template struct OrExprCond : TrueType {}; -template <> struct OrExprCond : FalseType {}; - -template struct BoolExpr : SelectIf::Type {}; -template struct NotExpr : SelectIf::Type {}; -template struct AndExpr : AndExprCond::Type {}; -template struct OrExpr : OrExprCond::Type {}; - - -/////////////////////////////////////////////////////////////////////////////// -// AddConst, MaybeAddConst, RemoveConst -template struct AddConst { typedef const T Type; }; -template struct MaybeAddConst : SelectIfCond {}; -template struct RemoveConst { typedef T Type; }; -template struct RemoveConst { typedef T Type; }; - - -/////////////////////////////////////////////////////////////////////////////// -// IsSame, IsConst, IsMoreConst, IsPointer -// -template struct IsSame : FalseType {}; -template struct IsSame : TrueType {}; - -template struct IsConst : FalseType {}; -template struct IsConst : TrueType {}; - -template -struct IsMoreConst - : AndExpr::Type, typename RemoveConst::Type>, - BoolType::Value >= IsConst::Value> >::Type {}; - -template struct IsPointer : FalseType {}; -template struct IsPointer : TrueType {}; - -/////////////////////////////////////////////////////////////////////////////// -// IsBaseOf -// -#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS - -template struct IsBaseOf - : BoolType< ::std::is_base_of::value> {}; - -#else // simplified version adopted from Boost - -template struct IsBaseOfImpl { - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); - CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); - - typedef char (&Yes)[1]; - typedef char (&No) [2]; - - template - static Yes Check(const D*, T); - static No Check(const B*, int); - - struct Host { - operator const B*() const; - operator const D*(); - }; - - enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; -}; - -template struct IsBaseOf - : OrExpr, BoolExpr > >::Type {}; - -#endif // CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS - - -////////////////////////////////////////////////////////////////////////// -// EnableIf / DisableIf -// -template struct EnableIfCond { typedef T Type; }; -template struct EnableIfCond { /* empty */ }; - -template struct DisableIfCond { typedef T Type; }; -template struct DisableIfCond { /* empty */ }; - -template -struct EnableIf : EnableIfCond {}; - -template -struct DisableIf : DisableIfCond {}; - -// SFINAE helpers -struct SfinaeTag {}; -template struct RemoveSfinaeTag; -template struct RemoveSfinaeTag { typedef T Type; }; - -#define CEREAL_RAPIDJSON_REMOVEFPTR_(type) \ - typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ - < ::CEREAL_RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type - -#define CEREAL_RAPIDJSON_ENABLEIF(cond) \ - typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type * = NULL - -#define CEREAL_RAPIDJSON_DISABLEIF(cond) \ - typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type * = NULL - -#define CEREAL_RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ - typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type - -#define CEREAL_RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ - typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END -//@endcond - -#if defined(_MSC_VER) && !defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_INTERNAL_META_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h deleted file mode 100644 index 7f796a153..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/pow10.h +++ /dev/null @@ -1,55 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_POW10_ -#define CEREAL_RAPIDJSON_POW10_ - -#include "../rapidjson.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Computes integer powers of 10 in double (10.0^n). -/*! This function uses lookup table for fast and accurate results. - \param n non-negative exponent. Must <= 308. - \return 10.0^n -*/ -inline double Pow10(int n) { - static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes - 1e+0, - 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, - 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, - 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, - 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, - 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, - 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, - 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, - 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, - 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, - 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, - 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, - 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, - 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, - 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, - 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, - 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 - }; - CEREAL_RAPIDJSON_ASSERT(n >= 0 && n <= 308); - return e[n]; -} - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_POW10_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h deleted file mode 100644 index 6c2ed6eff..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/regex.h +++ /dev/null @@ -1,740 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ -#define CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ - -#include "../allocators.h" -#include "../stream.h" -#include "stack.h" - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) -CEREAL_RAPIDJSON_DIAG_OFF(implicit-fallthrough) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#if __GNUC__ >= 7 -CEREAL_RAPIDJSON_DIAG_OFF(implicit-fallthrough) -#endif -#endif - -#ifndef CEREAL_RAPIDJSON_REGEX_VERBOSE -#define CEREAL_RAPIDJSON_REGEX_VERBOSE 0 -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -/////////////////////////////////////////////////////////////////////////////// -// DecodedStream - -template -class DecodedStream { -public: - DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); } - unsigned Peek() { return codepoint_; } - unsigned Take() { - unsigned c = codepoint_; - if (c) // No further decoding when '\0' - Decode(); - return c; - } - -private: - void Decode() { - if (!Encoding::Decode(ss_, &codepoint_)) - codepoint_ = 0; - } - - SourceStream& ss_; - unsigned codepoint_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericRegex - -static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1 -static const SizeType kRegexInvalidRange = ~SizeType(0); - -template -class GenericRegexSearch; - -//! Regular expression engine with subset of ECMAscript grammar. -/*! - Supported regular expression syntax: - - \c ab Concatenation - - \c a|b Alternation - - \c a? Zero or one - - \c a* Zero or more - - \c a+ One or more - - \c a{3} Exactly 3 times - - \c a{3,} At least 3 times - - \c a{3,5} 3 to 5 times - - \c (ab) Grouping - - \c ^a At the beginning - - \c a$ At the end - - \c . Any character - - \c [abc] Character classes - - \c [a-c] Character class range - - \c [a-z0-9_] Character class combination - - \c [^abc] Negated character classes - - \c [^a-c] Negated character class range - - \c [\b] Backspace (U+0008) - - \c \\| \\\\ ... Escape characters - - \c \\f Form feed (U+000C) - - \c \\n Line feed (U+000A) - - \c \\r Carriage return (U+000D) - - \c \\t Tab (U+0009) - - \c \\v Vertical tab (U+000B) - - \note This is a Thompson NFA engine, implemented with reference to - Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", - https://swtch.com/~rsc/regexp/regexp1.html -*/ -template -class GenericRegex { -public: - typedef Encoding EncodingType; - typedef typename Encoding::Ch Ch; - template friend class GenericRegexSearch; - - GenericRegex(const Ch* source, Allocator* allocator = 0) : - ownAllocator_(allocator ? 0 : CEREAL_RAPIDJSON_NEW(Allocator)()), allocator_(allocator ? allocator : ownAllocator_), - states_(allocator_, 256), ranges_(allocator_, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(), - anchorBegin_(), anchorEnd_() - { - GenericStringStream ss(source); - DecodedStream, Encoding> ds(ss); - Parse(ds); - } - - ~GenericRegex() - { - CEREAL_RAPIDJSON_DELETE(ownAllocator_); - } - - bool IsValid() const { - return root_ != kRegexInvalidState; - } - -private: - enum Operator { - kZeroOrOne, - kZeroOrMore, - kOneOrMore, - kConcatenation, - kAlternation, - kLeftParenthesis - }; - - static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.' - static const unsigned kRangeCharacterClass = 0xFFFFFFFE; - static const unsigned kRangeNegationFlag = 0x80000000; - - struct Range { - unsigned start; // - unsigned end; - SizeType next; - }; - - struct State { - SizeType out; //!< Equals to kInvalid for matching state - SizeType out1; //!< Equals to non-kInvalid for split - SizeType rangeStart; - unsigned codepoint; - }; - - struct Frag { - Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {} - SizeType start; - SizeType out; //!< link-list of all output states - SizeType minIndex; - }; - - State& GetState(SizeType index) { - CEREAL_RAPIDJSON_ASSERT(index < stateCount_); - return states_.template Bottom()[index]; - } - - const State& GetState(SizeType index) const { - CEREAL_RAPIDJSON_ASSERT(index < stateCount_); - return states_.template Bottom()[index]; - } - - Range& GetRange(SizeType index) { - CEREAL_RAPIDJSON_ASSERT(index < rangeCount_); - return ranges_.template Bottom()[index]; - } - - const Range& GetRange(SizeType index) const { - CEREAL_RAPIDJSON_ASSERT(index < rangeCount_); - return ranges_.template Bottom()[index]; - } - - template - void Parse(DecodedStream& ds) { - Stack operandStack(allocator_, 256); // Frag - Stack operatorStack(allocator_, 256); // Operator - Stack atomCountStack(allocator_, 256); // unsigned (Atom per parenthesis) - - *atomCountStack.template Push() = 0; - - unsigned codepoint; - while (ds.Peek() != 0) { - switch (codepoint = ds.Take()) { - case '^': - anchorBegin_ = true; - break; - - case '$': - anchorEnd_ = true; - break; - - case '|': - while (!operatorStack.Empty() && *operatorStack.template Top() < kAlternation) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - *operatorStack.template Push() = kAlternation; - *atomCountStack.template Top() = 0; - break; - - case '(': - *operatorStack.template Push() = kLeftParenthesis; - *atomCountStack.template Push() = 0; - break; - - case ')': - while (!operatorStack.Empty() && *operatorStack.template Top() != kLeftParenthesis) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - if (operatorStack.Empty()) - return; - operatorStack.template Pop(1); - atomCountStack.template Pop(1); - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '?': - if (!Eval(operandStack, kZeroOrOne)) - return; - break; - - case '*': - if (!Eval(operandStack, kZeroOrMore)) - return; - break; - - case '+': - if (!Eval(operandStack, kOneOrMore)) - return; - break; - - case '{': - { - unsigned n, m; - if (!ParseUnsigned(ds, &n)) - return; - - if (ds.Peek() == ',') { - ds.Take(); - if (ds.Peek() == '}') - m = kInfinityQuantifier; - else if (!ParseUnsigned(ds, &m) || m < n) - return; - } - else - m = n; - - if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}') - return; - ds.Take(); - } - break; - - case '.': - PushOperand(operandStack, kAnyCharacterClass); - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '[': - { - SizeType range; - if (!ParseRange(ds, &range)) - return; - SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass); - GetState(s).rangeStart = range; - *operandStack.template Push() = Frag(s, s, s); - } - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '\\': // Escape character - if (!CharacterEscape(ds, &codepoint)) - return; // Unsupported escape character - // fall through to default - - default: // Pattern character - PushOperand(operandStack, codepoint); - ImplicitConcatenation(atomCountStack, operatorStack); - } - } - - while (!operatorStack.Empty()) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - - // Link the operand to matching state. - if (operandStack.GetSize() == sizeof(Frag)) { - Frag* e = operandStack.template Pop(1); - Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0)); - root_ = e->start; - -#if CEREAL_RAPIDJSON_REGEX_VERBOSE - printf("root: %d\n", root_); - for (SizeType i = 0; i < stateCount_ ; i++) { - State& s = GetState(i); - printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint); - } - printf("\n"); -#endif - } - } - - SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) { - State* s = states_.template Push(); - s->out = out; - s->out1 = out1; - s->codepoint = codepoint; - s->rangeStart = kRegexInvalidRange; - return stateCount_++; - } - - void PushOperand(Stack& operandStack, unsigned codepoint) { - SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint); - *operandStack.template Push() = Frag(s, s, s); - } - - void ImplicitConcatenation(Stack& atomCountStack, Stack& operatorStack) { - if (*atomCountStack.template Top()) - *operatorStack.template Push() = kConcatenation; - (*atomCountStack.template Top())++; - } - - SizeType Append(SizeType l1, SizeType l2) { - SizeType old = l1; - while (GetState(l1).out != kRegexInvalidState) - l1 = GetState(l1).out; - GetState(l1).out = l2; - return old; - } - - void Patch(SizeType l, SizeType s) { - for (SizeType next; l != kRegexInvalidState; l = next) { - next = GetState(l).out; - GetState(l).out = s; - } - } - - bool Eval(Stack& operandStack, Operator op) { - switch (op) { - case kConcatenation: - CEREAL_RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2); - { - Frag e2 = *operandStack.template Pop(1); - Frag e1 = *operandStack.template Pop(1); - Patch(e1.out, e2.start); - *operandStack.template Push() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex)); - } - return true; - - case kAlternation: - if (operandStack.GetSize() >= sizeof(Frag) * 2) { - Frag e2 = *operandStack.template Pop(1); - Frag e1 = *operandStack.template Pop(1); - SizeType s = NewState(e1.start, e2.start, 0); - *operandStack.template Push() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex)); - return true; - } - return false; - - case kZeroOrOne: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - *operandStack.template Push() = Frag(s, Append(e.out, s), e.minIndex); - return true; - } - return false; - - case kZeroOrMore: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - Patch(e.out, s); - *operandStack.template Push() = Frag(s, s, e.minIndex); - return true; - } - return false; - - case kOneOrMore: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - Patch(e.out, s); - *operandStack.template Push() = Frag(e.start, s, e.minIndex); - return true; - } - return false; - - default: - // syntax error (e.g. unclosed kLeftParenthesis) - return false; - } - } - - bool EvalQuantifier(Stack& operandStack, unsigned n, unsigned m) { - CEREAL_RAPIDJSON_ASSERT(n <= m); - CEREAL_RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag)); - - if (n == 0) { - if (m == 0) // a{0} not support - return false; - else if (m == kInfinityQuantifier) - Eval(operandStack, kZeroOrMore); // a{0,} -> a* - else { - Eval(operandStack, kZeroOrOne); // a{0,5} -> a? - for (unsigned i = 0; i < m - 1; i++) - CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a? - for (unsigned i = 0; i < m - 1; i++) - Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a? - } - return true; - } - - for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a - CloneTopOperand(operandStack); - - if (m == kInfinityQuantifier) - Eval(operandStack, kOneOrMore); // a{3,} -> a a a+ - else if (m > n) { - CloneTopOperand(operandStack); // a{3,5} -> a a a a - Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a? - for (unsigned i = n; i < m - 1; i++) - CloneTopOperand(operandStack); // a{3,5} -> a a a a? a? - for (unsigned i = n; i < m; i++) - Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a? - } - - for (unsigned i = 0; i < n - 1; i++) - Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a? - - return true; - } - - static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; } - - void CloneTopOperand(Stack& operandStack) { - const Frag src = *operandStack.template Top(); // Copy constructor to prevent invalidation - SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_) - State* s = states_.template Push(count); - memcpy(s, &GetState(src.minIndex), count * sizeof(State)); - for (SizeType j = 0; j < count; j++) { - if (s[j].out != kRegexInvalidState) - s[j].out += count; - if (s[j].out1 != kRegexInvalidState) - s[j].out1 += count; - } - *operandStack.template Push() = Frag(src.start + count, src.out + count, src.minIndex + count); - stateCount_ += count; - } - - template - bool ParseUnsigned(DecodedStream& ds, unsigned* u) { - unsigned r = 0; - if (ds.Peek() < '0' || ds.Peek() > '9') - return false; - while (ds.Peek() >= '0' && ds.Peek() <= '9') { - if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295 - return false; // overflow - r = r * 10 + (ds.Take() - '0'); - } - *u = r; - return true; - } - - template - bool ParseRange(DecodedStream& ds, SizeType* range) { - bool isBegin = true; - bool negate = false; - int step = 0; - SizeType start = kRegexInvalidRange; - SizeType current = kRegexInvalidRange; - unsigned codepoint; - while ((codepoint = ds.Take()) != 0) { - if (isBegin) { - isBegin = false; - if (codepoint == '^') { - negate = true; - continue; - } - } - - switch (codepoint) { - case ']': - if (start == kRegexInvalidRange) - return false; // Error: nothing inside [] - if (step == 2) { // Add trailing '-' - SizeType r = NewRange('-'); - CEREAL_RAPIDJSON_ASSERT(current != kRegexInvalidRange); - GetRange(current).next = r; - } - if (negate) - GetRange(start).start |= kRangeNegationFlag; - *range = start; - return true; - - case '\\': - if (ds.Peek() == 'b') { - ds.Take(); - codepoint = 0x0008; // Escape backspace character - } - else if (!CharacterEscape(ds, &codepoint)) - return false; - // fall through to default - - default: - switch (step) { - case 1: - if (codepoint == '-') { - step++; - break; - } - // fall through to step 0 for other characters - - case 0: - { - SizeType r = NewRange(codepoint); - if (current != kRegexInvalidRange) - GetRange(current).next = r; - if (start == kRegexInvalidRange) - start = r; - current = r; - } - step = 1; - break; - - default: - CEREAL_RAPIDJSON_ASSERT(step == 2); - GetRange(current).end = codepoint; - step = 0; - } - } - } - return false; - } - - SizeType NewRange(unsigned codepoint) { - Range* r = ranges_.template Push(); - r->start = r->end = codepoint; - r->next = kRegexInvalidRange; - return rangeCount_++; - } - - template - bool CharacterEscape(DecodedStream& ds, unsigned* escapedCodepoint) { - unsigned codepoint; - switch (codepoint = ds.Take()) { - case '^': - case '$': - case '|': - case '(': - case ')': - case '?': - case '*': - case '+': - case '.': - case '[': - case ']': - case '{': - case '}': - case '\\': - *escapedCodepoint = codepoint; return true; - case 'f': *escapedCodepoint = 0x000C; return true; - case 'n': *escapedCodepoint = 0x000A; return true; - case 'r': *escapedCodepoint = 0x000D; return true; - case 't': *escapedCodepoint = 0x0009; return true; - case 'v': *escapedCodepoint = 0x000B; return true; - default: - return false; // Unsupported escape character - } - } - - Allocator* ownAllocator_; - Allocator* allocator_; - Stack states_; - Stack ranges_; - SizeType root_; - SizeType stateCount_; - SizeType rangeCount_; - - static const unsigned kInfinityQuantifier = ~0u; - - // For SearchWithAnchoring() - bool anchorBegin_; - bool anchorEnd_; -}; - -template -class GenericRegexSearch { -public: - typedef typename RegexType::EncodingType Encoding; - typedef typename Encoding::Ch Ch; - - GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) : - regex_(regex), allocator_(allocator), ownAllocator_(0), - state0_(allocator, 0), state1_(allocator, 0), stateSet_() - { - CEREAL_RAPIDJSON_ASSERT(regex_.IsValid()); - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - stateSet_ = static_cast(allocator_->Malloc(GetStateSetSize())); - state0_.template Reserve(regex_.stateCount_); - state1_.template Reserve(regex_.stateCount_); - } - - ~GenericRegexSearch() { - Allocator::Free(stateSet_); - CEREAL_RAPIDJSON_DELETE(ownAllocator_); - } - - template - bool Match(InputStream& is) { - return SearchWithAnchoring(is, true, true); - } - - bool Match(const Ch* s) { - GenericStringStream is(s); - return Match(is); - } - - template - bool Search(InputStream& is) { - return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_); - } - - bool Search(const Ch* s) { - GenericStringStream is(s); - return Search(is); - } - -private: - typedef typename RegexType::State State; - typedef typename RegexType::Range Range; - - template - bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) { - DecodedStream ds(is); - - state0_.Clear(); - Stack *current = &state0_, *next = &state1_; - const size_t stateSetSize = GetStateSetSize(); - std::memset(stateSet_, 0, stateSetSize); - - bool matched = AddState(*current, regex_.root_); - unsigned codepoint; - while (!current->Empty() && (codepoint = ds.Take()) != 0) { - std::memset(stateSet_, 0, stateSetSize); - next->Clear(); - matched = false; - for (const SizeType* s = current->template Bottom(); s != current->template End(); ++s) { - const State& sr = regex_.GetState(*s); - if (sr.codepoint == codepoint || - sr.codepoint == RegexType::kAnyCharacterClass || - (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint))) - { - matched = AddState(*next, sr.out) || matched; - if (!anchorEnd && matched) - return true; - } - if (!anchorBegin) - AddState(*next, regex_.root_); - } - internal::Swap(current, next); - } - - return matched; - } - - size_t GetStateSetSize() const { - return (regex_.stateCount_ + 31) / 32 * 4; - } - - // Return whether the added states is a match state - bool AddState(Stack& l, SizeType index) { - CEREAL_RAPIDJSON_ASSERT(index != kRegexInvalidState); - - const State& s = regex_.GetState(index); - if (s.out1 != kRegexInvalidState) { // Split - bool matched = AddState(l, s.out); - return AddState(l, s.out1) || matched; - } - else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) { - stateSet_[index >> 5] |= (1u << (index & 31)); - *l.template PushUnsafe() = index; - } - return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation. - } - - bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { - bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0; - while (rangeIndex != kRegexInvalidRange) { - const Range& r = regex_.GetRange(rangeIndex); - if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end) - return yes; - rangeIndex = r.next; - } - return !yes; - } - - const RegexType& regex_; - Allocator* allocator_; - Allocator* ownAllocator_; - Stack state0_; - Stack state1_; - uint32_t* stateSet_; -}; - -typedef GenericRegex > Regex; -typedef GenericRegexSearch RegexSearch; - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#if defined(__clang__) || defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_INTERNAL_REGEX_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h deleted file mode 100644 index be77088f9..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/stack.h +++ /dev/null @@ -1,232 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_INTERNAL_STACK_H_ -#define CEREAL_RAPIDJSON_INTERNAL_STACK_H_ - -#include "../allocators.h" -#include "swap.h" -#include - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -/////////////////////////////////////////////////////////////////////////////// -// Stack - -//! A type-unsafe stack for storing different types of data. -/*! \tparam Allocator Allocator for allocating stack memory. -*/ -template -class Stack { -public: - // Optimization note: Do not allocate memory for stack_ in constructor. - // Do it lazily when first Push() -> Expand() -> Resize(). - Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack(Stack&& rhs) - : allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(rhs.stack_), - stackTop_(rhs.stackTop_), - stackEnd_(rhs.stackEnd_), - initialCapacity_(rhs.initialCapacity_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } -#endif - - ~Stack() { - Destroy(); - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack& operator=(Stack&& rhs) { - if (&rhs != this) - { - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = rhs.stack_; - stackTop_ = rhs.stackTop_; - stackEnd_ = rhs.stackEnd_; - initialCapacity_ = rhs.initialCapacity_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } - return *this; - } -#endif - - void Swap(Stack& rhs) CEREAL_RAPIDJSON_NOEXCEPT { - internal::Swap(allocator_, rhs.allocator_); - internal::Swap(ownAllocator_, rhs.ownAllocator_); - internal::Swap(stack_, rhs.stack_); - internal::Swap(stackTop_, rhs.stackTop_); - internal::Swap(stackEnd_, rhs.stackEnd_); - internal::Swap(initialCapacity_, rhs.initialCapacity_); - } - - void Clear() { stackTop_ = stack_; } - - void ShrinkToFit() { - if (Empty()) { - // If the stack is empty, completely deallocate the memory. - Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc) - stack_ = 0; - stackTop_ = 0; - stackEnd_ = 0; - } - else - Resize(GetSize()); - } - - // Optimization note: try to minimize the size of this function for force inline. - // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. - template - CEREAL_RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { - // Expand the stack if needed - if (CEREAL_RAPIDJSON_UNLIKELY(static_cast(sizeof(T) * count) > (stackEnd_ - stackTop_))) - Expand(count); - } - - template - CEREAL_RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { - Reserve(count); - return PushUnsafe(count); - } - - template - CEREAL_RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { - CEREAL_RAPIDJSON_ASSERT(stackTop_); - CEREAL_RAPIDJSON_ASSERT(static_cast(sizeof(T) * count) <= (stackEnd_ - stackTop_)); - T* ret = reinterpret_cast(stackTop_); - stackTop_ += sizeof(T) * count; - return ret; - } - - template - T* Pop(size_t count) { - CEREAL_RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); - stackTop_ -= count * sizeof(T); - return reinterpret_cast(stackTop_); - } - - template - T* Top() { - CEREAL_RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); - return reinterpret_cast(stackTop_ - sizeof(T)); - } - - template - const T* Top() const { - CEREAL_RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); - return reinterpret_cast(stackTop_ - sizeof(T)); - } - - template - T* End() { return reinterpret_cast(stackTop_); } - - template - const T* End() const { return reinterpret_cast(stackTop_); } - - template - T* Bottom() { return reinterpret_cast(stack_); } - - template - const T* Bottom() const { return reinterpret_cast(stack_); } - - bool HasAllocator() const { - return allocator_ != 0; - } - - Allocator& GetAllocator() { - CEREAL_RAPIDJSON_ASSERT(allocator_); - return *allocator_; - } - - bool Empty() const { return stackTop_ == stack_; } - size_t GetSize() const { return static_cast(stackTop_ - stack_); } - size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } - -private: - template - void Expand(size_t count) { - // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. - size_t newCapacity; - if (stack_ == 0) { - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - newCapacity = initialCapacity_; - } else { - newCapacity = GetCapacity(); - newCapacity += (newCapacity + 1) / 2; - } - size_t newSize = GetSize() + sizeof(T) * count; - if (newCapacity < newSize) - newCapacity = newSize; - - Resize(newCapacity); - } - - void Resize(size_t newCapacity) { - const size_t size = GetSize(); // Backup the current size - stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); - stackTop_ = stack_ + size; - stackEnd_ = stack_ + newCapacity; - } - - void Destroy() { - Allocator::Free(stack_); - CEREAL_RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack - } - - // Prohibit copy constructor & assignment operator. - Stack(const Stack&); - Stack& operator=(const Stack&); - - Allocator* allocator_; - Allocator* ownAllocator_; - char *stack_; - char *stackTop_; - char *stackEnd_; - size_t initialCapacity_; -}; - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_STACK_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h deleted file mode 100644 index 44af229de..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strfunc.h +++ /dev/null @@ -1,69 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ -#define CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ - -#include "../stream.h" -#include - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Custom strlen() which works on different character types. -/*! \tparam Ch Character type (e.g. char, wchar_t, short) - \param s Null-terminated input string. - \return Number of characters in the string. - \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. -*/ -template -inline SizeType StrLen(const Ch* s) { - CEREAL_RAPIDJSON_ASSERT(s != 0); - const Ch* p = s; - while (*p) ++p; - return SizeType(p - s); -} - -template <> -inline SizeType StrLen(const char* s) { - return SizeType(std::strlen(s)); -} - -template <> -inline SizeType StrLen(const wchar_t* s) { - return SizeType(std::wcslen(s)); -} - -//! Returns number of code points in a encoded string. -template -bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { - CEREAL_RAPIDJSON_ASSERT(s != 0); - CEREAL_RAPIDJSON_ASSERT(outCount != 0); - GenericStringStream is(s); - const typename Encoding::Ch* end = s + length; - SizeType count = 0; - while (is.src_ < end) { - unsigned codepoint; - if (!Encoding::Decode(is, &codepoint)) - return false; - count++; - } - *outCount = count; - return true; -} - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h deleted file mode 100644 index d60c740b5..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/strtod.h +++ /dev/null @@ -1,290 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_STRTOD_ -#define CEREAL_RAPIDJSON_STRTOD_ - -#include "ieee754.h" -#include "biginteger.h" -#include "diyfp.h" -#include "pow10.h" -#include -#include - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline double FastPath(double significand, int exp) { - if (exp < -308) - return 0.0; - else if (exp >= 0) - return significand * internal::Pow10(exp); - else - return significand / internal::Pow10(-exp); -} - -inline double StrtodNormalPrecision(double d, int p) { - if (p < -308) { - // Prevent expSum < -308, making Pow10(p) = 0 - d = FastPath(d, -308); - d = FastPath(d, p + 308); - } - else - d = FastPath(d, p); - return d; -} - -template -inline T Min3(T a, T b, T c) { - T m = a; - if (m > b) m = b; - if (m > c) m = c; - return m; -} - -inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { - const Double db(b); - const uint64_t bInt = db.IntegerSignificand(); - const int bExp = db.IntegerExponent(); - const int hExp = bExp - 1; - - int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; - - // Adjust for decimal exponent - if (dExp >= 0) { - dS_Exp2 += dExp; - dS_Exp5 += dExp; - } - else { - bS_Exp2 -= dExp; - bS_Exp5 -= dExp; - hS_Exp2 -= dExp; - hS_Exp5 -= dExp; - } - - // Adjust for binary exponent - if (bExp >= 0) - bS_Exp2 += bExp; - else { - dS_Exp2 -= bExp; - hS_Exp2 -= bExp; - } - - // Adjust for half ulp exponent - if (hExp >= 0) - hS_Exp2 += hExp; - else { - dS_Exp2 -= hExp; - bS_Exp2 -= hExp; - } - - // Remove common power of two factor from all three scaled values - int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); - dS_Exp2 -= common_Exp2; - bS_Exp2 -= common_Exp2; - hS_Exp2 -= common_Exp2; - - BigInteger dS = d; - dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); - - BigInteger bS(bInt); - bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); - - BigInteger hS(1); - hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); - - BigInteger delta(0); - dS.Difference(bS, &delta); - - return delta.Compare(hS); -} - -inline bool StrtodFast(double d, int p, double* result) { - // Use fast path for string-to-double conversion if possible - // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ - if (p > 22 && p < 22 + 16) { - // Fast Path Cases In Disguise - d *= internal::Pow10(p - 22); - p = 22; - } - - if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 - *result = FastPath(d, p); - return true; - } - else - return false; -} - -// Compute an approximation and see if it is within 1/2 ULP -inline bool StrtodDiyFp(const char* decimals, int dLen, int dExp, double* result) { - uint64_t significand = 0; - int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 - for (; i < dLen; i++) { - if (significand > CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || - (significand == CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > '5')) - break; - significand = significand * 10u + static_cast(decimals[i] - '0'); - } - - if (i < dLen && decimals[i] >= '5') // Rounding - significand++; - - int remaining = dLen - i; - const int kUlpShift = 3; - const int kUlp = 1 << kUlpShift; - int64_t error = (remaining == 0) ? 0 : kUlp / 2; - - DiyFp v(significand, 0); - v = v.Normalize(); - error <<= -v.e; - - dExp += remaining; - - int actualExp; - DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); - if (actualExp != dExp) { - static const DiyFp kPow10[] = { - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6 - DiyFp(CEREAL_RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7 - }; - int adjustment = dExp - actualExp; - CEREAL_RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8); - v = v * kPow10[adjustment - 1]; - if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit - error += kUlp / 2; - } - - v = v * cachedPower; - - error += kUlp + (error == 0 ? 0 : 1); - - const int oldExp = v.e; - v = v.Normalize(); - error <<= oldExp - v.e; - - const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); - int precisionSize = 64 - effectiveSignificandSize; - if (precisionSize + kUlpShift >= 64) { - int scaleExp = (precisionSize + kUlpShift) - 63; - v.f >>= scaleExp; - v.e += scaleExp; - error = (error >> scaleExp) + 1 + kUlp; - precisionSize -= scaleExp; - } - - DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); - const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; - const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; - if (precisionBits >= halfWay + static_cast(error)) { - rounded.f++; - if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) - rounded.f >>= 1; - rounded.e++; - } - } - - *result = rounded.ToDouble(); - - return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); -} - -inline double StrtodBigInteger(double approx, const char* decimals, int dLen, int dExp) { - CEREAL_RAPIDJSON_ASSERT(dLen >= 0); - const BigInteger dInt(decimals, static_cast(dLen)); - Double a(approx); - int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); - if (cmp < 0) - return a.Value(); // within half ULP - else if (cmp == 0) { - // Round towards even - if (a.Significand() & 1) - return a.NextPositiveDouble(); - else - return a.Value(); - } - else // adjustment - return a.NextPositiveDouble(); -} - -inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) { - CEREAL_RAPIDJSON_ASSERT(d >= 0.0); - CEREAL_RAPIDJSON_ASSERT(length >= 1); - - double result = 0.0; - if (StrtodFast(d, p, &result)) - return result; - - CEREAL_RAPIDJSON_ASSERT(length <= INT_MAX); - int dLen = static_cast(length); - - CEREAL_RAPIDJSON_ASSERT(length >= decimalPosition); - CEREAL_RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX); - int dExpAdjust = static_cast(length - decimalPosition); - - CEREAL_RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust); - int dExp = exp - dExpAdjust; - - // Make sure length+dExp does not overflow - CEREAL_RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen); - - // Trim leading zeros - while (dLen > 0 && *decimals == '0') { - dLen--; - decimals++; - } - - // Trim trailing zeros - while (dLen > 0 && decimals[dLen - 1] == '0') { - dLen--; - dExp++; - } - - if (dLen == 0) { // Buffer only contains zeros. - return 0.0; - } - - // Trim right-most digits - const int kMaxDecimalDigit = 767 + 1; - if (dLen > kMaxDecimalDigit) { - dExp += dLen - kMaxDecimalDigit; - dLen = kMaxDecimalDigit; - } - - // If too small, underflow to zero. - // Any x <= 10^-324 is interpreted as zero. - if (dLen + dExp <= -324) - return 0.0; - - // If too large, overflow to infinity. - // Any x >= 10^309 is interpreted as +infinity. - if (dLen + dExp > 309) - return std::numeric_limits::infinity(); - - if (StrtodDiyFp(decimals, dLen, dExp, &result)) - return result; - - // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison - return StrtodBigInteger(result, decimals, dLen, dExp); -} - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_STRTOD_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h deleted file mode 100644 index 5d8910ce5..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/internal/swap.h +++ /dev/null @@ -1,46 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ -#define CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ - -#include "../rapidjson.h" - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Custom swap() to avoid dependency on C++ header -/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. - \note This has the same semantics as std::swap(). -*/ -template -inline void Swap(T& a, T& b) CEREAL_RAPIDJSON_NOEXCEPT { - T tmp = a; - a = b; - b = tmp; -} - -} // namespace internal -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h deleted file mode 100644 index 4df7ce3e2..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/istreamwrapper.h +++ /dev/null @@ -1,128 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ -#define CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ - -#include "stream.h" -#include -#include - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. -/*! - The classes can be wrapped including but not limited to: - - - \c std::istringstream - - \c std::stringstream - - \c std::wistringstream - - \c std::wstringstream - - \c std::ifstream - - \c std::fstream - - \c std::wifstream - - \c std::wfstream - - \tparam StreamType Class derived from \c std::basic_istream. -*/ - -template -class BasicIStreamWrapper { -public: - typedef typename StreamType::char_type Ch; - - //! Constructor. - /*! - \param stream stream opened for read. - */ - BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - Read(); - } - - //! Constructor. - /*! - \param stream stream opened for read. - \param buffer user-supplied buffer. - \param bufferSize size of buffer in bytes. Must >=4 bytes. - */ - BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - CEREAL_RAPIDJSON_ASSERT(bufferSize >= 4); - Read(); - } - - Ch Peek() const { return *current_; } - Ch Take() { Ch c = *current_; Read(); return c; } - size_t Tell() const { return count_ + static_cast(current_ - buffer_); } - - // Not implemented - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; - } - -private: - BasicIStreamWrapper(); - BasicIStreamWrapper(const BasicIStreamWrapper&); - BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); - - void Read() { - if (current_ < bufferLast_) - ++current_; - else if (!eof_) { - count_ += readCount_; - readCount_ = bufferSize_; - bufferLast_ = buffer_ + readCount_ - 1; - current_ = buffer_; - - if (!stream_.read(buffer_, static_cast(bufferSize_))) { - readCount_ = static_cast(stream_.gcount()); - *(bufferLast_ = buffer_ + readCount_) = '\0'; - eof_ = true; - } - } - } - - StreamType &stream_; - Ch peekBuffer_[4], *buffer_; - size_t bufferSize_; - Ch *bufferLast_; - Ch *current_; - size_t readCount_; - size_t count_; //!< Number of characters read - bool eof_; -}; - -typedef BasicIStreamWrapper IStreamWrapper; -typedef BasicIStreamWrapper WIStreamWrapper; - -#if defined(__clang__) || defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_ISTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h deleted file mode 100644 index 0cd75cf47..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorybuffer.h +++ /dev/null @@ -1,70 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_MEMORYBUFFER_H_ -#define CEREAL_RAPIDJSON_MEMORYBUFFER_H_ - -#include "stream.h" -#include "internal/stack.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output byte stream. -/*! - This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. - - It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. - - Differences between MemoryBuffer and StringBuffer: - 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. - 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. - - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -struct GenericMemoryBuffer { - typedef char Ch; // byte - - GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - - void Put(Ch c) { *stack_.template Push() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { stack_.ShrinkToFit(); } - Ch* Push(size_t count) { return stack_.template Push(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetBuffer() const { - return stack_.template Bottom(); - } - - size_t GetSize() const { return stack_.GetSize(); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; -}; - -typedef GenericMemoryBuffer<> MemoryBuffer; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { - std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); -} - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h deleted file mode 100644 index 326bda54f..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/memorystream.h +++ /dev/null @@ -1,71 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_MEMORYSTREAM_H_ -#define CEREAL_RAPIDJSON_MEMORYSTREAM_H_ - -#include "stream.h" - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) -CEREAL_RAPIDJSON_DIAG_OFF(missing-noreturn) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory input byte stream. -/*! - This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. - - It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. - - Differences between MemoryStream and StringStream: - 1. StringStream has encoding but MemoryStream is a byte stream. - 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. - 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). - \note implements Stream concept -*/ -struct MemoryStream { - typedef char Ch; // byte - - MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} - - Ch Peek() const { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } - Ch Take() { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } - size_t Tell() const { return static_cast(src_ - begin_); } - - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return Tell() + 4 <= size_ ? src_ : 0; - } - - const Ch* src_; //!< Current read position. - const Ch* begin_; //!< Original head of the string. - const Ch* end_; //!< End of stream. - size_t size_; //!< Size of the stream. -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE deleted file mode 100644 index e3d96f8fb..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -ISO C9x compliant stdint.h for Microsoft Visual Studio -Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 - - Copyright (c) 2006-2013 Alexander Chemeris - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the product nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h deleted file mode 100644 index 18111286b..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/inttypes.h +++ /dev/null @@ -1,316 +0,0 @@ -// ISO C9x compliant inttypes.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the product nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_INTTYPES_H_ // [ -#define _MSC_INTTYPES_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include "stdint.h" - -// miloyip: VC supports inttypes.h since VC2013 -#if _MSC_VER >= 1800 -#include -#else - -// 7.8 Format conversion of integer types - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -// 7.8.1 Macros for format specifiers - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 - -// The fprintf macros for signed integers are: -#define PRId8 "d" -#define PRIi8 "i" -#define PRIdLEAST8 "d" -#define PRIiLEAST8 "i" -#define PRIdFAST8 "d" -#define PRIiFAST8 "i" - -#define PRId16 "hd" -#define PRIi16 "hi" -#define PRIdLEAST16 "hd" -#define PRIiLEAST16 "hi" -#define PRIdFAST16 "hd" -#define PRIiFAST16 "hi" - -#define PRId32 "I32d" -#define PRIi32 "I32i" -#define PRIdLEAST32 "I32d" -#define PRIiLEAST32 "I32i" -#define PRIdFAST32 "I32d" -#define PRIiFAST32 "I32i" - -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIdLEAST64 "I64d" -#define PRIiLEAST64 "I64i" -#define PRIdFAST64 "I64d" -#define PRIiFAST64 "I64i" - -#define PRIdMAX "I64d" -#define PRIiMAX "I64i" - -#define PRIdPTR "Id" -#define PRIiPTR "Ii" - -// The fprintf macros for unsigned integers are: -#define PRIo8 "o" -#define PRIu8 "u" -#define PRIx8 "x" -#define PRIX8 "X" -#define PRIoLEAST8 "o" -#define PRIuLEAST8 "u" -#define PRIxLEAST8 "x" -#define PRIXLEAST8 "X" -#define PRIoFAST8 "o" -#define PRIuFAST8 "u" -#define PRIxFAST8 "x" -#define PRIXFAST8 "X" - -#define PRIo16 "ho" -#define PRIu16 "hu" -#define PRIx16 "hx" -#define PRIX16 "hX" -#define PRIoLEAST16 "ho" -#define PRIuLEAST16 "hu" -#define PRIxLEAST16 "hx" -#define PRIXLEAST16 "hX" -#define PRIoFAST16 "ho" -#define PRIuFAST16 "hu" -#define PRIxFAST16 "hx" -#define PRIXFAST16 "hX" - -#define PRIo32 "I32o" -#define PRIu32 "I32u" -#define PRIx32 "I32x" -#define PRIX32 "I32X" -#define PRIoLEAST32 "I32o" -#define PRIuLEAST32 "I32u" -#define PRIxLEAST32 "I32x" -#define PRIXLEAST32 "I32X" -#define PRIoFAST32 "I32o" -#define PRIuFAST32 "I32u" -#define PRIxFAST32 "I32x" -#define PRIXFAST32 "I32X" - -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#define PRIX64 "I64X" -#define PRIoLEAST64 "I64o" -#define PRIuLEAST64 "I64u" -#define PRIxLEAST64 "I64x" -#define PRIXLEAST64 "I64X" -#define PRIoFAST64 "I64o" -#define PRIuFAST64 "I64u" -#define PRIxFAST64 "I64x" -#define PRIXFAST64 "I64X" - -#define PRIoMAX "I64o" -#define PRIuMAX "I64u" -#define PRIxMAX "I64x" -#define PRIXMAX "I64X" - -#define PRIoPTR "Io" -#define PRIuPTR "Iu" -#define PRIxPTR "Ix" -#define PRIXPTR "IX" - -// The fscanf macros for signed integers are: -#define SCNd8 "d" -#define SCNi8 "i" -#define SCNdLEAST8 "d" -#define SCNiLEAST8 "i" -#define SCNdFAST8 "d" -#define SCNiFAST8 "i" - -#define SCNd16 "hd" -#define SCNi16 "hi" -#define SCNdLEAST16 "hd" -#define SCNiLEAST16 "hi" -#define SCNdFAST16 "hd" -#define SCNiFAST16 "hi" - -#define SCNd32 "ld" -#define SCNi32 "li" -#define SCNdLEAST32 "ld" -#define SCNiLEAST32 "li" -#define SCNdFAST32 "ld" -#define SCNiFAST32 "li" - -#define SCNd64 "I64d" -#define SCNi64 "I64i" -#define SCNdLEAST64 "I64d" -#define SCNiLEAST64 "I64i" -#define SCNdFAST64 "I64d" -#define SCNiFAST64 "I64i" - -#define SCNdMAX "I64d" -#define SCNiMAX "I64i" - -#ifdef _WIN64 // [ -# define SCNdPTR "I64d" -# define SCNiPTR "I64i" -#else // _WIN64 ][ -# define SCNdPTR "ld" -# define SCNiPTR "li" -#endif // _WIN64 ] - -// The fscanf macros for unsigned integers are: -#define SCNo8 "o" -#define SCNu8 "u" -#define SCNx8 "x" -#define SCNX8 "X" -#define SCNoLEAST8 "o" -#define SCNuLEAST8 "u" -#define SCNxLEAST8 "x" -#define SCNXLEAST8 "X" -#define SCNoFAST8 "o" -#define SCNuFAST8 "u" -#define SCNxFAST8 "x" -#define SCNXFAST8 "X" - -#define SCNo16 "ho" -#define SCNu16 "hu" -#define SCNx16 "hx" -#define SCNX16 "hX" -#define SCNoLEAST16 "ho" -#define SCNuLEAST16 "hu" -#define SCNxLEAST16 "hx" -#define SCNXLEAST16 "hX" -#define SCNoFAST16 "ho" -#define SCNuFAST16 "hu" -#define SCNxFAST16 "hx" -#define SCNXFAST16 "hX" - -#define SCNo32 "lo" -#define SCNu32 "lu" -#define SCNx32 "lx" -#define SCNX32 "lX" -#define SCNoLEAST32 "lo" -#define SCNuLEAST32 "lu" -#define SCNxLEAST32 "lx" -#define SCNXLEAST32 "lX" -#define SCNoFAST32 "lo" -#define SCNuFAST32 "lu" -#define SCNxFAST32 "lx" -#define SCNXFAST32 "lX" - -#define SCNo64 "I64o" -#define SCNu64 "I64u" -#define SCNx64 "I64x" -#define SCNX64 "I64X" -#define SCNoLEAST64 "I64o" -#define SCNuLEAST64 "I64u" -#define SCNxLEAST64 "I64x" -#define SCNXLEAST64 "I64X" -#define SCNoFAST64 "I64o" -#define SCNuFAST64 "I64u" -#define SCNxFAST64 "I64x" -#define SCNXFAST64 "I64X" - -#define SCNoMAX "I64o" -#define SCNuMAX "I64u" -#define SCNxMAX "I64x" -#define SCNXMAX "I64X" - -#ifdef _WIN64 // [ -# define SCNoPTR "I64o" -# define SCNuPTR "I64u" -# define SCNxPTR "I64x" -# define SCNXPTR "I64X" -#else // _WIN64 ][ -# define SCNoPTR "lo" -# define SCNuPTR "lu" -# define SCNxPTR "lx" -# define SCNXPTR "lX" -#endif // _WIN64 ] - -#endif // __STDC_FORMAT_MACROS ] - -// 7.8.2 Functions for greatest-width integer types - -// 7.8.2.1 The imaxabs function -#define imaxabs _abs64 - -// 7.8.2.2 The imaxdiv function - -// This is modified version of div() function from Microsoft's div.c found -// in %MSVC.NET%\crt\src\div.c -#ifdef STATIC_IMAXDIV // [ -static -#else // STATIC_IMAXDIV ][ -_inline -#endif // STATIC_IMAXDIV ] -imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - - result.quot = numer / denom; - result.rem = numer % denom; - - if (numer < 0 && result.rem > 0) { - // did division wrong; must fix up - ++result.quot; - result.rem -= denom; - } - - return result; -} - -// 7.8.2.3 The strtoimax and strtoumax functions -#define strtoimax _strtoi64 -#define strtoumax _strtoui64 - -// 7.8.2.4 The wcstoimax and wcstoumax functions -#define wcstoimax _wcstoi64 -#define wcstoumax _wcstoui64 - -#endif // _MSC_VER >= 1800 - -#endif // _MSC_INTTYPES_H_ ] diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h deleted file mode 100644 index 3d4477b9a..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/msinttypes/stdint.h +++ /dev/null @@ -1,300 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the product nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. -#if _MSC_VER >= 1600 // [ -#include - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -#undef INT8_C -#undef INT16_C -#undef INT32_C -#undef INT64_C -#undef UINT8_C -#undef UINT16_C -#undef UINT32_C -#undef UINT64_C - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#else // ] _MSC_VER >= 1700 [ - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we have to wrap include with 'extern "C++" {}' -// or compiler would give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#if defined(__cplusplus) && !defined(_M_ARM) -extern "C" { -#endif -# include -#if defined(__cplusplus) && !defined(_M_ARM) -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#endif // _MSC_VER >= 1600 ] - -#endif // _MSC_STDINT_H_ ] diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h deleted file mode 100644 index 58c034a24..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/ostreamwrapper.h +++ /dev/null @@ -1,81 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ -#define CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. -/*! - The classes can be wrapped including but not limited to: - - - \c std::ostringstream - - \c std::stringstream - - \c std::wpstringstream - - \c std::wstringstream - - \c std::ifstream - - \c std::fstream - - \c std::wofstream - - \c std::wfstream - - \tparam StreamType Class derived from \c std::basic_ostream. -*/ - -template -class BasicOStreamWrapper { -public: - typedef typename StreamType::char_type Ch; - BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} - - void Put(Ch c) { - stream_.put(c); - } - - void Flush() { - stream_.flush(); - } - - // Not implemented - char Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - char Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - char* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(char*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - -private: - BasicOStreamWrapper(const BasicOStreamWrapper&); - BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); - - StreamType& stream_; -}; - -typedef BasicOStreamWrapper OStreamWrapper; -typedef BasicOStreamWrapper WOStreamWrapper; - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h deleted file mode 100644 index 930970f98..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/pointer.h +++ /dev/null @@ -1,1414 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_POINTER_H_ -#define CEREAL_RAPIDJSON_POINTER_H_ - -#include "document.h" -#include "internal/itoa.h" - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token - -//! Error code of parsing. -/*! \ingroup CEREAL_RAPIDJSON_ERRORS - \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode -*/ -enum PointerParseErrorCode { - kPointerParseErrorNone = 0, //!< The parse is successful - - kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/' - kPointerParseErrorInvalidEscape, //!< Invalid escape - kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment - kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericPointer - -//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. -/*! - This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer" - (https://tools.ietf.org/html/rfc6901). - - A JSON pointer is for identifying a specific value in a JSON document - (GenericDocument). It can simplify coding of DOM tree manipulation, because it - can access multiple-level depth of DOM tree with single API call. - - After it parses a string representation (e.g. "/foo/0" or URI fragment - representation (e.g. "#/foo/0") into its internal representation (tokens), - it can be used to resolve a specific value in multiple documents, or sub-tree - of documents. - - Contrary to GenericValue, Pointer can be copy constructed and copy assigned. - Apart from assignment, a Pointer cannot be modified after construction. - - Although Pointer is very convenient, please aware that constructing Pointer - involves parsing and dynamic memory allocation. A special constructor with user- - supplied tokens eliminates these. - - GenericPointer depends on GenericDocument and GenericValue. - - \tparam ValueType The value type of the DOM tree. E.g. GenericValue > - \tparam Allocator The allocator type for allocating memory for internal representation. - - \note GenericPointer uses same encoding of ValueType. - However, Allocator of GenericPointer is independent of Allocator of Value. -*/ -template -class GenericPointer { -public: - typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value - typedef typename ValueType::Ch Ch; //!< Character type from Value - - //! A token is the basic units of internal representation. - /*! - A JSON pointer string representation "/foo/123" is parsed to two tokens: - "foo" and 123. 123 will be represented in both numeric form and string form. - They are resolved according to the actual value type (object or array). - - For token that are not numbers, or the numeric value is out of bound - (greater than limits of SizeType), they are only treated as string form - (i.e. the token's index will be equal to kPointerInvalidIndex). - - This struct is public so that user can create a Pointer without parsing and - allocation, using a special constructor. - */ - struct Token { - const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character. - SizeType length; //!< Length of the name. - SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex. - }; - - //!@name Constructors and destructor. - //@{ - - //! Default constructor. - GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} - - //! Constructor that parses a string or URI fragment representation. - /*! - \param source A null-terminated, string or URI fragment representation of JSON pointer. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - */ - explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source, internal::StrLen(source)); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Constructor that parses a string or URI fragment representation. - /*! - \param source A string or URI fragment representation of JSON pointer. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - \note Requires the definition of the preprocessor symbol \ref CEREAL_RAPIDJSON_HAS_STDSTRING. - */ - explicit GenericPointer(const std::basic_string& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source.c_str(), source.size()); - } -#endif - - //! Constructor that parses a string or URI fragment representation, with length of the source string. - /*! - \param source A string or URI fragment representation of JSON pointer. - \param length Length of source. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - \note Slightly faster than the overload without length. - */ - GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source, length); - } - - //! Constructor with user-supplied tokens. - /*! - This constructor let user supplies const array of tokens. - This prevents the parsing process and eliminates allocation. - This is preferred for memory constrained environments. - - \param tokens An constant array of tokens representing the JSON pointer. - \param tokenCount Number of tokens. - - \b Example - \code - #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex } - #define INDEX(i) { #i, sizeof(#i) - 1, i } - - static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) }; - static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0])); - // Equivalent to static const Pointer p("/foo/123"); - - #undef NAME - #undef INDEX - \endcode - */ - GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} - - //! Copy constructor. - GenericPointer(const GenericPointer& rhs) : allocator_(rhs.allocator_), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - *this = rhs; - } - - //! Copy constructor. - GenericPointer(const GenericPointer& rhs, Allocator* allocator) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - *this = rhs; - } - - //! Destructor. - ~GenericPointer() { - if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated. - Allocator::Free(tokens_); - CEREAL_RAPIDJSON_DELETE(ownAllocator_); - } - - //! Assignment operator. - GenericPointer& operator=(const GenericPointer& rhs) { - if (this != &rhs) { - // Do not delete ownAllcator - if (nameBuffer_) - Allocator::Free(tokens_); - - tokenCount_ = rhs.tokenCount_; - parseErrorOffset_ = rhs.parseErrorOffset_; - parseErrorCode_ = rhs.parseErrorCode_; - - if (rhs.nameBuffer_) - CopyFromRaw(rhs); // Normally parsed tokens. - else { - tokens_ = rhs.tokens_; // User supplied const tokens. - nameBuffer_ = 0; - } - } - return *this; - } - - //! Swap the content of this pointer with an other. - /*! - \param other The pointer to swap with. - \note Constant complexity. - */ - GenericPointer& Swap(GenericPointer& other) CEREAL_RAPIDJSON_NOEXCEPT { - internal::Swap(allocator_, other.allocator_); - internal::Swap(ownAllocator_, other.ownAllocator_); - internal::Swap(nameBuffer_, other.nameBuffer_); - internal::Swap(tokens_, other.tokens_); - internal::Swap(tokenCount_, other.tokenCount_); - internal::Swap(parseErrorOffset_, other.parseErrorOffset_); - internal::Swap(parseErrorCode_, other.parseErrorCode_); - return *this; - } - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.pointer, b.pointer); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericPointer& a, GenericPointer& b) CEREAL_RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //@} - - //!@name Append token - //@{ - - //! Append a token and return a new Pointer - /*! - \param token Token to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const Token& token, Allocator* allocator = 0) const { - GenericPointer r; - r.allocator_ = allocator; - Ch *p = r.CopyFromRaw(*this, 1, token.length + 1); - std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch)); - r.tokens_[tokenCount_].name = p; - r.tokens_[tokenCount_].length = token.length; - r.tokens_[tokenCount_].index = token.index; - return r; - } - - //! Append a name token with length, and return a new Pointer - /*! - \param name Name to be appended. - \param length Length of name. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const { - Token token = { name, length, kPointerInvalidIndex }; - return Append(token, allocator); - } - - //! Append a name token without length, and return a new Pointer - /*! - \param name Name (const Ch*) to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >), (GenericPointer)) - Append(T* name, Allocator* allocator = 0) const { - return Append(name, internal::StrLen(name), allocator); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Append a name token, and return a new Pointer - /*! - \param name Name to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const std::basic_string& name, Allocator* allocator = 0) const { - return Append(name.c_str(), static_cast(name.size()), allocator); - } -#endif - - //! Append a index token, and return a new Pointer - /*! - \param index Index to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(SizeType index, Allocator* allocator = 0) const { - char buffer[21]; - char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer); - SizeType length = static_cast(end - buffer); - buffer[length] = '\0'; - - if (sizeof(Ch) == 1) { - Token token = { reinterpret_cast(buffer), length, index }; - return Append(token, allocator); - } - else { - Ch name[21]; - for (size_t i = 0; i <= length; i++) - name[i] = static_cast(buffer[i]); - Token token = { name, length, index }; - return Append(token, allocator); - } - } - - //! Append a token by value, and return a new Pointer - /*! - \param token token to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { - if (token.IsString()) - return Append(token.GetString(), token.GetStringLength(), allocator); - else { - CEREAL_RAPIDJSON_ASSERT(token.IsUint64()); - CEREAL_RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0)); - return Append(static_cast(token.GetUint64()), allocator); - } - } - - //!@name Handling Parse Error - //@{ - - //! Check whether this is a valid pointer. - bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; } - - //! Get the parsing error offset in code unit. - size_t GetParseErrorOffset() const { return parseErrorOffset_; } - - //! Get the parsing error code. - PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; } - - //@} - - //! Get the allocator of this pointer. - Allocator& GetAllocator() { return *allocator_; } - - //!@name Tokens - //@{ - - //! Get the token array (const version only). - const Token* GetTokens() const { return tokens_; } - - //! Get the number of tokens. - size_t GetTokenCount() const { return tokenCount_; } - - //@} - - //!@name Equality/inequality operators - //@{ - - //! Equality operator. - /*! - \note When any pointers are invalid, always returns false. - */ - bool operator==(const GenericPointer& rhs) const { - if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_) - return false; - - for (size_t i = 0; i < tokenCount_; i++) { - if (tokens_[i].index != rhs.tokens_[i].index || - tokens_[i].length != rhs.tokens_[i].length || - (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0)) - { - return false; - } - } - - return true; - } - - //! Inequality operator. - /*! - \note When any pointers are invalid, always returns true. - */ - bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); } - - //! Less than operator. - /*! - \note Invalid pointers are always greater than valid ones. - */ - bool operator<(const GenericPointer& rhs) const { - if (!IsValid()) - return false; - if (!rhs.IsValid()) - return true; - - if (tokenCount_ != rhs.tokenCount_) - return tokenCount_ < rhs.tokenCount_; - - for (size_t i = 0; i < tokenCount_; i++) { - if (tokens_[i].index != rhs.tokens_[i].index) - return tokens_[i].index < rhs.tokens_[i].index; - - if (tokens_[i].length != rhs.tokens_[i].length) - return tokens_[i].length < rhs.tokens_[i].length; - - if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length)) - return cmp < 0; - } - - return false; - } - - //@} - - //!@name Stringify - //@{ - - //! Stringify the pointer into string representation. - /*! - \tparam OutputStream Type of output stream. - \param os The output stream. - */ - template - bool Stringify(OutputStream& os) const { - return Stringify(os); - } - - //! Stringify the pointer into URI fragment representation. - /*! - \tparam OutputStream Type of output stream. - \param os The output stream. - */ - template - bool StringifyUriFragment(OutputStream& os) const { - return Stringify(os); - } - - //@} - - //!@name Create value - //@{ - - //! Create a value in a subtree. - /*! - If the value is not exist, it creates all parent values and a JSON Null value. - So it always succeed and return the newly created or existing value. - - Remind that it may change types of parents according to tokens, so it - potentially removes previously stored values. For example, if a document - was an array, and "/foo" is used to create a value, then the document - will be changed to an object, and all existing array elements are lost. - - \param root Root value of a DOM subtree to be resolved. It can be any value other than document root. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \param alreadyExist If non-null, it stores whether the resolved value is already exist. - \return The resolved newly created (a JSON Null value), or already exists value. - */ - ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const { - CEREAL_RAPIDJSON_ASSERT(IsValid()); - ValueType* v = &root; - bool exist = true; - for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - if (v->IsArray() && t->name[0] == '-' && t->length == 1) { - v->PushBack(ValueType().Move(), allocator); - v = &((*v)[v->Size() - 1]); - exist = false; - } - else { - if (t->index == kPointerInvalidIndex) { // must be object name - if (!v->IsObject()) - v->SetObject(); // Change to Object - } - else { // object name or array index - if (!v->IsArray() && !v->IsObject()) - v->SetArray(); // Change to Array - } - - if (v->IsArray()) { - if (t->index >= v->Size()) { - v->Reserve(t->index + 1, allocator); - while (t->index >= v->Size()) - v->PushBack(ValueType().Move(), allocator); - exist = false; - } - v = &((*v)[t->index]); - } - else { - typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); - if (m == v->MemberEnd()) { - v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator); - v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end - exist = false; - } - else - v = &m->value; - } - } - } - - if (alreadyExist) - *alreadyExist = exist; - - return *v; - } - - //! Creates a value in a document. - /*! - \param document A document to be resolved. - \param alreadyExist If non-null, it stores whether the resolved value is already exist. - \return The resolved newly created, or already exists value. - */ - template - ValueType& Create(GenericDocument& document, bool* alreadyExist = 0) const { - return Create(document, document.GetAllocator(), alreadyExist); - } - - //@} - - //!@name Query value - //@{ - - //! Query a value in a subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. - \return Pointer to the value if it can be resolved. Otherwise null. - - \note - There are only 3 situations when a value cannot be resolved: - 1. A value in the path is not an array nor object. - 2. An object value does not contain the token. - 3. A token is out of range of an array value. - - Use unresolvedTokenIndex to retrieve the token index. - */ - ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const { - CEREAL_RAPIDJSON_ASSERT(IsValid()); - ValueType* v = &root; - for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - switch (v->GetType()) { - case kObjectType: - { - typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); - if (m == v->MemberEnd()) - break; - v = &m->value; - } - continue; - case kArrayType: - if (t->index == kPointerInvalidIndex || t->index >= v->Size()) - break; - v = &((*v)[t->index]); - continue; - default: - break; - } - - // Error: unresolved token - if (unresolvedTokenIndex) - *unresolvedTokenIndex = static_cast(t - tokens_); - return 0; - } - return v; - } - - //! Query a const value in a const subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \return Pointer to the value if it can be resolved. Otherwise null. - */ - const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const { - return Get(const_cast(root), unresolvedTokenIndex); - } - - //@} - - //!@name Query a value with default - //@{ - - //! Query a value in a subtree with default value. - /*! - Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value. - So that this function always succeed. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param defaultValue Default value to be cloned if the value was not exists. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); - } - - //! Query a value in a subtree with default null-terminated string. - ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.SetString(defaultValue, allocator); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Query a value in a subtree with default std::basic_string. - ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.SetString(defaultValue, allocator); - } -#endif - - //! Query a value in a subtree with default primitive value. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const { - return GetWithDefault(root, ValueType(defaultValue).Move(), allocator); - } - - //! Query a value in a document with default value. - template - ValueType& GetWithDefault(GenericDocument& document, const ValueType& defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - - //! Query a value in a document with default null-terminated string. - template - ValueType& GetWithDefault(GenericDocument& document, const Ch* defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Query a value in a document with default std::basic_string. - template - ValueType& GetWithDefault(GenericDocument& document, const std::basic_string& defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } -#endif - - //! Query a value in a document with default primitive value. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - GetWithDefault(GenericDocument& document, T defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - - //@} - - //!@name Set a value - //@{ - - //! Set a value in a subtree, with move semantics. - /*! - It creates all parents if they are not exist or types are different to the tokens. - So this function always succeeds but potentially remove existing values. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param value Value to be set. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = value; - } - - //! Set a value in a subtree, with copy semantics. - ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator).CopyFrom(value, allocator); - } - - //! Set a null-terminated string in a subtree. - ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value, allocator).Move(); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Set a std::basic_string in a subtree. - ValueType& Set(ValueType& root, const std::basic_string& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value, allocator).Move(); - } -#endif - - //! Set a primitive value in a subtree. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value).Move(); - } - - //! Set a value in a document, with move semantics. - template - ValueType& Set(GenericDocument& document, ValueType& value) const { - return Create(document) = value; - } - - //! Set a value in a document, with copy semantics. - template - ValueType& Set(GenericDocument& document, const ValueType& value) const { - return Create(document).CopyFrom(value, document.GetAllocator()); - } - - //! Set a null-terminated string in a document. - template - ValueType& Set(GenericDocument& document, const Ch* value) const { - return Create(document) = ValueType(value, document.GetAllocator()).Move(); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - //! Sets a std::basic_string in a document. - template - ValueType& Set(GenericDocument& document, const std::basic_string& value) const { - return Create(document) = ValueType(value, document.GetAllocator()).Move(); - } -#endif - - //! Set a primitive value in a document. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - Set(GenericDocument& document, T value) const { - return Create(document) = value; - } - - //@} - - //!@name Swap a value - //@{ - - //! Swap a value with a value in a subtree. - /*! - It creates all parents if they are not exist or types are different to the tokens. - So this function always succeeds but potentially remove existing values. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param value Value to be swapped. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator).Swap(value); - } - - //! Swap a value with a value in a document. - template - ValueType& Swap(GenericDocument& document, ValueType& value) const { - return Create(document).Swap(value); - } - - //@} - - //! Erase a value in a subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \return Whether the resolved value is found and erased. - - \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false. - */ - bool Erase(ValueType& root) const { - CEREAL_RAPIDJSON_ASSERT(IsValid()); - if (tokenCount_ == 0) // Cannot erase the root - return false; - - ValueType* v = &root; - const Token* last = tokens_ + (tokenCount_ - 1); - for (const Token *t = tokens_; t != last; ++t) { - switch (v->GetType()) { - case kObjectType: - { - typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); - if (m == v->MemberEnd()) - return false; - v = &m->value; - } - break; - case kArrayType: - if (t->index == kPointerInvalidIndex || t->index >= v->Size()) - return false; - v = &((*v)[t->index]); - break; - default: - return false; - } - } - - switch (v->GetType()) { - case kObjectType: - return v->EraseMember(GenericStringRef(last->name, last->length)); - case kArrayType: - if (last->index == kPointerInvalidIndex || last->index >= v->Size()) - return false; - v->Erase(v->Begin() + last->index); - return true; - default: - return false; - } - } - -private: - //! Clone the content from rhs to this. - /*! - \param rhs Source pointer. - \param extraToken Extra tokens to be allocated. - \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated. - \return Start of non-occupied name buffer, for storing extra names. - */ - Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) { - if (!allocator_) // allocator is independently owned. - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - - size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens - for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t) - nameBufferSize += t->length; - - tokenCount_ = rhs.tokenCount_ + extraToken; - tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch))); - nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); - if (rhs.tokenCount_ > 0) { - std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token)); - } - if (nameBufferSize > 0) { - std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch)); - } - - // Adjust pointers to name buffer - std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_; - for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t) - t->name += diff; - - return nameBuffer_ + nameBufferSize; - } - - //! Check whether a character should be percent-encoded. - /*! - According to RFC 3986 2.3 Unreserved Characters. - \param c The character (code unit) to be tested. - */ - bool NeedPercentEncode(Ch c) const { - return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~'); - } - - //! Parse a JSON String or its URI fragment representation into tokens. -#ifndef __clang__ // -Wdocumentation - /*! - \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated. - \param length Length of the source string. - \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped. - */ -#endif - void Parse(const Ch* source, size_t length) { - CEREAL_RAPIDJSON_ASSERT(source != NULL); - CEREAL_RAPIDJSON_ASSERT(nameBuffer_ == 0); - CEREAL_RAPIDJSON_ASSERT(tokens_ == 0); - - // Create own allocator if user did not supply. - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - - // Count number of '/' as tokenCount - tokenCount_ = 0; - for (const Ch* s = source; s != source + length; s++) - if (*s == '/') - tokenCount_++; - - Token* token = tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch))); - Ch* name = nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); - size_t i = 0; - - // Detect if it is a URI fragment - bool uriFragment = false; - if (source[i] == '#') { - uriFragment = true; - i++; - } - - if (i != length && source[i] != '/') { - parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus; - goto error; - } - - while (i < length) { - CEREAL_RAPIDJSON_ASSERT(source[i] == '/'); - i++; // consumes '/' - - token->name = name; - bool isNumber = true; - - while (i < length && source[i] != '/') { - Ch c = source[i]; - if (uriFragment) { - // Decoding percent-encoding for URI fragment - if (c == '%') { - PercentDecodeStream is(&source[i], source + length); - GenericInsituStringStream os(name); - Ch* begin = os.PutBegin(); - if (!Transcoder, EncodingType>().Validate(is, os) || !is.IsValid()) { - parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; - goto error; - } - size_t len = os.PutEnd(begin); - i += is.Tell() - 1; - if (len == 1) - c = *name; - else { - name += len; - isNumber = false; - i++; - continue; - } - } - else if (NeedPercentEncode(c)) { - parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode; - goto error; - } - } - - i++; - - // Escaping "~0" -> '~', "~1" -> '/' - if (c == '~') { - if (i < length) { - c = source[i]; - if (c == '0') c = '~'; - else if (c == '1') c = '/'; - else { - parseErrorCode_ = kPointerParseErrorInvalidEscape; - goto error; - } - i++; - } - else { - parseErrorCode_ = kPointerParseErrorInvalidEscape; - goto error; - } - } - - // First check for index: all of characters are digit - if (c < '0' || c > '9') - isNumber = false; - - *name++ = c; - } - token->length = static_cast(name - token->name); - if (token->length == 0) - isNumber = false; - *name++ = '\0'; // Null terminator - - // Second check for index: more than one digit cannot have leading zero - if (isNumber && token->length > 1 && token->name[0] == '0') - isNumber = false; - - // String to SizeType conversion - SizeType n = 0; - if (isNumber) { - for (size_t j = 0; j < token->length; j++) { - SizeType m = n * 10 + static_cast(token->name[j] - '0'); - if (m < n) { // overflow detection - isNumber = false; - break; - } - n = m; - } - } - - token->index = isNumber ? n : kPointerInvalidIndex; - token++; - } - - CEREAL_RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer - parseErrorCode_ = kPointerParseErrorNone; - return; - - error: - Allocator::Free(tokens_); - nameBuffer_ = 0; - tokens_ = 0; - tokenCount_ = 0; - parseErrorOffset_ = i; - return; - } - - //! Stringify to string or URI fragment representation. - /*! - \tparam uriFragment True for stringifying to URI fragment representation. False for string representation. - \tparam OutputStream type of output stream. - \param os The output stream. - */ - template - bool Stringify(OutputStream& os) const { - CEREAL_RAPIDJSON_ASSERT(IsValid()); - - if (uriFragment) - os.Put('#'); - - for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - os.Put('/'); - for (size_t j = 0; j < t->length; j++) { - Ch c = t->name[j]; - if (c == '~') { - os.Put('~'); - os.Put('0'); - } - else if (c == '/') { - os.Put('~'); - os.Put('1'); - } - else if (uriFragment && NeedPercentEncode(c)) { - // Transcode to UTF8 sequence - GenericStringStream source(&t->name[j]); - PercentEncodeStream target(os); - if (!Transcoder >().Validate(source, target)) - return false; - j += source.Tell() - 1; - } - else - os.Put(c); - } - } - return true; - } - - //! A helper stream for decoding a percent-encoded sequence into code unit. - /*! - This stream decodes %XY triplet into code unit (0-255). - If it encounters invalid characters, it sets output code unit as 0 and - mark invalid, and to be checked by IsValid(). - */ - class PercentDecodeStream { - public: - typedef typename ValueType::Ch Ch; - - //! Constructor - /*! - \param source Start of the stream - \param end Past-the-end of the stream. - */ - PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {} - - Ch Take() { - if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet - valid_ = false; - return 0; - } - src_++; - Ch c = 0; - for (int j = 0; j < 2; j++) { - c = static_cast(c << 4); - Ch h = *src_; - if (h >= '0' && h <= '9') c = static_cast(c + h - '0'); - else if (h >= 'A' && h <= 'F') c = static_cast(c + h - 'A' + 10); - else if (h >= 'a' && h <= 'f') c = static_cast(c + h - 'a' + 10); - else { - valid_ = false; - return 0; - } - src_++; - } - return c; - } - - size_t Tell() const { return static_cast(src_ - head_); } - bool IsValid() const { return valid_; } - - private: - const Ch* src_; //!< Current read position. - const Ch* head_; //!< Original head of the string. - const Ch* end_; //!< Past-the-end position. - bool valid_; //!< Whether the parsing is valid. - }; - - //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. - template - class PercentEncodeStream { - public: - PercentEncodeStream(OutputStream& os) : os_(os) {} - void Put(char c) { // UTF-8 must be byte - unsigned char u = static_cast(c); - static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - os_.Put('%'); - os_.Put(static_cast(hexDigits[u >> 4])); - os_.Put(static_cast(hexDigits[u & 15])); - } - private: - OutputStream& os_; - }; - - Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. - Allocator* ownAllocator_; //!< Allocator owned by this Pointer. - Ch* nameBuffer_; //!< A buffer containing all names in tokens. - Token* tokens_; //!< A list of tokens. - size_t tokenCount_; //!< Number of tokens in tokens_. - size_t parseErrorOffset_; //!< Offset in code unit when parsing fail. - PointerParseErrorCode parseErrorCode_; //!< Parsing error code. -}; - -//! GenericPointer for Value (UTF-8, default allocator). -typedef GenericPointer Pointer; - -//!@name Helper functions for GenericPointer -//@{ - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer& pointer, typename T::AllocatorType& a) { - return pointer.Create(root, a); -} - -template -typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Create(root, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer& pointer) { - return pointer.Create(document); -} - -template -typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) { - return GenericPointer(source, N - 1).Create(document); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType* GetValueByPointer(T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { - return pointer.Get(root, unresolvedTokenIndex); -} - -template -const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { - return pointer.Get(root, unresolvedTokenIndex); -} - -template -typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) { - return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); -} - -template -const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) { - return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const std::basic_string& defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, T2 defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string& defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const std::basic_string& defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, T2 defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string& defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::Ch* value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const std::basic_string& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -SetValueByPointer(T& root, const GenericPointer& pointer, T2 value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* value) { - return pointer.Set(document, value); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const std::basic_string& value) { - return pointer.Set(document, value); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -SetValueByPointer(DocumentType& document, const GenericPointer& pointer, T2 value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string& value) { - return GenericPointer(source, N - 1).Set(document, value); -} -#endif - -template -CEREAL_RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Swap(root, value, a); -} - -template -typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Swap(root, value, a); -} - -template -typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { - return pointer.Swap(document, value); -} - -template -typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Swap(document, value); -} - -////////////////////////////////////////////////////////////////////////////// - -template -bool EraseValueByPointer(T& root, const GenericPointer& pointer) { - return pointer.Erase(root); -} - -template -bool EraseValueByPointer(T& root, const CharType(&source)[N]) { - return GenericPointer(source, N - 1).Erase(root); -} - -//@} - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) || defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_POINTER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h deleted file mode 100644 index 0c2beb496..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/prettywriter.h +++ /dev/null @@ -1,277 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_PRETTYWRITER_H_ -#define CEREAL_RAPIDJSON_PRETTYWRITER_H_ - -#include "writer.h" - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Combination of PrettyWriter format flags. -/*! \see PrettyWriter::SetFormatOptions - */ -enum PrettyFormatOptions { - kFormatDefault = 0, //!< Default pretty formatting. - kFormatSingleLineArray = 1 //!< Format arrays on a single line. -}; - -//! Writer with indentation and spacing. -/*! - \tparam OutputStream Type of output os. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> -class PrettyWriter : public Writer { -public: - typedef Writer Base; - typedef typename Base::Ch Ch; - - //! Constructor - /*! \param os Output stream. - \param allocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : - Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} - - - explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : - Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {} - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - PrettyWriter(PrettyWriter&& rhs) : - Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {} -#endif - - //! Set custom indentation. - /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). - \param indentCharCount Number of indent characters for each indentation level. - \note The default indentation is 4 spaces. - */ - PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { - CEREAL_RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); - indentChar_ = indentChar; - indentCharCount_ = indentCharCount; - return *this; - } - - //! Set pretty writer formatting options. - /*! \param options Formatting options. - */ - PrettyWriter& SetFormatOptions(PrettyFormatOptions options) { - formatOptions_ = options; - return *this; - } - - /*! @name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); } - bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); } - bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); } - bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); } - bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); } - bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); } - bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } - - bool RawNumber(const Ch* str, SizeType length, bool copy = false) { - CEREAL_RAPIDJSON_ASSERT(str != 0); - (void)copy; - PrettyPrefix(kNumberType); - return Base::EndValue(Base::WriteString(str, length)); - } - - bool String(const Ch* str, SizeType length, bool copy = false) { - CEREAL_RAPIDJSON_ASSERT(str != 0); - (void)copy; - PrettyPrefix(kStringType); - return Base::EndValue(Base::WriteString(str, length)); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - PrettyPrefix(kObjectType); - new (Base::level_stack_.template Push()) typename Base::Level(false); - return Base::WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool Key(const std::basic_string& str) { - return Key(str.data(), SizeType(str.size())); - } -#endif - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object - CEREAL_RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); // currently inside an Array, not Object - CEREAL_RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value - - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::EndValue(Base::WriteEndObject()); - (void)ret; - CEREAL_RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::Flush(); - return true; - } - - bool StartArray() { - PrettyPrefix(kArrayType); - new (Base::level_stack_.template Push()) typename Base::Level(true); - return Base::WriteStartArray(); - } - - bool EndArray(SizeType memberCount = 0) { - (void)memberCount; - CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); - CEREAL_RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty && !(formatOptions_ & kFormatSingleLineArray)) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::EndValue(Base::WriteEndArray()); - (void)ret; - CEREAL_RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::Flush(); - return true; - } - - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } - - //@} - - //! Write a raw JSON value. - /*! - For user to write a stringified JSON as a value. - - \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. - \param length Length of the json. - \param type Type of the root of json. - \note When using PrettyWriter::RawValue(), the result json may not be indented correctly. - */ - bool RawValue(const Ch* json, size_t length, Type type) { - CEREAL_RAPIDJSON_ASSERT(json != 0); - PrettyPrefix(type); - return Base::EndValue(Base::WriteRawValue(json, length)); - } - -protected: - void PrettyPrefix(Type type) { - (void)type; - if (Base::level_stack_.GetSize() != 0) { // this value is not at root - typename Base::Level* level = Base::level_stack_.template Top(); - - if (level->inArray) { - if (level->valueCount > 0) { - Base::os_->Put(','); // add comma if it is not the first element in array - if (formatOptions_ & kFormatSingleLineArray) - Base::os_->Put(' '); - } - - if (!(formatOptions_ & kFormatSingleLineArray)) { - Base::os_->Put('\n'); - WriteIndent(); - } - } - else { // in object - if (level->valueCount > 0) { - if (level->valueCount % 2 == 0) { - Base::os_->Put(','); - Base::os_->Put('\n'); - } - else { - Base::os_->Put(':'); - Base::os_->Put(' '); - } - } - else - Base::os_->Put('\n'); - - if (level->valueCount % 2 == 0) - WriteIndent(); - } - if (!level->inArray && level->valueCount % 2 == 0) - CEREAL_RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - CEREAL_RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. - Base::hasRoot_ = true; - } - } - - void WriteIndent() { - size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; - PutN(*Base::os_, static_cast(indentChar_), count); - } - - Ch indentChar_; - unsigned indentCharCount_; - PrettyFormatOptions formatOptions_; - -private: - // Prohibit copy constructor & assignment operator. - PrettyWriter(const PrettyWriter&); - PrettyWriter& operator=(const PrettyWriter&); -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h deleted file mode 100644 index 3eefe60a9..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/rapidjson.h +++ /dev/null @@ -1,656 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ -#define CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ - -/*!\file rapidjson.h - \brief common definitions and configuration - - \see CEREAL_RAPIDJSON_CONFIG - */ - -/*! \defgroup CEREAL_RAPIDJSON_CONFIG RapidJSON configuration - \brief Configuration macros for library features - - Some RapidJSON features are configurable to adapt the library to a wide - variety of platforms, environments and usage scenarios. Most of the - features can be configured in terms of overridden or predefined - preprocessor macros at compile-time. - - Some additional customization is available in the \ref CEREAL_RAPIDJSON_ERRORS APIs. - - \note These macros should be given on the compiler command-line - (where applicable) to avoid inconsistent values when compiling - different translation units of a single application. - */ - -#include // malloc(), realloc(), free(), size_t -#include // memset(), memcpy(), memmove(), memcmp() - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_VERSION_STRING -// -// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. -// - -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -// token stringification -#define CEREAL_RAPIDJSON_STRINGIFY(x) CEREAL_RAPIDJSON_DO_STRINGIFY(x) -#define CEREAL_RAPIDJSON_DO_STRINGIFY(x) #x - -// token concatenation -#define CEREAL_RAPIDJSON_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN(X, Y) -#define CEREAL_RAPIDJSON_DO_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN2(X, Y) -#define CEREAL_RAPIDJSON_DO_JOIN2(X, Y) X##Y -//!@endcond - -/*! \def CEREAL_RAPIDJSON_MAJOR_VERSION - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Major version of RapidJSON in integer. -*/ -/*! \def CEREAL_RAPIDJSON_MINOR_VERSION - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Minor version of RapidJSON in integer. -*/ -/*! \def CEREAL_RAPIDJSON_PATCH_VERSION - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Patch version of RapidJSON in integer. -*/ -/*! \def CEREAL_RAPIDJSON_VERSION_STRING - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Version of RapidJSON in ".." string format. -*/ -#define CEREAL_RAPIDJSON_MAJOR_VERSION 1 -#define CEREAL_RAPIDJSON_MINOR_VERSION 1 -#define CEREAL_RAPIDJSON_PATCH_VERSION 0 -#define CEREAL_RAPIDJSON_VERSION_STRING \ - CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_MAJOR_VERSION.CEREAL_RAPIDJSON_MINOR_VERSION.CEREAL_RAPIDJSON_PATCH_VERSION) - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_NAMESPACE_(BEGIN|END) -/*! \def CEREAL_RAPIDJSON_NAMESPACE - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace - - In order to avoid symbol clashes and/or "One Definition Rule" errors - between multiple inclusions of (different versions of) RapidJSON in - a single binary, users can customize the name of the main RapidJSON - namespace. - - In case of a single nesting level, defining \c CEREAL_RAPIDJSON_NAMESPACE - to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple - levels are needed, both \ref CEREAL_RAPIDJSON_NAMESPACE_BEGIN and \ref - CEREAL_RAPIDJSON_NAMESPACE_END need to be defined as well: - - \code - // in some .cpp file - #define CEREAL_RAPIDJSON_NAMESPACE my::rapidjson - #define CEREAL_RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { - #define CEREAL_RAPIDJSON_NAMESPACE_END } } - #include "rapidjson/..." - \endcode - - \see rapidjson - */ -/*! \def CEREAL_RAPIDJSON_NAMESPACE_BEGIN - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (opening expression) - \see CEREAL_RAPIDJSON_NAMESPACE -*/ -/*! \def CEREAL_RAPIDJSON_NAMESPACE_END - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (closing expression) - \see CEREAL_RAPIDJSON_NAMESPACE -*/ -#ifndef CEREAL_RAPIDJSON_NAMESPACE -#define CEREAL_RAPIDJSON_NAMESPACE rapidjson -#endif -#ifndef CEREAL_RAPIDJSON_NAMESPACE_BEGIN -#define CEREAL_RAPIDJSON_NAMESPACE_BEGIN namespace CEREAL_RAPIDJSON_NAMESPACE { -#endif -#ifndef CEREAL_RAPIDJSON_NAMESPACE_END -#define CEREAL_RAPIDJSON_NAMESPACE_END } -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_HAS_STDSTRING - -#ifndef CEREAL_RAPIDJSON_HAS_STDSTRING -#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING -#define CEREAL_RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation -#else -#define CEREAL_RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default -#endif -/*! \def CEREAL_RAPIDJSON_HAS_STDSTRING - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Enable RapidJSON support for \c std::string - - By defining this preprocessor symbol to \c 1, several convenience functions for using - \ref rapidjson::GenericValue with \c std::string are enabled, especially - for construction and comparison. - - \hideinitializer -*/ -#endif // !defined(CEREAL_RAPIDJSON_HAS_STDSTRING) - -#if CEREAL_RAPIDJSON_HAS_STDSTRING -#include -#endif // CEREAL_RAPIDJSON_HAS_STDSTRING - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_NO_INT64DEFINE - -/*! \def CEREAL_RAPIDJSON_NO_INT64DEFINE - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Use external 64-bit integer types. - - RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types - to be available at global scope. - - If users have their own definition, define CEREAL_RAPIDJSON_NO_INT64DEFINE to - prevent RapidJSON from defining its own types. -*/ -#ifndef CEREAL_RAPIDJSON_NO_INT64DEFINE -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 -#include "msinttypes/stdint.h" -#include "msinttypes/inttypes.h" -#else -// Other compilers should have this. -#include -#include -#endif -//!@endcond -#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING -#define CEREAL_RAPIDJSON_NO_INT64DEFINE -#endif -#endif // CEREAL_RAPIDJSON_NO_INT64TYPEDEF - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_FORCEINLINE - -#ifndef CEREAL_RAPIDJSON_FORCEINLINE -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#if defined(_MSC_VER) && defined(NDEBUG) -#define CEREAL_RAPIDJSON_FORCEINLINE __forceinline -#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) -#define CEREAL_RAPIDJSON_FORCEINLINE __attribute__((always_inline)) -#else -#define CEREAL_RAPIDJSON_FORCEINLINE -#endif -//!@endcond -#endif // CEREAL_RAPIDJSON_FORCEINLINE - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_ENDIAN -#define CEREAL_RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine -#define CEREAL_RAPIDJSON_BIGENDIAN 1 //!< Big endian machine - -//! Endianness of the machine. -/*! - \def CEREAL_RAPIDJSON_ENDIAN - \ingroup CEREAL_RAPIDJSON_CONFIG - - GCC 4.6 provided macro for detecting endianness of the target machine. But other - compilers may not have this. User can define CEREAL_RAPIDJSON_ENDIAN to either - \ref CEREAL_RAPIDJSON_LITTLEENDIAN or \ref CEREAL_RAPIDJSON_BIGENDIAN. - - Default detection implemented with reference to - \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html - \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp -*/ -#ifndef CEREAL_RAPIDJSON_ENDIAN -// Detect with GCC 4.6's macro -# ifdef __BYTE_ORDER__ -# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN -# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. -# endif // __BYTE_ORDER__ -// Detect with GLIBC's endian.h -# elif defined(__GLIBC__) -# include -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. -# endif // __GLIBC__ -// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro -# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN -# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN -// Detect with architecture macros -# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN -# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN -# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) -# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN -# elif defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) -# define CEREAL_RAPIDJSON_ENDIAN -# else -# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. -# endif -#endif // CEREAL_RAPIDJSON_ENDIAN - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_64BIT - -//! Whether using 64-bit architecture -#ifndef CEREAL_RAPIDJSON_64BIT -#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) -#define CEREAL_RAPIDJSON_64BIT 1 -#else -#define CEREAL_RAPIDJSON_64BIT 0 -#endif -#endif // CEREAL_RAPIDJSON_64BIT - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_ALIGN - -//! Data alignment of the machine. -/*! \ingroup CEREAL_RAPIDJSON_CONFIG - \param x pointer to align - - Some machines require strict data alignment. The default is 8 bytes. - User can customize by defining the CEREAL_RAPIDJSON_ALIGN function macro. -*/ -#ifndef CEREAL_RAPIDJSON_ALIGN -#define CEREAL_RAPIDJSON_ALIGN(x) (((x) + static_cast(7u)) & ~static_cast(7u)) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_UINT64_C2 - -//! Construct a 64-bit literal by a pair of 32-bit integer. -/*! - 64-bit literal with or without ULL suffix is prone to compiler warnings. - UINT64_C() is C macro which cause compilation problems. - Use this macro to define 64-bit constants by a pair of 32-bit integer. -*/ -#ifndef CEREAL_RAPIDJSON_UINT64_C2 -#define CEREAL_RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION - -//! Use only lower 48-bit address for some pointers. -/*! - \ingroup CEREAL_RAPIDJSON_CONFIG - - This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. - The higher 16-bit can be used for storing other data. - \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture. -*/ -#ifndef CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION -#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) -#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 -#else -#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 -#endif -#endif // CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION - -#if CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 -#if CEREAL_RAPIDJSON_64BIT != 1 -#error CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when CEREAL_RAPIDJSON_64BIT=1 -#endif -#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast((reinterpret_cast(p) & static_cast(CEREAL_RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast(reinterpret_cast(x)))) -#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast(reinterpret_cast(p) & static_cast(CEREAL_RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) -#else -#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) -#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (p) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_SSE2/CEREAL_RAPIDJSON_SSE42/CEREAL_RAPIDJSON_NEON/CEREAL_RAPIDJSON_SIMD - -/*! \def CEREAL_RAPIDJSON_SIMD - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief Enable SSE2/SSE4.2/Neon optimization. - - RapidJSON supports optimized implementations for some parsing operations - based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel - or ARM compatible processors. - - To enable these optimizations, three different symbols can be defined; - \code - // Enable SSE2 optimization. - #define CEREAL_RAPIDJSON_SSE2 - - // Enable SSE4.2 optimization. - #define CEREAL_RAPIDJSON_SSE42 - \endcode - - // Enable ARM Neon optimization. - #define CEREAL_RAPIDJSON_NEON - \endcode - - \c CEREAL_RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined. - - If any of these symbols is defined, RapidJSON defines the macro - \c CEREAL_RAPIDJSON_SIMD to indicate the availability of the optimized code. -*/ -#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) \ - || defined(CEREAL_RAPIDJSON_NEON) || defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) -#define CEREAL_RAPIDJSON_SIMD -#endif - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE - -#ifndef CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE -/*! \def CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief User-provided \c SizeType definition. - - In order to avoid using 32-bit size types for indexing strings and arrays, - define this preprocessor symbol and provide the type rapidjson::SizeType - before including RapidJSON: - \code - #define CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE - namespace rapidjson { typedef ::std::size_t SizeType; } - #include "rapidjson/..." - \endcode - - \see rapidjson::SizeType -*/ -#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING -#define CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE -#endif -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -//! Size type (for string lengths, array sizes, etc.) -/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, - instead of using \c size_t. Users may override the SizeType by defining - \ref CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE. -*/ -typedef unsigned SizeType; -CEREAL_RAPIDJSON_NAMESPACE_END -#endif - -// always import std::size_t to rapidjson namespace -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -using std::size_t; -CEREAL_RAPIDJSON_NAMESPACE_END - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_ASSERT - -//! Assertion. -/*! \ingroup CEREAL_RAPIDJSON_CONFIG - By default, rapidjson uses C \c assert() for internal assertions. - User can override it by defining CEREAL_RAPIDJSON_ASSERT(x) macro. - - \note Parsing errors are handled and can be customized by the - \ref CEREAL_RAPIDJSON_ERRORS APIs. -*/ -#ifndef CEREAL_RAPIDJSON_ASSERT -#include -#define CEREAL_RAPIDJSON_ASSERT(x) assert(x) -#endif // CEREAL_RAPIDJSON_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_STATIC_ASSERT - -// Prefer C++11 static_assert, if available -#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT -#if __cplusplus >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) -#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ - static_assert(x, CEREAL_RAPIDJSON_STRINGIFY(x)) -#endif // C++11 -#endif // CEREAL_RAPIDJSON_STATIC_ASSERT - -// Adopt C++03 implementation from boost -#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT -#ifndef __clang__ -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#endif -CEREAL_RAPIDJSON_NAMESPACE_BEGIN -template struct STATIC_ASSERTION_FAILURE; -template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; -template struct StaticAssertTest {}; -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__GNUC__) || defined(__clang__) -#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) -#else -#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif -#ifndef __clang__ -//!@endcond -#endif - -/*! \def CEREAL_RAPIDJSON_STATIC_ASSERT - \brief (Internal) macro to check for conditions at compile-time - \param x compile-time condition - \hideinitializer - */ -#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ - typedef ::CEREAL_RAPIDJSON_NAMESPACE::StaticAssertTest< \ - sizeof(::CEREAL_RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ - CEREAL_RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif // CEREAL_RAPIDJSON_STATIC_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_LIKELY, CEREAL_RAPIDJSON_UNLIKELY - -//! Compiler branching hint for expression with high probability to be true. -/*! - \ingroup CEREAL_RAPIDJSON_CONFIG - \param x Boolean expression likely to be true. -*/ -#ifndef CEREAL_RAPIDJSON_LIKELY -#if defined(__GNUC__) || defined(__clang__) -#define CEREAL_RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) -#else -#define CEREAL_RAPIDJSON_LIKELY(x) (x) -#endif -#endif - -//! Compiler branching hint for expression with low probability to be true. -/*! - \ingroup CEREAL_RAPIDJSON_CONFIG - \param x Boolean expression unlikely to be true. -*/ -#ifndef CEREAL_RAPIDJSON_UNLIKELY -#if defined(__GNUC__) || defined(__clang__) -#define CEREAL_RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) -#else -#define CEREAL_RAPIDJSON_UNLIKELY(x) (x) -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Helpers - -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN - -#define CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN do { -#define CEREAL_RAPIDJSON_MULTILINEMACRO_END \ -} while((void)0, 0) - -// adopted from Boost -#define CEREAL_RAPIDJSON_VERSION_CODE(x,y,z) \ - (((x)*100000) + ((y)*100) + (z)) - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_DIAG_PUSH/POP, CEREAL_RAPIDJSON_DIAG_OFF - -#if defined(__GNUC__) -#define CEREAL_RAPIDJSON_GNUC \ - CEREAL_RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) -#endif - -#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,2,0)) - -#define CEREAL_RAPIDJSON_PRAGMA(x) _Pragma(CEREAL_RAPIDJSON_STRINGIFY(x)) -#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(GCC diagnostic x) -#define CEREAL_RAPIDJSON_DIAG_OFF(x) \ - CEREAL_RAPIDJSON_DIAG_PRAGMA(ignored CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_JOIN(-W,x))) - -// push/pop support in Clang and GCC>=4.6 -#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) -#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) -#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) -#else // GCC >= 4.2, < 4.6 -#define CEREAL_RAPIDJSON_DIAG_PUSH /* ignored */ -#define CEREAL_RAPIDJSON_DIAG_POP /* ignored */ -#endif - -#elif defined(_MSC_VER) - -// pragma (MSVC specific) -#define CEREAL_RAPIDJSON_PRAGMA(x) __pragma(x) -#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(warning(x)) - -#define CEREAL_RAPIDJSON_DIAG_OFF(x) CEREAL_RAPIDJSON_DIAG_PRAGMA(disable: x) -#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) -#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) - -#else - -#define CEREAL_RAPIDJSON_DIAG_OFF(x) /* ignored */ -#define CEREAL_RAPIDJSON_DIAG_PUSH /* ignored */ -#define CEREAL_RAPIDJSON_DIAG_POP /* ignored */ - -#endif // CEREAL_RAPIDJSON_DIAG_* - -/////////////////////////////////////////////////////////////////////////////// -// C++11 features - -#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS -#if defined(__clang__) -#if __has_feature(cxx_rvalue_references) && \ - (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) -#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#else -#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 -#endif -#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1600) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) - -#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#else -#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 -#endif -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - -#ifndef CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT -#if defined(__clang__) -#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) -#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1900) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 1 -#else -#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 0 -#endif -#endif -#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT -#define CEREAL_RAPIDJSON_NOEXCEPT noexcept -#else -#define CEREAL_RAPIDJSON_NOEXCEPT /* noexcept */ -#endif // CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT - -// no automatic detection, yet -#ifndef CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS -#if (defined(_MSC_VER) && _MSC_VER >= 1700) -#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 1 -#else -#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 0 -#endif -#endif - -#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR -#if defined(__clang__) -#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) -#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1700) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 1 -#else -#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 0 -#endif -#endif // CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR - -//!@endcond - -//! Assertion (in non-throwing contexts). - /*! \ingroup CEREAL_RAPIDJSON_CONFIG - Some functions provide a \c noexcept guarantee, if the compiler supports it. - In these cases, the \ref CEREAL_RAPIDJSON_ASSERT macro cannot be overridden to - throw an exception. This macro adds a separate customization point for - such cases. - - Defaults to C \c assert() (as \ref CEREAL_RAPIDJSON_ASSERT), if \c noexcept is - supported, and to \ref CEREAL_RAPIDJSON_ASSERT otherwise. - */ - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_NOEXCEPT_ASSERT - -#ifndef CEREAL_RAPIDJSON_NOEXCEPT_ASSERT -#ifdef CEREAL_RAPIDJSON_ASSERT_THROWS -#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT -#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) -#else -#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) -#endif // CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT -#else -#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) -#endif // CEREAL_RAPIDJSON_ASSERT_THROWS -#endif // CEREAL_RAPIDJSON_NOEXCEPT_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// new/delete - -#ifndef CEREAL_RAPIDJSON_NEW -///! customization point for global \c new -#define CEREAL_RAPIDJSON_NEW(TypeName) new TypeName -#endif -#ifndef CEREAL_RAPIDJSON_DELETE -///! customization point for global \c delete -#define CEREAL_RAPIDJSON_DELETE(x) delete x -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Type - -/*! \namespace rapidjson - \brief main RapidJSON namespace - \see CEREAL_RAPIDJSON_NAMESPACE -*/ -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Type of JSON value -enum Type { - kNullType = 0, //!< null - kFalseType = 1, //!< false - kTrueType = 2, //!< true - kObjectType = 3, //!< object - kArrayType = 4, //!< array - kStringType = 5, //!< string - kNumberType = 6 //!< number -}; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h deleted file mode 100644 index 43eb52598..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/reader.h +++ /dev/null @@ -1,2230 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_READER_H_ -#define CEREAL_RAPIDJSON_READER_H_ - -/*! \file reader.h */ - -#include "allocators.h" -#include "stream.h" -#include "encodedstream.h" -#include "internal/meta.h" -#include "internal/stack.h" -#include "internal/strtod.h" -#include - -#if defined(CEREAL_RAPIDJSON_SIMD) && defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanForward) -#endif -#ifdef CEREAL_RAPIDJSON_SSE42 -#include -#elif defined(CEREAL_RAPIDJSON_SSE2) -#include -#elif defined(CEREAL_RAPIDJSON_NEON) -#include -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(old-style-cast) -CEREAL_RAPIDJSON_DIAG_OFF(padded) -CEREAL_RAPIDJSON_DIAG_OFF(switch-enum) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code -#endif - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define CEREAL_RAPIDJSON_NOTHING /* deliberately empty */ -#ifndef CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN -#define CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ - CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ - if (CEREAL_RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \ - CEREAL_RAPIDJSON_MULTILINEMACRO_END -#endif -#define CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(CEREAL_RAPIDJSON_NOTHING) -//!@endcond - -/*! \def CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN - \ingroup CEREAL_RAPIDJSON_ERRORS - \brief Macro to indicate a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - This macros can be used as a customization point for the internal - error handling mechanism of RapidJSON. - - A common usage model is to throw an exception instead of requiring the - caller to explicitly check the \ref rapidjson::GenericReader::Parse's - return value: - - \code - #define CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ - throw ParseException(parseErrorCode, #parseErrorCode, offset) - - #include // std::runtime_error - #include "rapidjson/error/error.h" // rapidjson::ParseResult - - struct ParseException : std::runtime_error, rapidjson::ParseResult { - ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) - : std::runtime_error(msg), ParseResult(code, offset) {} - }; - - #include "rapidjson/reader.h" - \endcode - - \see CEREAL_RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse - */ -#ifndef CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN -#define CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ - CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ - CEREAL_RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ - SetParseError(parseErrorCode, offset); \ - CEREAL_RAPIDJSON_MULTILINEMACRO_END -#endif - -/*! \def CEREAL_RAPIDJSON_PARSE_ERROR - \ingroup CEREAL_RAPIDJSON_ERRORS - \brief (Internal) macro to indicate and handle a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - Invokes CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. - - \see CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN - \hideinitializer - */ -#ifndef CEREAL_RAPIDJSON_PARSE_ERROR -#define CEREAL_RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ - CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN \ - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ - CEREAL_RAPIDJSON_MULTILINEMACRO_END -#endif - -#include "error/error.h" // ParseErrorCode, ParseResult - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseFlag - -/*! \def CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief User-defined kParseDefaultFlags definition. - - User can define this as any \c ParseFlag combinations. -*/ -#ifndef CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS -#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags -#endif - -//! Combination of parseFlags -/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream - */ -enum ParseFlag { - kParseNoFlags = 0, //!< No flags are set. - kParseInsituFlag = 1, //!< In-situ(destructive) parsing. - kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. - kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. - kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. - kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). - kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments. - kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings. - kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays. - kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles. - kParseDefaultFlags = CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS -}; - -/////////////////////////////////////////////////////////////////////////////// -// Handler - -/*! \class rapidjson::Handler - \brief Concept for receiving events from GenericReader upon parsing. - The functions return true if no error occurs. If they return false, - the event publisher should terminate the process. -\code -concept Handler { - typename Ch; - - bool Null(); - bool Bool(bool b); - bool Int(int i); - bool Uint(unsigned i); - bool Int64(int64_t i); - bool Uint64(uint64_t i); - bool Double(double d); - /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) - bool RawNumber(const Ch* str, SizeType length, bool copy); - bool String(const Ch* str, SizeType length, bool copy); - bool StartObject(); - bool Key(const Ch* str, SizeType length, bool copy); - bool EndObject(SizeType memberCount); - bool StartArray(); - bool EndArray(SizeType elementCount); -}; -\endcode -*/ -/////////////////////////////////////////////////////////////////////////////// -// BaseReaderHandler - -//! Default implementation of Handler. -/*! This can be used as base class of any reader handler. - \note implements Handler concept -*/ -template, typename Derived = void> -struct BaseReaderHandler { - typedef typename Encoding::Ch Ch; - - typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; - - bool Default() { return true; } - bool Null() { return static_cast(*this).Default(); } - bool Bool(bool) { return static_cast(*this).Default(); } - bool Int(int) { return static_cast(*this).Default(); } - bool Uint(unsigned) { return static_cast(*this).Default(); } - bool Int64(int64_t) { return static_cast(*this).Default(); } - bool Uint64(uint64_t) { return static_cast(*this).Default(); } - bool Double(double) { return static_cast(*this).Default(); } - /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) - bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } - bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } - bool StartObject() { return static_cast(*this).Default(); } - bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } - bool EndObject(SizeType) { return static_cast(*this).Default(); } - bool StartArray() { return static_cast(*this).Default(); } - bool EndArray(SizeType) { return static_cast(*this).Default(); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamLocalCopy - -namespace internal { - -template::copyOptimization> -class StreamLocalCopy; - -//! Do copy optimization. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original), original_(original) {} - ~StreamLocalCopy() { original_ = s; } - - Stream s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; - - Stream& original_; -}; - -//! Keep reference. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original) {} - - Stream& s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; -}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// SkipWhitespace - -//! Skip the JSON white spaces in a stream. -/*! \param is A input stream for skipping white spaces. - \note This function has SSE2/SSE4.2 specialization. -*/ -template -void SkipWhitespace(InputStream& is) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - typename InputStream::Ch c; - while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t') - s.Take(); -} - -inline const char* SkipWhitespace(const char* p, const char* end) { - while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - return p; -} - -#ifdef CEREAL_RAPIDJSON_SSE42 -//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string using SIMD - static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); - if (r != 16) // some of characters is non-whitespace - return p + r; - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - // The middle of string using SIMD - static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); - - for (; p <= end - 16; p += 16) { - const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); - const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); - if (r != 16) // some of characters is non-whitespace - return p + r; - } - - return SkipWhitespace(p, end); -} - -#elif defined(CEREAL_RAPIDJSON_SSE2) - -//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string - #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } - static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; - #undef C16 - - const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); - const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); - const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); - const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - __m128i x = _mm_cmpeq_epi8(s, w0); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); - unsigned short r = static_cast(~_mm_movemask_epi8(x)); - if (r != 0) { // some of characters may be non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - // The rest of string - #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } - static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; - #undef C16 - - const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); - const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); - const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); - const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); - - for (; p <= end - 16; p += 16) { - const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); - __m128i x = _mm_cmpeq_epi8(s, w0); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); - unsigned short r = static_cast(~_mm_movemask_epi8(x)); - if (r != 0) { // some of characters may be non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } - - return SkipWhitespace(p, end); -} - -#elif defined(CEREAL_RAPIDJSON_NEON) - -//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - const uint8x16_t w0 = vmovq_n_u8(' '); - const uint8x16_t w1 = vmovq_n_u8('\n'); - const uint8x16_t w2 = vmovq_n_u8('\r'); - const uint8x16_t w3 = vmovq_n_u8('\t'); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, w0); - x = vorrq_u8(x, vceqq_u8(s, w1)); - x = vorrq_u8(x, vceqq_u8(s, w2)); - x = vorrq_u8(x, vceqq_u8(s, w3)); - - x = vmvnq_u8(x); // Negate - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - if (low == 0) { - if (high != 0) { - int lz =__builtin_clzll(high);; - return p + 8 + (lz >> 3); - } - } else { - int lz = __builtin_clzll(low);; - return p + (lz >> 3); - } - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - const uint8x16_t w0 = vmovq_n_u8(' '); - const uint8x16_t w1 = vmovq_n_u8('\n'); - const uint8x16_t w2 = vmovq_n_u8('\r'); - const uint8x16_t w3 = vmovq_n_u8('\t'); - - for (; p <= end - 16; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, w0); - x = vorrq_u8(x, vceqq_u8(s, w1)); - x = vorrq_u8(x, vceqq_u8(s, w2)); - x = vorrq_u8(x, vceqq_u8(s, w3)); - - x = vmvnq_u8(x); // Negate - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - if (low == 0) { - if (high != 0) { - int lz = __builtin_clzll(high); - return p + 8 + (lz >> 3); - } - } else { - int lz = __builtin_clzll(low); - return p + (lz >> 3); - } - } - - return SkipWhitespace(p, end); -} - -#endif // CEREAL_RAPIDJSON_NEON - -#ifdef CEREAL_RAPIDJSON_SIMD -//! Template function specialization for InsituStringStream -template<> inline void SkipWhitespace(InsituStringStream& is) { - is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); -} - -//! Template function specialization for StringStream -template<> inline void SkipWhitespace(StringStream& is) { - is.src_ = SkipWhitespace_SIMD(is.src_); -} - -template<> inline void SkipWhitespace(EncodedInputStream, MemoryStream>& is) { - is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_); -} -#endif // CEREAL_RAPIDJSON_SIMD - -/////////////////////////////////////////////////////////////////////////////// -// GenericReader - -//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. -/*! GenericReader parses JSON text from a stream, and send events synchronously to an - object implementing Handler concept. - - It needs to allocate a stack for storing a single decoded string during - non-destructive parsing. - - For in-situ parsing, the decoded string is directly written to the source - text string, no temporary buffer is required. - - A GenericReader object can be reused for parsing multiple JSON text. - - \tparam SourceEncoding Encoding of the input stream. - \tparam TargetEncoding Encoding of the parse output. - \tparam StackAllocator Allocator type for stack. -*/ -template -class GenericReader { -public: - typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type - - //! Constructor. - /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) - \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) - */ - GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : - stack_(stackAllocator, stackCapacity), parseResult_(), state_(IterativeParsingStartState) {} - - //! Parse JSON text. - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept. - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - if (parseFlags & kParseIterativeFlag) - return IterativeParse(is, handler); - - parseResult_.Clear(); - - ClearStackOnExit scope(*this); - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() == '\0')) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - else { - ParseValue(is, handler); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (!(parseFlags & kParseStopWhenDoneFlag)) { - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() != '\0')) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - } - } - - return parseResult_; - } - - //! Parse JSON text (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - return Parse(is, handler); - } - - //! Initialize JSON text token-by-token parsing - /*! - */ - void IterativeParseInit() { - parseResult_.Clear(); - state_ = IterativeParsingStartState; - } - - //! Parse one token from JSON text - /*! \tparam InputStream Type of input stream, implementing Stream concept - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - bool IterativeParseNext(InputStream& is, Handler& handler) { - while (CEREAL_RAPIDJSON_LIKELY(is.Peek() != '\0')) { - SkipWhitespaceAndComments(is); - - Token t = Tokenize(is.Peek()); - IterativeParsingState n = Predict(state_, t); - IterativeParsingState d = Transit(state_, t, n, is, handler); - - // If we've finished or hit an error... - if (CEREAL_RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) { - // Report errors. - if (d == IterativeParsingErrorState) { - HandleError(state_, is); - return false; - } - - // Transition to the finish state. - CEREAL_RAPIDJSON_ASSERT(d == IterativeParsingFinishState); - state_ = d; - - // If StopWhenDone is not set... - if (!(parseFlags & kParseStopWhenDoneFlag)) { - // ... and extra non-whitespace data is found... - SkipWhitespaceAndComments(is); - if (is.Peek() != '\0') { - // ... this is considered an error. - HandleError(state_, is); - return false; - } - } - - // Success! We are done! - return true; - } - - // Transition to the new state. - state_ = d; - - // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now. - if (!IsIterativeParsingDelimiterState(n)) - return true; - } - - // We reached the end of file. - stack_.Clear(); - - if (state_ != IterativeParsingFinishState) { - HandleError(state_, is); - return false; - } - - return true; - } - - //! Check if token-by-token parsing JSON text is complete - /*! \return Whether the JSON has been fully decoded. - */ - CEREAL_RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const { - return IsIterativeParsingCompleteState(state_); - } - - //! Whether a parse error has occurred in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - -protected: - void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } - -private: - // Prohibit copy constructor & assignment operator. - GenericReader(const GenericReader&); - GenericReader& operator=(const GenericReader&); - - void ClearStack() { stack_.Clear(); } - - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericReader& r) : r_(r) {} - ~ClearStackOnExit() { r_.ClearStack(); } - private: - GenericReader& r_; - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - }; - - template - void SkipWhitespaceAndComments(InputStream& is) { - SkipWhitespace(is); - - if (parseFlags & kParseCommentsFlag) { - while (CEREAL_RAPIDJSON_UNLIKELY(Consume(is, '/'))) { - if (Consume(is, '*')) { - while (true) { - if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() == '\0')) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); - else if (Consume(is, '*')) { - if (Consume(is, '/')) - break; - } - else - is.Take(); - } - } - else if (CEREAL_RAPIDJSON_LIKELY(Consume(is, '/'))) - while (is.Peek() != '\0' && is.Take() != '\n') {} - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); - - SkipWhitespace(is); - } - } - } - - // Parse object: { string : value, ... } - template - void ParseObject(InputStream& is, Handler& handler) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() == '{'); - is.Take(); // Skip '{' - - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartObject())) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, '}')) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType memberCount = 0;;) { - if (CEREAL_RAPIDJSON_UNLIKELY(is.Peek() != '"')) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); - - ParseString(is, handler, true); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (CEREAL_RAPIDJSON_UNLIKELY(!Consume(is, ':'))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ParseValue(is, handler); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ++memberCount; - - switch (is.Peek()) { - case ',': - is.Take(); - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - break; - case '}': - is.Take(); - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - default: - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy - } - - if (parseFlags & kParseTrailingCommasFlag) { - if (is.Peek() == '}') { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - is.Take(); - return; - } - } - } - } - - // Parse array: [ value, ... ] - template - void ParseArray(InputStream& is, Handler& handler) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() == '['); - is.Take(); // Skip '[' - - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.StartArray())) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, ']')) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType elementCount = 0;;) { - ParseValue(is, handler); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ++elementCount; - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, ',')) { - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - } - else if (Consume(is, ']')) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); - - if (parseFlags & kParseTrailingCommasFlag) { - if (is.Peek() == ']') { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - is.Take(); - return; - } - } - } - } - - template - void ParseNull(InputStream& is, Handler& handler) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() == 'n'); - is.Take(); - - if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Null())) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - void ParseTrue(InputStream& is, Handler& handler) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() == 't'); - is.Take(); - - if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Bool(true))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - void ParseFalse(InputStream& is, Handler& handler) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() == 'f'); - is.Take(); - - if (CEREAL_RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) { - if (CEREAL_RAPIDJSON_UNLIKELY(!handler.Bool(false))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - CEREAL_RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) { - if (CEREAL_RAPIDJSON_LIKELY(is.Peek() == expect)) { - is.Take(); - return true; - } - else - return false; - } - - // Helper function to parse four hexadecimal digits in \uXXXX in ParseString(). - template - unsigned ParseHex4(InputStream& is, size_t escapeOffset) { - unsigned codepoint = 0; - for (int i = 0; i < 4; i++) { - Ch c = is.Peek(); - codepoint <<= 4; - codepoint += static_cast(c); - if (c >= '0' && c <= '9') - codepoint -= '0'; - else if (c >= 'A' && c <= 'F') - codepoint -= 'A' - 10; - else if (c >= 'a' && c <= 'f') - codepoint -= 'a' - 10; - else { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); - } - is.Take(); - } - return codepoint; - } - - template - class StackStream { - public: - typedef CharType Ch; - - StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} - CEREAL_RAPIDJSON_FORCEINLINE void Put(Ch c) { - *stack_.template Push() = c; - ++length_; - } - - CEREAL_RAPIDJSON_FORCEINLINE void* Push(SizeType count) { - length_ += count; - return stack_.template Push(count); - } - - size_t Length() const { return length_; } - - Ch* Pop() { - return stack_.template Pop(length_); - } - - private: - StackStream(const StackStream&); - StackStream& operator=(const StackStream&); - - internal::Stack& stack_; - SizeType length_; - }; - - // Parse string and generate String event. Different code paths for kParseInsituFlag. - template - void ParseString(InputStream& is, Handler& handler, bool isKey = false) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - CEREAL_RAPIDJSON_ASSERT(s.Peek() == '\"'); - s.Take(); // Skip '\"' - - bool success = false; - if (parseFlags & kParseInsituFlag) { - typename InputStream::Ch *head = s.PutBegin(); - ParseStringToStream(s, s); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - size_t length = s.PutEnd(head) - 1; - CEREAL_RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); - const typename TargetEncoding::Ch* const str = reinterpret_cast(head); - success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); - } - else { - StackStream stackStream(stack_); - ParseStringToStream(s, stackStream); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - SizeType length = static_cast(stackStream.Length()) - 1; - const typename TargetEncoding::Ch* const str = stackStream.Pop(); - success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); - } - if (CEREAL_RAPIDJSON_UNLIKELY(!success)) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); - } - - // Parse string to an output is - // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. - template - CEREAL_RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - static const char escape[256] = { - Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', - Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, - 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, - 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 - }; -#undef Z16 -//!@endcond - - for (;;) { - // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation. - if (!(parseFlags & kParseValidateEncodingFlag)) - ScanCopyUnescapedString(is, os); - - Ch c = is.Peek(); - if (CEREAL_RAPIDJSON_UNLIKELY(c == '\\')) { // Escape - size_t escapeOffset = is.Tell(); // For invalid escaping, report the initial '\\' as error offset - is.Take(); - Ch e = is.Peek(); - if ((sizeof(Ch) == 1 || unsigned(e) < 256) && CEREAL_RAPIDJSON_LIKELY(escape[static_cast(e)])) { - is.Take(); - os.Put(static_cast(escape[static_cast(e)])); - } - else if (CEREAL_RAPIDJSON_LIKELY(e == 'u')) { // Unicode - is.Take(); - unsigned codepoint = ParseHex4(is, escapeOffset); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (CEREAL_RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDBFF)) { - // Handle UTF-16 surrogate pair - if (CEREAL_RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u'))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); - unsigned codepoint2 = ParseHex4(is, escapeOffset); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (CEREAL_RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); - codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; - } - TEncoding::Encode(os, codepoint); - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset); - } - else if (CEREAL_RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote - is.Take(); - os.Put('\0'); // null-terminate the string - return; - } - else if (CEREAL_RAPIDJSON_UNLIKELY(static_cast(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF - if (c == '\0') - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell()); - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); - } - else { - size_t offset = is.Tell(); - if (CEREAL_RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ? - !Transcoder::Validate(is, os) : - !Transcoder::Transcode(is, os)))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset); - } - } - } - - template - static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) { - // Do nothing for generic version - } - -#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) - // StringStream -> StackStream - static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { - const char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - return; - } - else - os.Put(*p++); - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - SizeType length; - #ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; - #else - length = static_cast(__builtin_ffs(r) - 1); - #endif - if (length != 0) { - char* q = reinterpret_cast(os.Push(length)); - for (size_t i = 0; i < length; i++) - q[i] = p[i]; - - p += length; - } - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); - } - - is.src_ = p; - } - - // InsituStringStream -> InsituStringStream - static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { - CEREAL_RAPIDJSON_ASSERT(&is == &os); - (void)os; - - if (is.src_ == is.dst_) { - SkipUnescapedString(is); - return; - } - - char* p = is.src_; - char *q = is.dst_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - is.dst_ = q; - return; - } - else - *q++ = *p++; - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16, q += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - size_t length; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; -#else - length = static_cast(__builtin_ffs(r) - 1); -#endif - for (const char* pend = p + length; p != pend; ) - *q++ = *p++; - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); - } - - is.src_ = p; - is.dst_ = q; - } - - // When read/write pointers are the same for insitu stream, just skip unescaped characters - static CEREAL_RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { - CEREAL_RAPIDJSON_ASSERT(is.src_ == is.dst_); - char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - for (; p != nextAligned; p++) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = is.dst_ = p; - return; - } - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - size_t length; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; -#else - length = static_cast(__builtin_ffs(r) - 1); -#endif - p += length; - break; - } - } - - is.src_ = is.dst_ = p; - } -#elif defined(CEREAL_RAPIDJSON_NEON) - // StringStream -> StackStream - static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { - const char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - return; - } - else - os.Put(*p++); - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - SizeType length = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - unsigned lz = (unsigned)__builtin_clzll(high);; - length = 8 + (lz >> 3); - escaped = true; - } - } else { - unsigned lz = (unsigned)__builtin_clzll(low);; - length = lz >> 3; - escaped = true; - } - if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - if (length != 0) { - char* q = reinterpret_cast(os.Push(length)); - for (size_t i = 0; i < length; i++) - q[i] = p[i]; - - p += length; - } - break; - } - vst1q_u8(reinterpret_cast(os.Push(16)), s); - } - - is.src_ = p; - } - - // InsituStringStream -> InsituStringStream - static CEREAL_RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { - CEREAL_RAPIDJSON_ASSERT(&is == &os); - (void)os; - - if (is.src_ == is.dst_) { - SkipUnescapedString(is); - return; - } - - char* p = is.src_; - char *q = is.dst_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - is.dst_ = q; - return; - } - else - *q++ = *p++; - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16, q += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - SizeType length = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - unsigned lz = (unsigned)__builtin_clzll(high); - length = 8 + (lz >> 3); - escaped = true; - } - } else { - unsigned lz = (unsigned)__builtin_clzll(low); - length = lz >> 3; - escaped = true; - } - if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - for (const char* pend = p + length; p != pend; ) { - *q++ = *p++; - } - break; - } - vst1q_u8(reinterpret_cast(q), s); - } - - is.src_ = p; - is.dst_ = q; - } - - // When read/write pointers are the same for insitu stream, just skip unescaped characters - static CEREAL_RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { - CEREAL_RAPIDJSON_ASSERT(is.src_ == is.dst_); - char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - for (; p != nextAligned; p++) - if (CEREAL_RAPIDJSON_UNLIKELY(*p == '\"') || CEREAL_RAPIDJSON_UNLIKELY(*p == '\\') || CEREAL_RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = is.dst_ = p; - return; - } - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - if (low == 0) { - if (high != 0) { - int lz = __builtin_clzll(high); - p += 8 + (lz >> 3); - break; - } - } else { - int lz = __builtin_clzll(low); - p += lz >> 3; - break; - } - } - - is.src_ = is.dst_ = p; - } -#endif // CEREAL_RAPIDJSON_NEON - - template - class NumberStream; - - template - class NumberStream { - public: - typedef typename InputStream::Ch Ch; - - NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } - - CEREAL_RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } - CEREAL_RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } - CEREAL_RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } - CEREAL_RAPIDJSON_FORCEINLINE void Push(char) {} - - size_t Tell() { return is.Tell(); } - size_t Length() { return 0; } - const char* Pop() { return 0; } - - protected: - NumberStream& operator=(const NumberStream&); - - InputStream& is; - }; - - template - class NumberStream : public NumberStream { - typedef NumberStream Base; - public: - NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s), stackStream(reader.stack_) {} - - CEREAL_RAPIDJSON_FORCEINLINE Ch TakePush() { - stackStream.Put(static_cast(Base::is.Peek())); - return Base::is.Take(); - } - - CEREAL_RAPIDJSON_FORCEINLINE void Push(char c) { - stackStream.Put(c); - } - - size_t Length() { return stackStream.Length(); } - - const char* Pop() { - stackStream.Put('\0'); - return stackStream.Pop(); - } - - private: - StackStream stackStream; - }; - - template - class NumberStream : public NumberStream { - typedef NumberStream Base; - public: - NumberStream(GenericReader& reader, InputStream& is) : Base(reader, is) {} - - CEREAL_RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); } - }; - - template - void ParseNumber(InputStream& is, Handler& handler) { - internal::StreamLocalCopy copy(is); - NumberStream s(*this, copy.s); - - size_t startOffset = s.Tell(); - double d = 0.0; - bool useNanOrInf = false; - - // Parse minus - bool minus = Consume(s, '-'); - - // Parse int: zero / ( digit1-9 *DIGIT ) - unsigned i = 0; - uint64_t i64 = 0; - bool use64bit = false; - int significandDigit = 0; - if (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() == '0')) { - i = 0; - s.TakePush(); - } - else if (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) { - i = static_cast(s.TakePush() - '0'); - - if (minus) - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (CEREAL_RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648 - if (CEREAL_RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (CEREAL_RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295 - if (CEREAL_RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - // Parse NaN or Infinity here - else if ((parseFlags & kParseNanAndInfFlag) && CEREAL_RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) { - if (Consume(s, 'N')) { - if (Consume(s, 'a') && Consume(s, 'N')) { - d = std::numeric_limits::quiet_NaN(); - useNanOrInf = true; - } - } - else if (CEREAL_RAPIDJSON_LIKELY(Consume(s, 'I'))) { - if (Consume(s, 'n') && Consume(s, 'f')) { - d = (minus ? -std::numeric_limits::infinity() : std::numeric_limits::infinity()); - useNanOrInf = true; - - if (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n') - && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) { - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - } - } - } - - if (CEREAL_RAPIDJSON_UNLIKELY(!useNanOrInf)) { - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - } - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - - // Parse 64bit int - bool useDouble = false; - if (use64bit) { - if (minus) - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (CEREAL_RAPIDJSON_UNLIKELY(i64 >= CEREAL_RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808 - if (CEREAL_RAPIDJSON_LIKELY(i64 != CEREAL_RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) { - d = static_cast(i64); - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (CEREAL_RAPIDJSON_UNLIKELY(i64 >= CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615 - if (CEREAL_RAPIDJSON_LIKELY(i64 != CEREAL_RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) { - d = static_cast(i64); - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - - // Force double for big integer - if (useDouble) { - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - d = d * 10 + (s.TakePush() - '0'); - } - } - - // Parse frac = decimal-point 1*DIGIT - int expFrac = 0; - size_t decimalPosition; - if (Consume(s, '.')) { - decimalPosition = s.Length(); - - if (CEREAL_RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9'))) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); - - if (!useDouble) { -#if CEREAL_RAPIDJSON_64BIT - // Use i64 to store significand in 64-bit architecture - if (!use64bit) - i64 = i; - - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (i64 > CEREAL_RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path - break; - else { - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - --expFrac; - if (i64 != 0) - significandDigit++; - } - } - - d = static_cast(i64); -#else - // Use double to store significand in 32-bit architecture - d = static_cast(use64bit ? i64 : i); -#endif - useDouble = true; - } - - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (significandDigit < 17) { - d = d * 10.0 + (s.TakePush() - '0'); - --expFrac; - if (CEREAL_RAPIDJSON_LIKELY(d > 0.0)) - significandDigit++; - } - else - s.TakePush(); - } - } - else - decimalPosition = s.Length(); // decimal position at the end of integer. - - // Parse exp = e [ minus / plus ] 1*DIGIT - int exp = 0; - if (Consume(s, 'e') || Consume(s, 'E')) { - if (!useDouble) { - d = static_cast(use64bit ? i64 : i); - useDouble = true; - } - - bool expMinus = false; - if (Consume(s, '+')) - ; - else if (Consume(s, '-')) - expMinus = true; - - if (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = static_cast(s.Take() - '0'); - if (expMinus) { - // (exp + expFrac) must not underflow int => we're detecting when -exp gets - // dangerously close to INT_MIN (a pessimistic next digit 9 would push it into - // underflow territory): - // - // -(exp * 10 + 9) + expFrac >= INT_MIN - // <=> exp <= (expFrac - INT_MIN - 9) / 10 - CEREAL_RAPIDJSON_ASSERT(expFrac <= 0); - int maxExp = (expFrac + 2147483639) / 10; - - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = exp * 10 + static_cast(s.Take() - '0'); - if (CEREAL_RAPIDJSON_UNLIKELY(exp > maxExp)) { - while (CEREAL_RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent - s.Take(); - } - } - } - else { // positive exp - int maxExp = 308 - expFrac; - while (CEREAL_RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = exp * 10 + static_cast(s.Take() - '0'); - if (CEREAL_RAPIDJSON_UNLIKELY(exp > maxExp)) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); - } - } - } - else - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); - - if (expMinus) - exp = -exp; - } - - // Finish parsing, call event according to the type of number. - bool cont = true; - - if (parseFlags & kParseNumbersAsStringsFlag) { - if (parseFlags & kParseInsituFlag) { - s.Pop(); // Pop stack no matter if it will be used or not. - typename InputStream::Ch* head = is.PutBegin(); - const size_t length = s.Tell() - startOffset; - CEREAL_RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); - // unable to insert the \0 character here, it will erase the comma after this number - const typename TargetEncoding::Ch* const str = reinterpret_cast(head); - cont = handler.RawNumber(str, SizeType(length), false); - } - else { - SizeType numCharsToCopy = static_cast(s.Length()); - StringStream srcStream(s.Pop()); - StackStream dstStream(stack_); - while (numCharsToCopy--) { - Transcoder, TargetEncoding>::Transcode(srcStream, dstStream); - } - dstStream.Put('\0'); - const typename TargetEncoding::Ch* str = dstStream.Pop(); - const SizeType length = static_cast(dstStream.Length()) - 1; - cont = handler.RawNumber(str, SizeType(length), true); - } - } - else { - size_t length = s.Length(); - const char* decimal = s.Pop(); // Pop stack no matter if it will be used or not. - - if (useDouble) { - int p = exp + expFrac; - if (parseFlags & kParseFullPrecisionFlag) - d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); - else - d = internal::StrtodNormalPrecision(d, p); - - // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal - if (d > (std::numeric_limits::max)()) { - // Overflow - // TODO: internal::StrtodX should report overflow (or underflow) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); - } - - cont = handler.Double(minus ? -d : d); - } - else if (useNanOrInf) { - cont = handler.Double(d); - } - else { - if (use64bit) { - if (minus) - cont = handler.Int64(static_cast(~i64 + 1)); - else - cont = handler.Uint64(i64); - } - else { - if (minus) - cont = handler.Int(static_cast(~i + 1)); - else - cont = handler.Uint(i); - } - } - } - if (CEREAL_RAPIDJSON_UNLIKELY(!cont)) - CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset); - } - - // Parse any JSON value - template - void ParseValue(InputStream& is, Handler& handler) { - switch (is.Peek()) { - case 'n': ParseNull (is, handler); break; - case 't': ParseTrue (is, handler); break; - case 'f': ParseFalse (is, handler); break; - case '"': ParseString(is, handler); break; - case '{': ParseObject(is, handler); break; - case '[': ParseArray (is, handler); break; - default : - ParseNumber(is, handler); - break; - - } - } - - // Iterative Parsing - - // States - enum IterativeParsingState { - IterativeParsingFinishState = 0, // sink states at top - IterativeParsingErrorState, // sink states at top - IterativeParsingStartState, - - // Object states - IterativeParsingObjectInitialState, - IterativeParsingMemberKeyState, - IterativeParsingMemberValueState, - IterativeParsingObjectFinishState, - - // Array states - IterativeParsingArrayInitialState, - IterativeParsingElementState, - IterativeParsingArrayFinishState, - - // Single value state - IterativeParsingValueState, - - // Delimiter states (at bottom) - IterativeParsingElementDelimiterState, - IterativeParsingMemberDelimiterState, - IterativeParsingKeyValueDelimiterState, - - cIterativeParsingStateCount - }; - - // Tokens - enum Token { - LeftBracketToken = 0, - RightBracketToken, - - LeftCurlyBracketToken, - RightCurlyBracketToken, - - CommaToken, - ColonToken, - - StringToken, - FalseToken, - TrueToken, - NullToken, - NumberToken, - - kTokenCount - }; - - CEREAL_RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) const { - -//!@cond CEREAL_RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define N NumberToken -#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N - // Maps from ASCII to Token - static const unsigned char tokenMap[256] = { - N16, // 00~0F - N16, // 10~1F - N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F - N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F - N16, // 40~4F - N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F - N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F - N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F - N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF - }; -#undef N -#undef N16 -//!@endcond - - if (sizeof(Ch) == 1 || static_cast(c) < 256) - return static_cast(tokenMap[static_cast(c)]); - else - return NumberToken; - } - - CEREAL_RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) const { - // current state x one lookahead token -> new state - static const char G[cIterativeParsingStateCount][kTokenCount] = { - // Finish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Error(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Start - { - IterativeParsingArrayInitialState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingValueState, // String - IterativeParsingValueState, // False - IterativeParsingValueState, // True - IterativeParsingValueState, // Null - IterativeParsingValueState // Number - }, - // ObjectInitial - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberKey - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingKeyValueDelimiterState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberValue - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingMemberDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ObjectFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ArrayInitial - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // Element - { - IterativeParsingErrorState, // Left bracket - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingElementDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ArrayFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Single Value (sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ElementDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // MemberDelimiter - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // KeyValueDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberValueState, // String - IterativeParsingMemberValueState, // False - IterativeParsingMemberValueState, // True - IterativeParsingMemberValueState, // Null - IterativeParsingMemberValueState // Number - }, - }; // End of G - - return static_cast(G[state][token]); - } - - // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). - // May return a new state on state pop. - template - CEREAL_RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { - (void)token; - - switch (dst) { - case IterativeParsingErrorState: - return dst; - - case IterativeParsingObjectInitialState: - case IterativeParsingArrayInitialState: - { - // Push the state(Element or MemeberValue) if we are nested in another array or value of member. - // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. - IterativeParsingState n = src; - if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) - n = IterativeParsingElementState; - else if (src == IterativeParsingKeyValueDelimiterState) - n = IterativeParsingMemberValueState; - // Push current state. - *stack_.template Push(1) = n; - // Initialize and push the member/element count. - *stack_.template Push(1) = 0; - // Call handler - bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); - // On handler short circuits the parsing. - if (!hr) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return dst; - } - } - - case IterativeParsingMemberKeyState: - ParseString(is, handler, true); - if (HasParseError()) - return IterativeParsingErrorState; - else - return dst; - - case IterativeParsingKeyValueDelimiterState: - CEREAL_RAPIDJSON_ASSERT(token == ColonToken); - is.Take(); - return dst; - - case IterativeParsingMemberValueState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingElementState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingMemberDelimiterState: - case IterativeParsingElementDelimiterState: - is.Take(); - // Update member/element count. - *stack_.template Top() = *stack_.template Top() + 1; - return dst; - - case IterativeParsingObjectFinishState: - { - // Transit from delimiter is only allowed when trailing commas are enabled - if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell()); - return IterativeParsingErrorState; - } - // Get member count. - SizeType c = *stack_.template Pop(1); - // If the object is not empty, count the last member. - if (src == IterativeParsingMemberValueState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndObject(c); - // On handler short circuits the parsing. - if (!hr) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - case IterativeParsingArrayFinishState: - { - // Transit from delimiter is only allowed when trailing commas are enabled - if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell()); - return IterativeParsingErrorState; - } - // Get element count. - SizeType c = *stack_.template Pop(1); - // If the array is not empty, count the last element. - if (src == IterativeParsingElementState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndArray(c); - // On handler short circuits the parsing. - if (!hr) { - CEREAL_RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - default: - // This branch is for IterativeParsingValueState actually. - // Use `default:` rather than - // `case IterativeParsingValueState:` is for code coverage. - - // The IterativeParsingStartState is not enumerated in this switch-case. - // It is impossible for that case. And it can be caught by following assertion. - - // The IterativeParsingFinishState is not enumerated in this switch-case either. - // It is a "derivative" state which cannot triggered from Predict() directly. - // Therefore it cannot happen here. And it can be caught by following assertion. - CEREAL_RAPIDJSON_ASSERT(dst == IterativeParsingValueState); - - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return IterativeParsingFinishState; - } - } - - template - void HandleError(IterativeParsingState src, InputStream& is) { - if (HasParseError()) { - // Error flag has been set. - return; - } - - switch (src) { - case IterativeParsingStartState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return; - case IterativeParsingFinishState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return; - case IterativeParsingObjectInitialState: - case IterativeParsingMemberDelimiterState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return; - case IterativeParsingMemberKeyState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return; - case IterativeParsingMemberValueState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return; - case IterativeParsingKeyValueDelimiterState: - case IterativeParsingArrayInitialState: - case IterativeParsingElementDelimiterState: CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return; - default: CEREAL_RAPIDJSON_ASSERT(src == IterativeParsingElementState); CEREAL_RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return; - } - } - - CEREAL_RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const { - return s >= IterativeParsingElementDelimiterState; - } - - CEREAL_RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const { - return s <= IterativeParsingErrorState; - } - - template - ParseResult IterativeParse(InputStream& is, Handler& handler) { - parseResult_.Clear(); - ClearStackOnExit scope(*this); - IterativeParsingState state = IterativeParsingStartState; - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - while (is.Peek() != '\0') { - Token t = Tokenize(is.Peek()); - IterativeParsingState n = Predict(state, t); - IterativeParsingState d = Transit(state, t, n, is, handler); - - if (d == IterativeParsingErrorState) { - HandleError(state, is); - break; - } - - state = d; - - // Do not further consume streams if a root JSON has been parsed. - if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) - break; - - SkipWhitespaceAndComments(is); - CEREAL_RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - - // Handle the end of file. - if (state != IterativeParsingFinishState) - HandleError(state, is); - - return parseResult_; - } - - static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. - internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. - ParseResult parseResult_; - IterativeParsingState state_; -}; // class GenericReader - -//! Reader with UTF8 encoding and default allocator. -typedef GenericReader, UTF8<> > Reader; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) || defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_POP -#endif - - -#ifdef __GNUC__ -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_READER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h deleted file mode 100644 index 17366c670..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/schema.h +++ /dev/null @@ -1,2497 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available-> -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved-> -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License-> You may obtain a copy of the License at -// -// http://opensource->org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied-> See the License for the -// specific language governing permissions and limitations under the License-> - -#ifndef CEREAL_RAPIDJSON_SCHEMA_H_ -#define CEREAL_RAPIDJSON_SCHEMA_H_ - -#include "document.h" -#include "pointer.h" -#include "stringbuffer.h" -#include // abs, floor - -#if !defined(CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX) -#define CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1 -#else -#define CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0 -#endif - -#if !CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) -#define CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX 1 -#else -#define CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX 0 -#endif - -#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX -#include "internal/regex.h" -#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX -#include -#endif - -#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX || CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX -#define CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX 1 -#else -#define CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX 0 -#endif - -#ifndef CEREAL_RAPIDJSON_SCHEMA_VERBOSE -#define CEREAL_RAPIDJSON_SCHEMA_VERBOSE 0 -#endif - -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE -#include "stringbuffer.h" -#endif - -CEREAL_RAPIDJSON_DIAG_PUSH - -#if defined(__GNUC__) -CEREAL_RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_OFF(weak-vtables) -CEREAL_RAPIDJSON_DIAG_OFF(exit-time-destructors) -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat-pedantic) -CEREAL_RAPIDJSON_DIAG_OFF(variadic-macros) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Verbose Utilities - -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - -namespace internal { - -inline void PrintInvalidKeyword(const char* keyword) { - printf("Fail keyword: %s\n", keyword); -} - -inline void PrintInvalidKeyword(const wchar_t* keyword) { - wprintf(L"Fail keyword: %ls\n", keyword); -} - -inline void PrintInvalidDocument(const char* document) { - printf("Fail document: %s\n\n", document); -} - -inline void PrintInvalidDocument(const wchar_t* document) { - wprintf(L"Fail document: %ls\n\n", document); -} - -inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) { - printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d); -} - -inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) { - wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d); -} - -} // namespace internal - -#endif // CEREAL_RAPIDJSON_SCHEMA_VERBOSE - -/////////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN - -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE -#define CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword) -#else -#define CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) -#endif - -#define CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\ -CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN\ - context.invalidKeyword = keyword.GetString();\ - CEREAL_RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword.GetString());\ - return false;\ -CEREAL_RAPIDJSON_MULTILINEMACRO_END - -/////////////////////////////////////////////////////////////////////////////// -// Forward declarations - -template -class GenericSchemaDocument; - -namespace internal { - -template -class Schema; - -/////////////////////////////////////////////////////////////////////////////// -// ISchemaValidator - -class ISchemaValidator { -public: - virtual ~ISchemaValidator() {} - virtual bool IsValid() const = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// ISchemaStateFactory - -template -class ISchemaStateFactory { -public: - virtual ~ISchemaStateFactory() {} - virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&) = 0; - virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0; - virtual void* CreateHasher() = 0; - virtual uint64_t GetHashCode(void* hasher) = 0; - virtual void DestroryHasher(void* hasher) = 0; - virtual void* MallocState(size_t size) = 0; - virtual void FreeState(void* p) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// IValidationErrorHandler - -template -class IValidationErrorHandler { -public: - typedef typename SchemaType::Ch Ch; - typedef typename SchemaType::SValue SValue; - - virtual ~IValidationErrorHandler() {} - - virtual void NotMultipleOf(int64_t actual, const SValue& expected) = 0; - virtual void NotMultipleOf(uint64_t actual, const SValue& expected) = 0; - virtual void NotMultipleOf(double actual, const SValue& expected) = 0; - virtual void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void AboveMaximum(double actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(double actual, const SValue& expected, bool exclusive) = 0; - - virtual void TooLong(const Ch* str, SizeType length, SizeType expected) = 0; - virtual void TooShort(const Ch* str, SizeType length, SizeType expected) = 0; - virtual void DoesNotMatch(const Ch* str, SizeType length) = 0; - - virtual void DisallowedItem(SizeType index) = 0; - virtual void TooFewItems(SizeType actualCount, SizeType expectedCount) = 0; - virtual void TooManyItems(SizeType actualCount, SizeType expectedCount) = 0; - virtual void DuplicateItems(SizeType index1, SizeType index2) = 0; - - virtual void TooManyProperties(SizeType actualCount, SizeType expectedCount) = 0; - virtual void TooFewProperties(SizeType actualCount, SizeType expectedCount) = 0; - virtual void StartMissingProperties() = 0; - virtual void AddMissingProperty(const SValue& name) = 0; - virtual bool EndMissingProperties() = 0; - virtual void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void DisallowedProperty(const Ch* name, SizeType length) = 0; - - virtual void StartDependencyErrors() = 0; - virtual void StartMissingDependentProperties() = 0; - virtual void AddMissingDependentProperty(const SValue& targetName) = 0; - virtual void EndMissingDependentProperties(const SValue& sourceName) = 0; - virtual void AddDependencySchemaError(const SValue& souceName, ISchemaValidator* subvalidator) = 0; - virtual bool EndDependencyErrors() = 0; - - virtual void DisallowedValue() = 0; - virtual void StartDisallowedType() = 0; - virtual void AddExpectedType(const typename SchemaType::ValueType& expectedType) = 0; - virtual void EndDisallowedType(const typename SchemaType::ValueType& actualType) = 0; - virtual void NotAllOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void NoneOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void NotOneOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void Disallowed() = 0; -}; - - -/////////////////////////////////////////////////////////////////////////////// -// Hasher - -// For comparison of compound value -template -class Hasher { -public: - typedef typename Encoding::Ch Ch; - - Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {} - - bool Null() { return WriteType(kNullType); } - bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); } - bool Int(int i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } - bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } - bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } - bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } - bool Double(double d) { - Number n; - if (d < 0) n.u.i = static_cast(d); - else n.u.u = static_cast(d); - n.d = d; - return WriteNumber(n); - } - - bool RawNumber(const Ch* str, SizeType len, bool) { - WriteBuffer(kNumberType, str, len * sizeof(Ch)); - return true; - } - - bool String(const Ch* str, SizeType len, bool) { - WriteBuffer(kStringType, str, len * sizeof(Ch)); - return true; - } - - bool StartObject() { return true; } - bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } - bool EndObject(SizeType memberCount) { - uint64_t h = Hash(0, kObjectType); - uint64_t* kv = stack_.template Pop(memberCount * 2); - for (SizeType i = 0; i < memberCount; i++) - h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive - *stack_.template Push() = h; - return true; - } - - bool StartArray() { return true; } - bool EndArray(SizeType elementCount) { - uint64_t h = Hash(0, kArrayType); - uint64_t* e = stack_.template Pop(elementCount); - for (SizeType i = 0; i < elementCount; i++) - h = Hash(h, e[i]); // Use hash to achieve element order sensitive - *stack_.template Push() = h; - return true; - } - - bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); } - - uint64_t GetHashCode() const { - CEREAL_RAPIDJSON_ASSERT(IsValid()); - return *stack_.template Top(); - } - -private: - static const size_t kDefaultSize = 256; - struct Number { - union U { - uint64_t u; - int64_t i; - }u; - double d; - }; - - bool WriteType(Type type) { return WriteBuffer(type, 0, 0); } - - bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); } - - bool WriteBuffer(Type type, const void* data, size_t len) { - // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ - uint64_t h = Hash(CEREAL_RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type); - const unsigned char* d = static_cast(data); - for (size_t i = 0; i < len; i++) - h = Hash(h, d[i]); - *stack_.template Push() = h; - return true; - } - - static uint64_t Hash(uint64_t h, uint64_t d) { - static const uint64_t kPrime = CEREAL_RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3); - h ^= d; - h *= kPrime; - return h; - } - - Stack stack_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SchemaValidationContext - -template -struct SchemaValidationContext { - typedef Schema SchemaType; - typedef ISchemaStateFactory SchemaValidatorFactoryType; - typedef IValidationErrorHandler ErrorHandlerType; - typedef typename SchemaType::ValueType ValueType; - typedef typename ValueType::Ch Ch; - - enum PatternValidatorType { - kPatternValidatorOnly, - kPatternValidatorWithProperty, - kPatternValidatorWithAdditionalProperty - }; - - SchemaValidationContext(SchemaValidatorFactoryType& f, ErrorHandlerType& eh, const SchemaType* s) : - factory(f), - error_handler(eh), - schema(s), - valueSchema(), - invalidKeyword(), - hasher(), - arrayElementHashCodes(), - validators(), - validatorCount(), - patternPropertiesValidators(), - patternPropertiesValidatorCount(), - patternPropertiesSchemas(), - patternPropertiesSchemaCount(), - valuePatternValidatorType(kPatternValidatorOnly), - propertyExist(), - inArray(false), - valueUniqueness(false), - arrayUniqueness(false) - { - } - - ~SchemaValidationContext() { - if (hasher) - factory.DestroryHasher(hasher); - if (validators) { - for (SizeType i = 0; i < validatorCount; i++) - factory.DestroySchemaValidator(validators[i]); - factory.FreeState(validators); - } - if (patternPropertiesValidators) { - for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) - factory.DestroySchemaValidator(patternPropertiesValidators[i]); - factory.FreeState(patternPropertiesValidators); - } - if (patternPropertiesSchemas) - factory.FreeState(patternPropertiesSchemas); - if (propertyExist) - factory.FreeState(propertyExist); - } - - SchemaValidatorFactoryType& factory; - ErrorHandlerType& error_handler; - const SchemaType* schema; - const SchemaType* valueSchema; - const Ch* invalidKeyword; - void* hasher; // Only validator access - void* arrayElementHashCodes; // Only validator access this - ISchemaValidator** validators; - SizeType validatorCount; - ISchemaValidator** patternPropertiesValidators; - SizeType patternPropertiesValidatorCount; - const SchemaType** patternPropertiesSchemas; - SizeType patternPropertiesSchemaCount; - PatternValidatorType valuePatternValidatorType; - PatternValidatorType objectPatternValidatorType; - SizeType arrayElementIndex; - bool* propertyExist; - bool inArray; - bool valueUniqueness; - bool arrayUniqueness; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Schema - -template -class Schema { -public: - typedef typename SchemaDocumentType::ValueType ValueType; - typedef typename SchemaDocumentType::AllocatorType AllocatorType; - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename EncodingType::Ch Ch; - typedef SchemaValidationContext Context; - typedef Schema SchemaType; - typedef GenericValue SValue; - typedef IValidationErrorHandler ErrorHandler; - friend class GenericSchemaDocument; - - Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) : - allocator_(allocator), - uri_(schemaDocument->GetURI(), *allocator), - pointer_(p, allocator), - typeless_(schemaDocument->GetTypeless()), - enum_(), - enumCount_(), - not_(), - type_((1 << kTotalSchemaType) - 1), // typeless - validatorCount_(), - notValidatorIndex_(), - properties_(), - additionalPropertiesSchema_(), - patternProperties_(), - patternPropertyCount_(), - propertyCount_(), - minProperties_(), - maxProperties_(SizeType(~0)), - additionalProperties_(true), - hasDependencies_(), - hasRequired_(), - hasSchemaDependencies_(), - additionalItemsSchema_(), - itemsList_(), - itemsTuple_(), - itemsTupleCount_(), - minItems_(), - maxItems_(SizeType(~0)), - additionalItems_(true), - uniqueItems_(false), - pattern_(), - minLength_(0), - maxLength_(~SizeType(0)), - exclusiveMinimum_(false), - exclusiveMaximum_(false), - defaultValueLength_(0) - { - typedef typename SchemaDocumentType::ValueType ValueType; - typedef typename ValueType::ConstValueIterator ConstValueIterator; - typedef typename ValueType::ConstMemberIterator ConstMemberIterator; - - if (!value.IsObject()) - return; - - if (const ValueType* v = GetMember(value, GetTypeString())) { - type_ = 0; - if (v->IsString()) - AddType(*v); - else if (v->IsArray()) - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) - AddType(*itr); - } - - if (const ValueType* v = GetMember(value, GetEnumString())) - if (v->IsArray() && v->Size() > 0) { - enum_ = static_cast(allocator_->Malloc(sizeof(uint64_t) * v->Size())); - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { - typedef Hasher > EnumHasherType; - char buffer[256u + 24]; - MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer)); - EnumHasherType h(&hasherAllocator, 256); - itr->Accept(h); - enum_[enumCount_++] = h.GetHashCode(); - } - } - - if (schemaDocument) { - AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); - AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); - AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); - } - - if (const ValueType* v = GetMember(value, GetNotString())) { - schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document); - notValidatorIndex_ = validatorCount_; - validatorCount_++; - } - - // Object - - const ValueType* properties = GetMember(value, GetPropertiesString()); - const ValueType* required = GetMember(value, GetRequiredString()); - const ValueType* dependencies = GetMember(value, GetDependenciesString()); - { - // Gather properties from properties/required/dependencies - SValue allProperties(kArrayType); - - if (properties && properties->IsObject()) - for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) - AddUniqueElement(allProperties, itr->name); - - if (required && required->IsArray()) - for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) - if (itr->IsString()) - AddUniqueElement(allProperties, *itr); - - if (dependencies && dependencies->IsObject()) - for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { - AddUniqueElement(allProperties, itr->name); - if (itr->value.IsArray()) - for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) - if (i->IsString()) - AddUniqueElement(allProperties, *i); - } - - if (allProperties.Size() > 0) { - propertyCount_ = allProperties.Size(); - properties_ = static_cast(allocator_->Malloc(sizeof(Property) * propertyCount_)); - for (SizeType i = 0; i < propertyCount_; i++) { - new (&properties_[i]) Property(); - properties_[i].name = allProperties[i]; - properties_[i].schema = typeless_; - } - } - } - - if (properties && properties->IsObject()) { - PointerType q = p.Append(GetPropertiesString(), allocator_); - for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { - SizeType index; - if (FindPropertyIndex(itr->name, &index)) - schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document); - } - } - - if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) { - PointerType q = p.Append(GetPatternPropertiesString(), allocator_); - patternProperties_ = static_cast(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount())); - patternPropertyCount_ = 0; - - for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { - new (&patternProperties_[patternPropertyCount_]) PatternProperty(); - patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name); - schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document); - patternPropertyCount_++; - } - } - - if (required && required->IsArray()) - for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) - if (itr->IsString()) { - SizeType index; - if (FindPropertyIndex(*itr, &index)) { - properties_[index].required = true; - hasRequired_ = true; - } - } - - if (dependencies && dependencies->IsObject()) { - PointerType q = p.Append(GetDependenciesString(), allocator_); - hasDependencies_ = true; - for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { - SizeType sourceIndex; - if (FindPropertyIndex(itr->name, &sourceIndex)) { - if (itr->value.IsArray()) { - properties_[sourceIndex].dependencies = static_cast(allocator_->Malloc(sizeof(bool) * propertyCount_)); - std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_); - for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) { - SizeType targetIndex; - if (FindPropertyIndex(*targetItr, &targetIndex)) - properties_[sourceIndex].dependencies[targetIndex] = true; - } - } - else if (itr->value.IsObject()) { - hasSchemaDependencies_ = true; - schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document); - properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_; - validatorCount_++; - } - } - } - } - - if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) { - if (v->IsBool()) - additionalProperties_ = v->GetBool(); - else if (v->IsObject()) - schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document); - } - - AssignIfExist(minProperties_, value, GetMinPropertiesString()); - AssignIfExist(maxProperties_, value, GetMaxPropertiesString()); - - // Array - if (const ValueType* v = GetMember(value, GetItemsString())) { - PointerType q = p.Append(GetItemsString(), allocator_); - if (v->IsObject()) // List validation - schemaDocument->CreateSchema(&itemsList_, q, *v, document); - else if (v->IsArray()) { // Tuple validation - itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); - SizeType index = 0; - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) - schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document); - } - } - - AssignIfExist(minItems_, value, GetMinItemsString()); - AssignIfExist(maxItems_, value, GetMaxItemsString()); - - if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) { - if (v->IsBool()) - additionalItems_ = v->GetBool(); - else if (v->IsObject()) - schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document); - } - - AssignIfExist(uniqueItems_, value, GetUniqueItemsString()); - - // String - AssignIfExist(minLength_, value, GetMinLengthString()); - AssignIfExist(maxLength_, value, GetMaxLengthString()); - - if (const ValueType* v = GetMember(value, GetPatternString())) - pattern_ = CreatePattern(*v); - - // Number - if (const ValueType* v = GetMember(value, GetMinimumString())) - if (v->IsNumber()) - minimum_.CopyFrom(*v, *allocator_); - - if (const ValueType* v = GetMember(value, GetMaximumString())) - if (v->IsNumber()) - maximum_.CopyFrom(*v, *allocator_); - - AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString()); - AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString()); - - if (const ValueType* v = GetMember(value, GetMultipleOfString())) - if (v->IsNumber() && v->GetDouble() > 0.0) - multipleOf_.CopyFrom(*v, *allocator_); - - // Default - if (const ValueType* v = GetMember(value, GetDefaultValueString())) - if (v->IsString()) - defaultValueLength_ = v->GetStringLength(); - - } - - ~Schema() { - AllocatorType::Free(enum_); - if (properties_) { - for (SizeType i = 0; i < propertyCount_; i++) - properties_[i].~Property(); - AllocatorType::Free(properties_); - } - if (patternProperties_) { - for (SizeType i = 0; i < patternPropertyCount_; i++) - patternProperties_[i].~PatternProperty(); - AllocatorType::Free(patternProperties_); - } - AllocatorType::Free(itemsTuple_); -#if CEREAL_RAPIDJSON_SCHEMA_HAS_REGEX - if (pattern_) { - pattern_->~RegexType(); - AllocatorType::Free(pattern_); - } -#endif - } - - const SValue& GetURI() const { - return uri_; - } - - const PointerType& GetPointer() const { - return pointer_; - } - - bool BeginValue(Context& context) const { - if (context.inArray) { - if (uniqueItems_) - context.valueUniqueness = true; - - if (itemsList_) - context.valueSchema = itemsList_; - else if (itemsTuple_) { - if (context.arrayElementIndex < itemsTupleCount_) - context.valueSchema = itemsTuple_[context.arrayElementIndex]; - else if (additionalItemsSchema_) - context.valueSchema = additionalItemsSchema_; - else if (additionalItems_) - context.valueSchema = typeless_; - else { - context.error_handler.DisallowedItem(context.arrayElementIndex); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetItemsString()); - } - } - else - context.valueSchema = typeless_; - - context.arrayElementIndex++; - } - return true; - } - - CEREAL_RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { - if (context.patternPropertiesValidatorCount > 0) { - bool otherValid = false; - SizeType count = context.patternPropertiesValidatorCount; - if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) - otherValid = context.patternPropertiesValidators[--count]->IsValid(); - - bool patternValid = true; - for (SizeType i = 0; i < count; i++) - if (!context.patternPropertiesValidators[i]->IsValid()) { - patternValid = false; - break; - } - - if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { - if (!patternValid) { - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); - } - } - else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { - if (!patternValid || !otherValid) { - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); - } - } - else if (!patternValid && !otherValid) { // kPatternValidatorWithAdditionalProperty) - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); - } - } - - if (enum_) { - const uint64_t h = context.factory.GetHashCode(context.hasher); - for (SizeType i = 0; i < enumCount_; i++) - if (enum_[i] == h) - goto foundEnum; - context.error_handler.DisallowedValue(); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString()); - foundEnum:; - } - - if (allOf_.schemas) - for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) - if (!context.validators[i]->IsValid()) { - context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString()); - } - - if (anyOf_.schemas) { - for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) - if (context.validators[i]->IsValid()) - goto foundAny; - context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString()); - foundAny:; - } - - if (oneOf_.schemas) { - bool oneValid = false; - for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) - if (context.validators[i]->IsValid()) { - if (oneValid) { - context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); - } else - oneValid = true; - } - if (!oneValid) { - context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); - } - } - - if (not_ && context.validators[notValidatorIndex_]->IsValid()) { - context.error_handler.Disallowed(); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetNotString()); - } - - return true; - } - - bool Null(Context& context) const { - if (!(type_ & (1 << kNullSchemaType))) { - DisallowedType(context, GetNullString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - return CreateParallelValidator(context); - } - - bool Bool(Context& context, bool) const { - if (!(type_ & (1 << kBooleanSchemaType))) { - DisallowedType(context, GetBooleanString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - return CreateParallelValidator(context); - } - - bool Int(Context& context, int i) const { - if (!CheckInt(context, i)) - return false; - return CreateParallelValidator(context); - } - - bool Uint(Context& context, unsigned u) const { - if (!CheckUint(context, u)) - return false; - return CreateParallelValidator(context); - } - - bool Int64(Context& context, int64_t i) const { - if (!CheckInt(context, i)) - return false; - return CreateParallelValidator(context); - } - - bool Uint64(Context& context, uint64_t u) const { - if (!CheckUint(context, u)) - return false; - return CreateParallelValidator(context); - } - - bool Double(Context& context, double d) const { - if (!(type_ & (1 << kNumberSchemaType))) { - DisallowedType(context, GetNumberString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) - return false; - - if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) - return false; - - if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) - return false; - - return CreateParallelValidator(context); - } - - bool String(Context& context, const Ch* str, SizeType length, bool) const { - if (!(type_ & (1 << kStringSchemaType))) { - DisallowedType(context, GetStringString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - if (minLength_ != 0 || maxLength_ != SizeType(~0)) { - SizeType count; - if (internal::CountStringCodePoint(str, length, &count)) { - if (count < minLength_) { - context.error_handler.TooShort(str, length, minLength_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString()); - } - if (count > maxLength_) { - context.error_handler.TooLong(str, length, maxLength_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString()); - } - } - } - - if (pattern_ && !IsPatternMatch(pattern_, str, length)) { - context.error_handler.DoesNotMatch(str, length); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString()); - } - - return CreateParallelValidator(context); - } - - bool StartObject(Context& context) const { - if (!(type_ & (1 << kObjectSchemaType))) { - DisallowedType(context, GetObjectString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - if (hasDependencies_ || hasRequired_) { - context.propertyExist = static_cast(context.factory.MallocState(sizeof(bool) * propertyCount_)); - std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); - } - - if (patternProperties_) { // pre-allocate schema array - SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType - context.patternPropertiesSchemas = static_cast(context.factory.MallocState(sizeof(const SchemaType*) * count)); - context.patternPropertiesSchemaCount = 0; - std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); - } - - return CreateParallelValidator(context); - } - - bool Key(Context& context, const Ch* str, SizeType len, bool) const { - if (patternProperties_) { - context.patternPropertiesSchemaCount = 0; - for (SizeType i = 0; i < patternPropertyCount_; i++) - if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema; - context.valueSchema = typeless_; - } - } - - SizeType index; - if (FindPropertyIndex(ValueType(str, len).Move(), &index)) { - if (context.patternPropertiesSchemaCount > 0) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema; - context.valueSchema = typeless_; - context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; - } - else - context.valueSchema = properties_[index].schema; - - if (context.propertyExist) - context.propertyExist[index] = true; - - return true; - } - - if (additionalPropertiesSchema_) { - if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; - context.valueSchema = typeless_; - context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; - } - else - context.valueSchema = additionalPropertiesSchema_; - return true; - } - else if (additionalProperties_) { - context.valueSchema = typeless_; - return true; - } - - if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties - context.error_handler.DisallowedProperty(str, len); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetAdditionalPropertiesString()); - } - - return true; - } - - bool EndObject(Context& context, SizeType memberCount) const { - if (hasRequired_) { - context.error_handler.StartMissingProperties(); - for (SizeType index = 0; index < propertyCount_; index++) - if (properties_[index].required && !context.propertyExist[index]) - if (properties_[index].schema->defaultValueLength_ == 0 ) - context.error_handler.AddMissingProperty(properties_[index].name); - if (context.error_handler.EndMissingProperties()) - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetRequiredString()); - } - - if (memberCount < minProperties_) { - context.error_handler.TooFewProperties(memberCount, minProperties_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinPropertiesString()); - } - - if (memberCount > maxProperties_) { - context.error_handler.TooManyProperties(memberCount, maxProperties_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxPropertiesString()); - } - - if (hasDependencies_) { - context.error_handler.StartDependencyErrors(); - for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) { - const Property& source = properties_[sourceIndex]; - if (context.propertyExist[sourceIndex]) { - if (source.dependencies) { - context.error_handler.StartMissingDependentProperties(); - for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++) - if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex]) - context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name); - context.error_handler.EndMissingDependentProperties(source.name); - } - else if (source.dependenciesSchema) { - ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex]; - if (!dependenciesValidator->IsValid()) - context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator); - } - } - } - if (context.error_handler.EndDependencyErrors()) - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString()); - } - - return true; - } - - bool StartArray(Context& context) const { - if (!(type_ & (1 << kArraySchemaType))) { - DisallowedType(context, GetArrayString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - context.arrayElementIndex = 0; - context.inArray = true; - - return CreateParallelValidator(context); - } - - bool EndArray(Context& context, SizeType elementCount) const { - context.inArray = false; - - if (elementCount < minItems_) { - context.error_handler.TooFewItems(elementCount, minItems_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinItemsString()); - } - - if (elementCount > maxItems_) { - context.error_handler.TooManyItems(elementCount, maxItems_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxItemsString()); - } - - return true; - } - - // Generate functions for string literal according to Ch -#define CEREAL_RAPIDJSON_STRING_(name, ...) \ - static const ValueType& Get##name##String() {\ - static const Ch s[] = { __VA_ARGS__, '\0' };\ - static const ValueType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1));\ - return v;\ - } - - CEREAL_RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') - CEREAL_RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n') - CEREAL_RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't') - CEREAL_RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y') - CEREAL_RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g') - CEREAL_RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r') - CEREAL_RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r') - CEREAL_RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e') - CEREAL_RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm') - CEREAL_RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f') - CEREAL_RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f') - CEREAL_RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f') - CEREAL_RAPIDJSON_STRING_(Not, 'n', 'o', 't') - CEREAL_RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd') - CEREAL_RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - CEREAL_RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's') - CEREAL_RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's') - CEREAL_RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's') - CEREAL_RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's') - CEREAL_RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's') - CEREAL_RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h') - CEREAL_RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h') - CEREAL_RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n') - CEREAL_RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm') - CEREAL_RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm') - CEREAL_RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm') - CEREAL_RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm') - CEREAL_RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f') - CEREAL_RAPIDJSON_STRING_(DefaultValue, 'd', 'e', 'f', 'a', 'u', 'l', 't') - -#undef CEREAL_RAPIDJSON_STRING_ - -private: - enum SchemaValueType { - kNullSchemaType, - kBooleanSchemaType, - kObjectSchemaType, - kArraySchemaType, - kStringSchemaType, - kNumberSchemaType, - kIntegerSchemaType, - kTotalSchemaType - }; - -#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX - typedef internal::GenericRegex RegexType; -#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX - typedef std::basic_regex RegexType; -#else - typedef char RegexType; -#endif - - struct SchemaArray { - SchemaArray() : schemas(), count() {} - ~SchemaArray() { AllocatorType::Free(schemas); } - const SchemaType** schemas; - SizeType begin; // begin index of context.validators - SizeType count; - }; - - template - void AddUniqueElement(V1& a, const V2& v) { - for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) - if (*itr == v) - return; - V1 c(v, *allocator_); - a.PushBack(c, *allocator_); - } - - static const ValueType* GetMember(const ValueType& value, const ValueType& name) { - typename ValueType::ConstMemberIterator itr = value.FindMember(name); - return itr != value.MemberEnd() ? &(itr->value) : 0; - } - - static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) { - if (const ValueType* v = GetMember(value, name)) - if (v->IsBool()) - out = v->GetBool(); - } - - static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) { - if (const ValueType* v = GetMember(value, name)) - if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) - out = static_cast(v->GetUint64()); - } - - void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) { - if (const ValueType* v = GetMember(value, name)) { - if (v->IsArray() && v->Size() > 0) { - PointerType q = p.Append(name, allocator_); - out.count = v->Size(); - out.schemas = static_cast(allocator_->Malloc(out.count * sizeof(const Schema*))); - memset(out.schemas, 0, sizeof(Schema*)* out.count); - for (SizeType i = 0; i < out.count; i++) - schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document); - out.begin = validatorCount_; - validatorCount_ += out.count; - } - } - } - -#if CEREAL_RAPIDJSON_SCHEMA_USE_INTERNALREGEX - template - RegexType* CreatePattern(const ValueType& value) { - if (value.IsString()) { - RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_); - if (!r->IsValid()) { - r->~RegexType(); - AllocatorType::Free(r); - r = 0; - } - return r; - } - return 0; - } - - static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { - GenericRegexSearch rs(*pattern); - return rs.Search(str); - } -#elif CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX - template - RegexType* CreatePattern(const ValueType& value) { - if (value.IsString()) { - RegexType *r = static_cast(allocator_->Malloc(sizeof(RegexType))); - try { - return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); - } - catch (const std::regex_error&) { - AllocatorType::Free(r); - } - } - return 0; - } - - static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) { - std::match_results r; - return std::regex_search(str, str + length, r, *pattern); - } -#else - template - RegexType* CreatePattern(const ValueType&) { return 0; } - - static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; } -#endif // CEREAL_RAPIDJSON_SCHEMA_USE_STDREGEX - - void AddType(const ValueType& type) { - if (type == GetNullString() ) type_ |= 1 << kNullSchemaType; - else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType; - else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType; - else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType; - else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType; - else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType; - else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); - } - - bool CreateParallelValidator(Context& context) const { - if (enum_ || context.arrayUniqueness) - context.hasher = context.factory.CreateHasher(); - - if (validatorCount_) { - CEREAL_RAPIDJSON_ASSERT(context.validators == 0); - context.validators = static_cast(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_)); - context.validatorCount = validatorCount_; - - if (allOf_.schemas) - CreateSchemaValidators(context, allOf_); - - if (anyOf_.schemas) - CreateSchemaValidators(context, anyOf_); - - if (oneOf_.schemas) - CreateSchemaValidators(context, oneOf_); - - if (not_) - context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_); - - if (hasSchemaDependencies_) { - for (SizeType i = 0; i < propertyCount_; i++) - if (properties_[i].dependenciesSchema) - context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema); - } - } - - return true; - } - - void CreateSchemaValidators(Context& context, const SchemaArray& schemas) const { - for (SizeType i = 0; i < schemas.count; i++) - context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i]); - } - - // O(n) - bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const { - SizeType len = name.GetStringLength(); - const Ch* str = name.GetString(); - for (SizeType index = 0; index < propertyCount_; index++) - if (properties_[index].name.GetStringLength() == len && - (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0)) - { - *outIndex = index; - return true; - } - return false; - } - - bool CheckInt(Context& context, int64_t i) const { - if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { - DisallowedType(context, GetIntegerString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - if (!minimum_.IsNull()) { - if (minimum_.IsInt64()) { - if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); - } - } - else if (minimum_.IsUint64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); // i <= max(int64_t) < minimum.GetUint64() - } - else if (!CheckDoubleMinimum(context, static_cast(i))) - return false; - } - - if (!maximum_.IsNull()) { - if (maximum_.IsInt64()) { - if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); - } - } - else if (maximum_.IsUint64()) { } - /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() - else if (!CheckDoubleMaximum(context, static_cast(i))) - return false; - } - - if (!multipleOf_.IsNull()) { - if (multipleOf_.IsUint64()) { - if (static_cast(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) { - context.error_handler.NotMultipleOf(i, multipleOf_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); - } - } - else if (!CheckDoubleMultipleOf(context, static_cast(i))) - return false; - } - - return true; - } - - bool CheckUint(Context& context, uint64_t i) const { - if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { - DisallowedType(context, GetIntegerString()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); - } - - if (!minimum_.IsNull()) { - if (minimum_.IsUint64()) { - if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); - } - } - else if (minimum_.IsInt64()) - /* do nothing */; // i >= 0 > minimum.Getint64() - else if (!CheckDoubleMinimum(context, static_cast(i))) - return false; - } - - if (!maximum_.IsNull()) { - if (maximum_.IsUint64()) { - if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); - } - } - else if (maximum_.IsInt64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); // i >= 0 > maximum_ - } - else if (!CheckDoubleMaximum(context, static_cast(i))) - return false; - } - - if (!multipleOf_.IsNull()) { - if (multipleOf_.IsUint64()) { - if (i % multipleOf_.GetUint64() != 0) { - context.error_handler.NotMultipleOf(i, multipleOf_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); - } - } - else if (!CheckDoubleMultipleOf(context, static_cast(i))) - return false; - } - - return true; - } - - bool CheckDoubleMinimum(Context& context, double d) const { - if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) { - context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); - } - return true; - } - - bool CheckDoubleMaximum(Context& context, double d) const { - if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) { - context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); - } - return true; - } - - bool CheckDoubleMultipleOf(Context& context, double d) const { - double a = std::abs(d), b = std::abs(multipleOf_.GetDouble()); - double q = std::floor(a / b); - double r = a - q * b; - if (r > 0.0) { - context.error_handler.NotMultipleOf(d, multipleOf_); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); - } - return true; - } - - void DisallowedType(Context& context, const ValueType& actualType) const { - ErrorHandler& eh = context.error_handler; - eh.StartDisallowedType(); - - if (type_ & (1 << kNullSchemaType)) eh.AddExpectedType(GetNullString()); - if (type_ & (1 << kBooleanSchemaType)) eh.AddExpectedType(GetBooleanString()); - if (type_ & (1 << kObjectSchemaType)) eh.AddExpectedType(GetObjectString()); - if (type_ & (1 << kArraySchemaType)) eh.AddExpectedType(GetArrayString()); - if (type_ & (1 << kStringSchemaType)) eh.AddExpectedType(GetStringString()); - - if (type_ & (1 << kNumberSchemaType)) eh.AddExpectedType(GetNumberString()); - else if (type_ & (1 << kIntegerSchemaType)) eh.AddExpectedType(GetIntegerString()); - - eh.EndDisallowedType(actualType); - } - - struct Property { - Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {} - ~Property() { AllocatorType::Free(dependencies); } - SValue name; - const SchemaType* schema; - const SchemaType* dependenciesSchema; - SizeType dependenciesValidatorIndex; - bool* dependencies; - bool required; - }; - - struct PatternProperty { - PatternProperty() : schema(), pattern() {} - ~PatternProperty() { - if (pattern) { - pattern->~RegexType(); - AllocatorType::Free(pattern); - } - } - const SchemaType* schema; - RegexType* pattern; - }; - - AllocatorType* allocator_; - SValue uri_; - PointerType pointer_; - const SchemaType* typeless_; - uint64_t* enum_; - SizeType enumCount_; - SchemaArray allOf_; - SchemaArray anyOf_; - SchemaArray oneOf_; - const SchemaType* not_; - unsigned type_; // bitmask of kSchemaType - SizeType validatorCount_; - SizeType notValidatorIndex_; - - Property* properties_; - const SchemaType* additionalPropertiesSchema_; - PatternProperty* patternProperties_; - SizeType patternPropertyCount_; - SizeType propertyCount_; - SizeType minProperties_; - SizeType maxProperties_; - bool additionalProperties_; - bool hasDependencies_; - bool hasRequired_; - bool hasSchemaDependencies_; - - const SchemaType* additionalItemsSchema_; - const SchemaType* itemsList_; - const SchemaType** itemsTuple_; - SizeType itemsTupleCount_; - SizeType minItems_; - SizeType maxItems_; - bool additionalItems_; - bool uniqueItems_; - - RegexType* pattern_; - SizeType minLength_; - SizeType maxLength_; - - SValue minimum_; - SValue maximum_; - SValue multipleOf_; - bool exclusiveMinimum_; - bool exclusiveMaximum_; - - SizeType defaultValueLength_; -}; - -template -struct TokenHelper { - CEREAL_RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { - *documentStack.template Push() = '/'; - char buffer[21]; - size_t length = static_cast((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); - for (size_t i = 0; i < length; i++) - *documentStack.template Push() = static_cast(buffer[i]); - } -}; - -// Partial specialized version for char to prevent buffer copying. -template -struct TokenHelper { - CEREAL_RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { - if (sizeof(SizeType) == 4) { - char *buffer = documentStack.template Push(1 + 10); // '/' + uint - *buffer++ = '/'; - const char* end = internal::u32toa(index, buffer); - documentStack.template Pop(static_cast(10 - (end - buffer))); - } - else { - char *buffer = documentStack.template Push(1 + 20); // '/' + uint64 - *buffer++ = '/'; - const char* end = internal::u64toa(index, buffer); - documentStack.template Pop(static_cast(20 - (end - buffer))); - } - } -}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// IGenericRemoteSchemaDocumentProvider - -template -class IGenericRemoteSchemaDocumentProvider { -public: - typedef typename SchemaDocumentType::Ch Ch; - - virtual ~IGenericRemoteSchemaDocumentProvider() {} - virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericSchemaDocument - -//! JSON schema document. -/*! - A JSON schema document is a compiled version of a JSON schema. - It is basically a tree of internal::Schema. - - \note This is an immutable class (i.e. its instance cannot be modified after construction). - \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding. - \tparam Allocator Allocator type for allocating memory of this document. -*/ -template -class GenericSchemaDocument { -public: - typedef ValueT ValueType; - typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProviderType; - typedef Allocator AllocatorType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename EncodingType::Ch Ch; - typedef internal::Schema SchemaType; - typedef GenericPointer PointerType; - typedef GenericValue URIType; - friend class internal::Schema; - template - friend class GenericSchemaValidator; - - //! Constructor. - /*! - Compile a JSON document into schema document. - - \param document A JSON document as source. - \param uri The base URI of this schema document for purposes of violation reporting. - \param uriLength Length of \c name, in code points. - \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null. - \param allocator An optional allocator instance for allocating memory. Can be null. - */ - explicit GenericSchemaDocument(const ValueType& document, const Ch* uri = 0, SizeType uriLength = 0, - IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) : - remoteProvider_(remoteProvider), - allocator_(allocator), - ownAllocator_(), - root_(), - typeless_(), - schemaMap_(allocator, kInitialSchemaMapSize), - schemaRef_(allocator, kInitialSchemaRefSize) - { - if (!allocator_) - ownAllocator_ = allocator_ = CEREAL_RAPIDJSON_NEW(Allocator)(); - - Ch noUri[1] = {0}; - uri_.SetString(uri ? uri : noUri, uriLength, *allocator_); - - typeless_ = static_cast(allocator_->Malloc(sizeof(SchemaType))); - new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), allocator_); - - // Generate root schema, it will call CreateSchema() to create sub-schemas, - // And call AddRefSchema() if there are $ref. - CreateSchemaRecursive(&root_, PointerType(), document, document); - - // Resolve $ref - while (!schemaRef_.Empty()) { - SchemaRefEntry* refEntry = schemaRef_.template Pop(1); - if (const SchemaType* s = GetSchema(refEntry->target)) { - if (refEntry->schema) - *refEntry->schema = s; - - // Create entry in map if not exist - if (!GetSchema(refEntry->source)) { - new (schemaMap_.template Push()) SchemaEntry(refEntry->source, const_cast(s), false, allocator_); - } - } - else if (refEntry->schema) - *refEntry->schema = typeless_; - - refEntry->~SchemaRefEntry(); - } - - CEREAL_RAPIDJSON_ASSERT(root_ != 0); - - schemaRef_.ShrinkToFit(); // Deallocate all memory for ref - } - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericSchemaDocument(GenericSchemaDocument&& rhs) CEREAL_RAPIDJSON_NOEXCEPT : - remoteProvider_(rhs.remoteProvider_), - allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - root_(rhs.root_), - typeless_(rhs.typeless_), - schemaMap_(std::move(rhs.schemaMap_)), - schemaRef_(std::move(rhs.schemaRef_)), - uri_(std::move(rhs.uri_)) - { - rhs.remoteProvider_ = 0; - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.typeless_ = 0; - } -#endif - - //! Destructor - ~GenericSchemaDocument() { - while (!schemaMap_.Empty()) - schemaMap_.template Pop(1)->~SchemaEntry(); - - if (typeless_) { - typeless_->~SchemaType(); - Allocator::Free(typeless_); - } - - CEREAL_RAPIDJSON_DELETE(ownAllocator_); - } - - const URIType& GetURI() const { return uri_; } - - //! Get the root schema. - const SchemaType& GetRoot() const { return *root_; } - -private: - //! Prohibit copying - GenericSchemaDocument(const GenericSchemaDocument&); - //! Prohibit assignment - GenericSchemaDocument& operator=(const GenericSchemaDocument&); - - struct SchemaRefEntry { - SchemaRefEntry(const PointerType& s, const PointerType& t, const SchemaType** outSchema, Allocator *allocator) : source(s, allocator), target(t, allocator), schema(outSchema) {} - PointerType source; - PointerType target; - const SchemaType** schema; - }; - - struct SchemaEntry { - SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {} - ~SchemaEntry() { - if (owned) { - schema->~SchemaType(); - Allocator::Free(schema); - } - } - PointerType pointer; - SchemaType* schema; - bool owned; - }; - - void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { - if (schema) - *schema = typeless_; - - if (v.GetType() == kObjectType) { - const SchemaType* s = GetSchema(pointer); - if (!s) - CreateSchema(schema, pointer, v, document); - - for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) - CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document); - } - else if (v.GetType() == kArrayType) - for (SizeType i = 0; i < v.Size(); i++) - CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document); - } - - void CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { - CEREAL_RAPIDJSON_ASSERT(pointer.IsValid()); - if (v.IsObject()) { - if (!HandleRefSchema(pointer, schema, v, document)) { - SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_); - new (schemaMap_.template Push()) SchemaEntry(pointer, s, true, allocator_); - if (schema) - *schema = s; - } - } - } - - bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document) { - static const Ch kRefString[] = { '$', 'r', 'e', 'f', '\0' }; - static const ValueType kRefValue(kRefString, 4); - - typename ValueType::ConstMemberIterator itr = v.FindMember(kRefValue); - if (itr == v.MemberEnd()) - return false; - - if (itr->value.IsString()) { - SizeType len = itr->value.GetStringLength(); - if (len > 0) { - const Ch* s = itr->value.GetString(); - SizeType i = 0; - while (i < len && s[i] != '#') // Find the first # - i++; - - if (i > 0) { // Remote reference, resolve immediately - if (remoteProvider_) { - if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i)) { - PointerType pointer(&s[i], len - i, allocator_); - if (pointer.IsValid()) { - if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) { - if (schema) - *schema = sc; - new (schemaMap_.template Push()) SchemaEntry(source, const_cast(sc), false, allocator_); - return true; - } - } - } - } - } - else if (s[i] == '#') { // Local reference, defer resolution - PointerType pointer(&s[i], len - i, allocator_); - if (pointer.IsValid()) { - if (const ValueType* nv = pointer.Get(document)) - if (HandleRefSchema(source, schema, *nv, document)) - return true; - - new (schemaRef_.template Push()) SchemaRefEntry(source, pointer, schema, allocator_); - return true; - } - } - } - } - return false; - } - - const SchemaType* GetSchema(const PointerType& pointer) const { - for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) - if (pointer == target->pointer) - return target->schema; - return 0; - } - - PointerType GetPointer(const SchemaType* schema) const { - for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) - if (schema == target->schema) - return target->pointer; - return PointerType(); - } - - const SchemaType* GetTypeless() const { return typeless_; } - - static const size_t kInitialSchemaMapSize = 64; - static const size_t kInitialSchemaRefSize = 64; - - IRemoteSchemaDocumentProviderType* remoteProvider_; - Allocator *allocator_; - Allocator *ownAllocator_; - const SchemaType* root_; //!< Root schema. - SchemaType* typeless_; - internal::Stack schemaMap_; // Stores created Pointer -> Schemas - internal::Stack schemaRef_; // Stores Pointer from $ref and schema which holds the $ref - URIType uri_; -}; - -//! GenericSchemaDocument using Value type. -typedef GenericSchemaDocument SchemaDocument; -//! IGenericRemoteSchemaDocumentProvider using SchemaDocument. -typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; - -/////////////////////////////////////////////////////////////////////////////// -// GenericSchemaValidator - -//! JSON Schema Validator. -/*! - A SAX style JSON schema validator. - It uses a \c GenericSchemaDocument to validate SAX events. - It delegates the incoming SAX events to an output handler. - The default output handler does nothing. - It can be reused multiple times by calling \c Reset(). - - \tparam SchemaDocumentType Type of schema document. - \tparam OutputHandler Type of output handler. Default handler does nothing. - \tparam StateAllocator Allocator for storing the internal validation states. -*/ -template < - typename SchemaDocumentType, - typename OutputHandler = BaseReaderHandler, - typename StateAllocator = CrtAllocator> -class GenericSchemaValidator : - public internal::ISchemaStateFactory, - public internal::ISchemaValidator, - public internal::IValidationErrorHandler -{ -public: - typedef typename SchemaDocumentType::SchemaType SchemaType; - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename SchemaType::EncodingType EncodingType; - typedef typename SchemaType::SValue SValue; - typedef typename EncodingType::Ch Ch; - typedef GenericStringRef StringRefType; - typedef GenericValue ValueType; - - //! Constructor without output handler. - /*! - \param schemaDocument The schema document to conform to. - \param allocator Optional allocator for storing internal validation states. - \param schemaStackCapacity Optional initial capacity of schema path stack. - \param documentStackCapacity Optional initial capacity of document path stack. - */ - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(schemaDocument.GetRoot()), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(0), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true) -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - , depth_(0) -#endif - { - } - - //! Constructor with output handler. - /*! - \param schemaDocument The schema document to conform to. - \param allocator Optional allocator for storing internal validation states. - \param schemaStackCapacity Optional initial capacity of schema path stack. - \param documentStackCapacity Optional initial capacity of document path stack. - */ - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - OutputHandler& outputHandler, - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(schemaDocument.GetRoot()), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(&outputHandler), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true) -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - , depth_(0) -#endif - { - } - - //! Destructor. - ~GenericSchemaValidator() { - Reset(); - CEREAL_RAPIDJSON_DELETE(ownStateAllocator_); - } - - //! Reset the internal states. - void Reset() { - while (!schemaStack_.Empty()) - PopSchema(); - documentStack_.Clear(); - error_.SetObject(); - currentError_.SetNull(); - missingDependents_.SetNull(); - valid_ = true; - } - - //! Checks whether the current state is valid. - // Implementation of ISchemaValidator - virtual bool IsValid() const { return valid_; } - - //! Gets the error object. - ValueType& GetError() { return error_; } - const ValueType& GetError() const { return error_; } - - //! Gets the JSON pointer pointed to the invalid schema. - PointerType GetInvalidSchemaPointer() const { - return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer(); - } - - //! Gets the keyword of invalid schema. - const Ch* GetInvalidSchemaKeyword() const { - return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword; - } - - //! Gets the JSON pointer pointed to the invalid value. - PointerType GetInvalidDocumentPointer() const { - if (documentStack_.Empty()) { - return PointerType(); - } - else { - return PointerType(documentStack_.template Bottom(), documentStack_.GetSize() / sizeof(Ch)); - } - } - - void NotMultipleOf(int64_t actual, const SValue& expected) { - AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); - } - void NotMultipleOf(uint64_t actual, const SValue& expected) { - AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); - } - void NotMultipleOf(double actual, const SValue& expected) { - AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected); - } - void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void AboveMaximum(double actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - void BelowMinimum(double actual, const SValue& expected, bool exclusive) { - AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - - void TooLong(const Ch* str, SizeType length, SizeType expected) { - AddNumberError(SchemaType::GetMaxLengthString(), - ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); - } - void TooShort(const Ch* str, SizeType length, SizeType expected) { - AddNumberError(SchemaType::GetMinLengthString(), - ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); - } - void DoesNotMatch(const Ch* str, SizeType length) { - currentError_.SetObject(); - currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator()); - AddCurrentError(SchemaType::GetPatternString()); - } - - void DisallowedItem(SizeType index) { - currentError_.SetObject(); - currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator()); - AddCurrentError(SchemaType::GetAdditionalItemsString(), true); - } - void TooFewItems(SizeType actualCount, SizeType expectedCount) { - AddNumberError(SchemaType::GetMinItemsString(), - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void TooManyItems(SizeType actualCount, SizeType expectedCount) { - AddNumberError(SchemaType::GetMaxItemsString(), - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void DuplicateItems(SizeType index1, SizeType index2) { - ValueType duplicates(kArrayType); - duplicates.PushBack(index1, GetStateAllocator()); - duplicates.PushBack(index2, GetStateAllocator()); - currentError_.SetObject(); - currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator()); - AddCurrentError(SchemaType::GetUniqueItemsString(), true); - } - - void TooManyProperties(SizeType actualCount, SizeType expectedCount) { - AddNumberError(SchemaType::GetMaxPropertiesString(), - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void TooFewProperties(SizeType actualCount, SizeType expectedCount) { - AddNumberError(SchemaType::GetMinPropertiesString(), - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void StartMissingProperties() { - currentError_.SetArray(); - } - void AddMissingProperty(const SValue& name) { - currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator()); - } - bool EndMissingProperties() { - if (currentError_.Empty()) - return false; - ValueType error(kObjectType); - error.AddMember(GetMissingString(), currentError_, GetStateAllocator()); - currentError_ = error; - AddCurrentError(SchemaType::GetRequiredString()); - return true; - } - void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) { - for (SizeType i = 0; i < count; ++i) - MergeError(static_cast(subvalidators[i])->GetError()); - } - void DisallowedProperty(const Ch* name, SizeType length) { - currentError_.SetObject(); - currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator()); - AddCurrentError(SchemaType::GetAdditionalPropertiesString(), true); - } - - void StartDependencyErrors() { - currentError_.SetObject(); - } - void StartMissingDependentProperties() { - missingDependents_.SetArray(); - } - void AddMissingDependentProperty(const SValue& targetName) { - missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator()); - } - void EndMissingDependentProperties(const SValue& sourceName) { - if (!missingDependents_.Empty()) - currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), - missingDependents_, GetStateAllocator()); - } - void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) { - currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), - static_cast(subvalidator)->GetError(), GetStateAllocator()); - } - bool EndDependencyErrors() { - if (currentError_.ObjectEmpty()) - return false; - ValueType error(kObjectType); - error.AddMember(GetErrorsString(), currentError_, GetStateAllocator()); - currentError_ = error; - AddCurrentError(SchemaType::GetDependenciesString()); - return true; - } - - void DisallowedValue() { - currentError_.SetObject(); - AddCurrentError(SchemaType::GetEnumString()); - } - void StartDisallowedType() { - currentError_.SetArray(); - } - void AddExpectedType(const typename SchemaType::ValueType& expectedType) { - currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator()); - } - void EndDisallowedType(const typename SchemaType::ValueType& actualType) { - ValueType error(kObjectType); - error.AddMember(GetExpectedString(), currentError_, GetStateAllocator()); - error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator()); - currentError_ = error; - AddCurrentError(SchemaType::GetTypeString()); - } - void NotAllOf(ISchemaValidator** subvalidators, SizeType count) { - for (SizeType i = 0; i < count; ++i) { - MergeError(static_cast(subvalidators[i])->GetError()); - } - } - void NoneOf(ISchemaValidator** subvalidators, SizeType count) { - AddErrorArray(SchemaType::GetAnyOfString(), subvalidators, count); - } - void NotOneOf(ISchemaValidator** subvalidators, SizeType count) { - AddErrorArray(SchemaType::GetOneOfString(), subvalidators, count); - } - void Disallowed() { - currentError_.SetObject(); - AddCurrentError(SchemaType::GetNotString()); - } - -#define CEREAL_RAPIDJSON_STRING_(name, ...) \ - static const StringRefType& Get##name##String() {\ - static const Ch s[] = { __VA_ARGS__, '\0' };\ - static const StringRefType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1)); \ - return v;\ - } - - CEREAL_RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f') - CEREAL_RAPIDJSON_STRING_(SchemaRef, 's', 'c', 'h', 'e', 'm', 'a', 'R', 'e', 'f') - CEREAL_RAPIDJSON_STRING_(Expected, 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd') - CEREAL_RAPIDJSON_STRING_(Actual, 'a', 'c', 't', 'u', 'a', 'l') - CEREAL_RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd') - CEREAL_RAPIDJSON_STRING_(Missing, 'm', 'i', 's', 's', 'i', 'n', 'g') - CEREAL_RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's') - CEREAL_RAPIDJSON_STRING_(Duplicates, 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', 's') - -#undef CEREAL_RAPIDJSON_STRING_ - -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \ -CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN\ - *documentStack_.template Push() = '\0';\ - documentStack_.template Pop(1);\ - internal::PrintInvalidDocument(documentStack_.template Bottom());\ -CEREAL_RAPIDJSON_MULTILINEMACRO_END -#else -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() -#endif - -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\ - if (!valid_) return false; \ - if (!BeginValue() || !CurrentSchema().method arg1) {\ - CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\ - return valid_ = false;\ - } - -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\ - for (Context* context = schemaStack_.template Bottom(); context != schemaStack_.template End(); context++) {\ - if (context->hasher)\ - static_cast(context->hasher)->method arg2;\ - if (context->validators)\ - for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\ - static_cast(context->validators[i_])->method arg2;\ - if (context->patternPropertiesValidators)\ - for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\ - static_cast(context->patternPropertiesValidators[i_])->method arg2;\ - } - -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\ - return valid_ = EndValue() && (!outputHandler_ || outputHandler_->method arg2) - -#define CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \ - CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\ - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\ - CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2) - - bool Null() { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext()), ( )); } - bool Bool(bool b) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); } - bool Int(int i) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); } - bool Uint(unsigned u) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); } - bool Int64(int64_t i) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); } - bool Uint64(uint64_t u) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); } - bool Double(double d) { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); } - bool RawNumber(const Ch* str, SizeType length, bool copy) - { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } - bool String(const Ch* str, SizeType length, bool copy) - { CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } - - bool StartObject() { - CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext())); - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ()); - return valid_ = !outputHandler_ || outputHandler_->StartObject(); - } - - bool Key(const Ch* str, SizeType len, bool copy) { - if (!valid_) return false; - AppendToken(str, len); - if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false; - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy)); - return valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy); - } - - bool EndObject(SizeType memberCount) { - if (!valid_) return false; - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount)); - if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false; - CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount)); - } - - bool StartArray() { - CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext())); - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ()); - return valid_ = !outputHandler_ || outputHandler_->StartArray(); - } - - bool EndArray(SizeType elementCount) { - if (!valid_) return false; - CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount)); - if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false; - CEREAL_RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount)); - } - -#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_ -#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_BEGIN_ -#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ -#undef CEREAL_RAPIDJSON_SCHEMA_HANDLE_VALUE_ - - // Implementation of ISchemaStateFactory - virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root) { - return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom(), documentStack_.GetSize(), -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - depth_ + 1, -#endif - &GetStateAllocator()); - } - - virtual void DestroySchemaValidator(ISchemaValidator* validator) { - GenericSchemaValidator* v = static_cast(validator); - v->~GenericSchemaValidator(); - StateAllocator::Free(v); - } - - virtual void* CreateHasher() { - return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator()); - } - - virtual uint64_t GetHashCode(void* hasher) { - return static_cast(hasher)->GetHashCode(); - } - - virtual void DestroryHasher(void* hasher) { - HasherType* h = static_cast(hasher); - h->~HasherType(); - StateAllocator::Free(h); - } - - virtual void* MallocState(size_t size) { - return GetStateAllocator().Malloc(size); - } - - virtual void FreeState(void* p) { - StateAllocator::Free(p); - } - -private: - typedef typename SchemaType::Context Context; - typedef GenericValue, StateAllocator> HashCodeArray; - typedef internal::Hasher HasherType; - - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - const SchemaType& root, - const char* basePath, size_t basePathSize, -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - unsigned depth, -#endif - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(root), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(0), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true) -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - , depth_(depth) -#endif - { - if (basePath && basePathSize) - memcpy(documentStack_.template Push(basePathSize), basePath, basePathSize); - } - - StateAllocator& GetStateAllocator() { - if (!stateAllocator_) - stateAllocator_ = ownStateAllocator_ = CEREAL_RAPIDJSON_NEW(StateAllocator)(); - return *stateAllocator_; - } - - bool BeginValue() { - if (schemaStack_.Empty()) - PushSchema(root_); - else { - if (CurrentContext().inArray) - internal::TokenHelper, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex); - - if (!CurrentSchema().BeginValue(CurrentContext())) - return false; - - SizeType count = CurrentContext().patternPropertiesSchemaCount; - const SchemaType** sa = CurrentContext().patternPropertiesSchemas; - typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType; - bool valueUniqueness = CurrentContext().valueUniqueness; - CEREAL_RAPIDJSON_ASSERT(CurrentContext().valueSchema); - PushSchema(*CurrentContext().valueSchema); - - if (count > 0) { - CurrentContext().objectPatternValidatorType = patternValidatorType; - ISchemaValidator**& va = CurrentContext().patternPropertiesValidators; - SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount; - va = static_cast(MallocState(sizeof(ISchemaValidator*) * count)); - for (SizeType i = 0; i < count; i++) - va[validatorCount++] = CreateSchemaValidator(*sa[i]); - } - - CurrentContext().arrayUniqueness = valueUniqueness; - } - return true; - } - - bool EndValue() { - if (!CurrentSchema().EndValue(CurrentContext())) - return false; - -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - GenericStringBuffer sb; - schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb); - - *documentStack_.template Push() = '\0'; - documentStack_.template Pop(1); - internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom()); -#endif - - uint64_t h = CurrentContext().arrayUniqueness ? static_cast(CurrentContext().hasher)->GetHashCode() : 0; - - PopSchema(); - - if (!schemaStack_.Empty()) { - Context& context = CurrentContext(); - if (context.valueUniqueness) { - HashCodeArray* a = static_cast(context.arrayElementHashCodes); - if (!a) - CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType); - for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr) - if (itr->GetUint64() == h) { - DuplicateItems(static_cast(itr - a->Begin()), a->Size()); - CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString()); - } - a->PushBack(h, GetStateAllocator()); - } - } - - // Remove the last token of document pointer - while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/') - ; - - return true; - } - - void AppendToken(const Ch* str, SizeType len) { - documentStack_.template Reserve(1 + len * 2); // worst case all characters are escaped as two characters - *documentStack_.template PushUnsafe() = '/'; - for (SizeType i = 0; i < len; i++) { - if (str[i] == '~') { - *documentStack_.template PushUnsafe() = '~'; - *documentStack_.template PushUnsafe() = '0'; - } - else if (str[i] == '/') { - *documentStack_.template PushUnsafe() = '~'; - *documentStack_.template PushUnsafe() = '1'; - } - else - *documentStack_.template PushUnsafe() = str[i]; - } - } - - CEREAL_RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push()) Context(*this, *this, &schema); } - - CEREAL_RAPIDJSON_FORCEINLINE void PopSchema() { - Context* c = schemaStack_.template Pop(1); - if (HashCodeArray* a = static_cast(c->arrayElementHashCodes)) { - a->~HashCodeArray(); - StateAllocator::Free(a); - } - c->~Context(); - } - - void AddErrorLocation(ValueType& result, bool parent) { - GenericStringBuffer sb; - PointerType instancePointer = GetInvalidDocumentPointer(); - ((parent && instancePointer.GetTokenCount() > 0) - ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1) - : instancePointer).StringifyUriFragment(sb); - ValueType instanceRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), - GetStateAllocator()); - result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator()); - sb.Clear(); - memcpy(sb.Push(CurrentSchema().GetURI().GetStringLength()), - CurrentSchema().GetURI().GetString(), - CurrentSchema().GetURI().GetStringLength() * sizeof(Ch)); - GetInvalidSchemaPointer().StringifyUriFragment(sb); - ValueType schemaRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), - GetStateAllocator()); - result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator()); - } - - void AddError(ValueType& keyword, ValueType& error) { - typename ValueType::MemberIterator member = error_.FindMember(keyword); - if (member == error_.MemberEnd()) - error_.AddMember(keyword, error, GetStateAllocator()); - else { - if (member->value.IsObject()) { - ValueType errors(kArrayType); - errors.PushBack(member->value, GetStateAllocator()); - member->value = errors; - } - member->value.PushBack(error, GetStateAllocator()); - } - } - - void AddCurrentError(const typename SchemaType::ValueType& keyword, bool parent = false) { - AddErrorLocation(currentError_, parent); - AddError(ValueType(keyword, GetStateAllocator(), false).Move(), currentError_); - } - - void MergeError(ValueType& other) { - for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) { - AddError(it->name, it->value); - } - } - - void AddNumberError(const typename SchemaType::ValueType& keyword, ValueType& actual, const SValue& expected, - const typename SchemaType::ValueType& (*exclusive)() = 0) { - currentError_.SetObject(); - currentError_.AddMember(GetActualString(), actual, GetStateAllocator()); - currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator()); - if (exclusive) - currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator()); - AddCurrentError(keyword); - } - - void AddErrorArray(const typename SchemaType::ValueType& keyword, - ISchemaValidator** subvalidators, SizeType count) { - ValueType errors(kArrayType); - for (SizeType i = 0; i < count; ++i) - errors.PushBack(static_cast(subvalidators[i])->GetError(), GetStateAllocator()); - currentError_.SetObject(); - currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator()); - AddCurrentError(keyword); - } - - const SchemaType& CurrentSchema() const { return *schemaStack_.template Top()->schema; } - Context& CurrentContext() { return *schemaStack_.template Top(); } - const Context& CurrentContext() const { return *schemaStack_.template Top(); } - - static const size_t kDefaultSchemaStackCapacity = 1024; - static const size_t kDefaultDocumentStackCapacity = 256; - const SchemaDocumentType* schemaDocument_; - const SchemaType& root_; - StateAllocator* stateAllocator_; - StateAllocator* ownStateAllocator_; - internal::Stack schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *) - internal::Stack documentStack_; //!< stack to store the current path of validating document (Ch) - OutputHandler* outputHandler_; - ValueType error_; - ValueType currentError_; - ValueType missingDependents_; - bool valid_; -#if CEREAL_RAPIDJSON_SCHEMA_VERBOSE - unsigned depth_; -#endif -}; - -typedef GenericSchemaValidator SchemaValidator; - -/////////////////////////////////////////////////////////////////////////////// -// SchemaValidatingReader - -//! A helper class for parsing with validation. -/*! - This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate(). - - \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept. - \tparam SourceEncoding Encoding of the input stream. - \tparam SchemaDocumentType Type of schema document. - \tparam StackAllocator Allocator type for stack. -*/ -template < - unsigned parseFlags, - typename InputStream, - typename SourceEncoding, - typename SchemaDocumentType = SchemaDocument, - typename StackAllocator = CrtAllocator> -class SchemaValidatingReader { -public: - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename InputStream::Ch Ch; - typedef GenericValue ValueType; - - //! Constructor - /*! - \param is Input stream. - \param sd Schema document. - */ - SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), error_(kObjectType), isValid_(true) {} - - template - bool operator()(Handler& handler) { - GenericReader reader; - GenericSchemaValidator validator(sd_, handler); - parseResult_ = reader.template Parse(is_, validator); - - isValid_ = validator.IsValid(); - if (isValid_) { - invalidSchemaPointer_ = PointerType(); - invalidSchemaKeyword_ = 0; - invalidDocumentPointer_ = PointerType(); - error_.SetObject(); - } - else { - invalidSchemaPointer_ = validator.GetInvalidSchemaPointer(); - invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword(); - invalidDocumentPointer_ = validator.GetInvalidDocumentPointer(); - error_.CopyFrom(validator.GetError(), allocator_); - } - - return parseResult_; - } - - const ParseResult& GetParseResult() const { return parseResult_; } - bool IsValid() const { return isValid_; } - const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; } - const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; } - const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; } - const ValueType& GetError() const { return error_; } - -private: - InputStream& is_; - const SchemaDocumentType& sd_; - - ParseResult parseResult_; - PointerType invalidSchemaPointer_; - const Ch* invalidSchemaKeyword_; - PointerType invalidDocumentPointer_; - StackAllocator allocator_; - ValueType error_; - bool isValid_; -}; - -CEREAL_RAPIDJSON_NAMESPACE_END -CEREAL_RAPIDJSON_DIAG_POP - -#endif // CEREAL_RAPIDJSON_SCHEMA_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h deleted file mode 100644 index abc0153b7..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stream.h +++ /dev/null @@ -1,223 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#include "rapidjson.h" - -#ifndef CEREAL_RAPIDJSON_STREAM_H_ -#define CEREAL_RAPIDJSON_STREAM_H_ - -#include "encodings.h" - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Stream - -/*! \class rapidjson::Stream - \brief Concept for reading and writing characters. - - For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). - - For write-only stream, only need to implement Put() and Flush(). - -\code -concept Stream { - typename Ch; //!< Character type of the stream. - - //! Read the current character from stream without moving the read cursor. - Ch Peek() const; - - //! Read the current character from stream and moving the read cursor to next character. - Ch Take(); - - //! Get the current read cursor. - //! \return Number of characters read from start. - size_t Tell(); - - //! Begin writing operation at the current read pointer. - //! \return The begin writer pointer. - Ch* PutBegin(); - - //! Write a character. - void Put(Ch c); - - //! Flush the buffer. - void Flush(); - - //! End the writing operation. - //! \param begin The begin write pointer returned by PutBegin(). - //! \return Number of characters written. - size_t PutEnd(Ch* begin); -} -\endcode -*/ - -//! Provides additional information for stream. -/*! - By using traits pattern, this type provides a default configuration for stream. - For custom stream, this type can be specialized for other configuration. - See TEST(Reader, CustomStringStream) in readertest.cpp for example. -*/ -template -struct StreamTraits { - //! Whether to make local copy of stream for optimization during parsing. - /*! - By default, for safety, streams do not use local copy optimization. - Stream that can be copied fast should specialize this, like StreamTraits. - */ - enum { copyOptimization = 0 }; -}; - -//! Reserve n characters for writing to a stream. -template -inline void PutReserve(Stream& stream, size_t count) { - (void)stream; - (void)count; -} - -//! Write character to a stream, presuming buffer is reserved. -template -inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { - stream.Put(c); -} - -//! Put N copies of a character to a stream. -template -inline void PutN(Stream& stream, Ch c, size_t n) { - PutReserve(stream, n); - for (size_t i = 0; i < n; i++) - PutUnsafe(stream, c); -} - -/////////////////////////////////////////////////////////////////////////////// -// GenericStreamWrapper - -//! A Stream Wrapper -/*! \tThis string stream is a wrapper for any stream by just forwarding any - \treceived message to the origin stream. - \note implements Stream concept -*/ - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code -CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -template > -class GenericStreamWrapper { -public: - typedef typename Encoding::Ch Ch; - GenericStreamWrapper(InputStream& is): is_(is) {} - - Ch Peek() const { return is_.Peek(); } - Ch Take() { return is_.Take(); } - size_t Tell() { return is_.Tell(); } - Ch* PutBegin() { return is_.PutBegin(); } - void Put(Ch ch) { is_.Put(ch); } - void Flush() { is_.Flush(); } - size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); } - - // wrapper for MemoryStream - const Ch* Peek4() const { return is_.Peek4(); } - - // wrapper for AutoUTFInputStream - UTFType GetType() const { return is_.GetType(); } - bool HasBOM() const { return is_.HasBOM(); } - -protected: - InputStream& is_; -}; - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -CEREAL_RAPIDJSON_DIAG_POP -#endif - -/////////////////////////////////////////////////////////////////////////////// -// StringStream - -//! Read-only string stream. -/*! \note implements Stream concept -*/ -template -struct GenericStringStream { - typedef typename Encoding::Ch Ch; - - GenericStringStream(const Ch *src) : src_(src), head_(src) {} - - Ch Peek() const { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() const { return static_cast(src_ - head_); } - - Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } - void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } - - const Ch* src_; //!< Current read position. - const Ch* head_; //!< Original head of the string. -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! String stream with UTF8 encoding. -typedef GenericStringStream > StringStream; - -/////////////////////////////////////////////////////////////////////////////// -// InsituStringStream - -//! A read-write string stream. -/*! This string stream is particularly designed for in-situ parsing. - \note implements Stream concept -*/ -template -struct GenericInsituStringStream { - typedef typename Encoding::Ch Ch; - - GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} - - // Read - Ch Peek() { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() { return static_cast(src_ - head_); } - - // Write - void Put(Ch c) { CEREAL_RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } - - Ch* PutBegin() { return dst_ = src_; } - size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } - void Flush() {} - - Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } - void Pop(size_t count) { dst_ -= count; } - - Ch* src_; - Ch* dst_; - Ch* head_; -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! Insitu string stream with UTF8 encoding. -typedef GenericInsituStringStream > InsituStringStream; - -CEREAL_RAPIDJSON_NAMESPACE_END - -#endif // CEREAL_RAPIDJSON_STREAM_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h deleted file mode 100644 index d010477ab..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/stringbuffer.h +++ /dev/null @@ -1,121 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_STRINGBUFFER_H_ -#define CEREAL_RAPIDJSON_STRINGBUFFER_H_ - -#include "stream.h" -#include "internal/stack.h" - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -#include "internal/stack.h" - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output stream. -/*! - \tparam Encoding Encoding of the stream. - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -class GenericStringBuffer { -public: - typedef typename Encoding::Ch Ch; - - GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} - GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { - if (&rhs != this) - stack_ = std::move(rhs.stack_); - return *this; - } -#endif - - void Put(Ch c) { *stack_.template Push() = c; } - void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.ShrinkToFit(); - stack_.template Pop(1); - } - - void Reserve(size_t count) { stack_.template Reserve(count); } - Ch* Push(size_t count) { return stack_.template Push(count); } - Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetString() const { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.template Pop(1); - - return stack_.template Bottom(); - } - - //! Get the size of string in bytes in the string buffer. - size_t GetSize() const { return stack_.GetSize(); } - - //! Get the length of string in Ch in the string buffer. - size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; - -private: - // Prohibit copy constructor & assignment operator. - GenericStringBuffer(const GenericStringBuffer&); - GenericStringBuffer& operator=(const GenericStringBuffer&); -}; - -//! String buffer with UTF8 encoding -typedef GenericStringBuffer > StringBuffer; - -template -inline void PutReserve(GenericStringBuffer& stream, size_t count) { - stream.Reserve(count); -} - -template -inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { - stream.PutUnsafe(c); -} - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { - std::memset(stream.stack_.Push(n), c, n * sizeof(c)); -} - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_STRINGBUFFER_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h b/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h deleted file mode 100644 index b8da773e9..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidjson/writer.h +++ /dev/null @@ -1,709 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef CEREAL_RAPIDJSON_WRITER_H_ -#define CEREAL_RAPIDJSON_WRITER_H_ - -#include "stream.h" -#include "internal/meta.h" -#include "internal/stack.h" -#include "internal/strfunc.h" -#include "internal/dtoa.h" -#include "internal/itoa.h" -#include "stringbuffer.h" -#include // placement new - -#if defined(CEREAL_RAPIDJSON_SIMD) && defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanForward) -#endif -#ifdef CEREAL_RAPIDJSON_SSE42 -#include -#elif defined(CEREAL_RAPIDJSON_SSE2) -#include -#elif defined(CEREAL_RAPIDJSON_NEON) -#include -#endif - -#ifdef __clang__ -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(padded) -CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) -CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) -#elif defined(_MSC_VER) -CEREAL_RAPIDJSON_DIAG_PUSH -CEREAL_RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -#endif - -CEREAL_RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// WriteFlag - -/*! \def CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS - \ingroup CEREAL_RAPIDJSON_CONFIG - \brief User-defined kWriteDefaultFlags definition. - - User can define this as any \c WriteFlag combinations. -*/ -#ifndef CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS -#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags -#endif - -//! Combination of writeFlags -enum WriteFlag { - kWriteNoFlags = 0, //!< No flags are set. - kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings. - kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN. - kWriteDefaultFlags = CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS -}; - -//! JSON writer -/*! Writer implements the concept Handler. - It generates JSON text by events to an output os. - - User may programmatically calls the functions of a writer to generate JSON text. - - On the other side, a writer can also be passed to objects that generates events, - - for example Reader::Parse() and Document::Accept(). - - \tparam OutputStream Type of output stream. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. - \note implements Handler concept -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> -class Writer { -public: - typedef typename SourceEncoding::Ch Ch; - - static const int kDefaultMaxDecimalPlaces = 324; - - //! Constructor - /*! \param os Output stream. - \param stackAllocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - explicit - Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} - - explicit - Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} - -#if CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS - Writer(Writer&& rhs) : - os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) { - rhs.os_ = 0; - } -#endif - - //! Reset the writer with a new stream. - /*! - This function reset the writer with a new stream and default settings, - in order to make a Writer object reusable for output multiple JSONs. - - \param os New output stream. - \code - Writer writer(os1); - writer.StartObject(); - // ... - writer.EndObject(); - - writer.Reset(os2); - writer.StartObject(); - // ... - writer.EndObject(); - \endcode - */ - void Reset(OutputStream& os) { - os_ = &os; - hasRoot_ = false; - level_stack_.Clear(); - } - - //! Checks whether the output is a complete JSON. - /*! - A complete JSON has a complete root object or array. - */ - bool IsComplete() const { - return hasRoot_ && level_stack_.Empty(); - } - - int GetMaxDecimalPlaces() const { - return maxDecimalPlaces_; - } - - //! Sets the maximum number of decimal places for double output. - /*! - This setting truncates the output with specified number of decimal places. - - For example, - - \code - writer.SetMaxDecimalPlaces(3); - writer.StartArray(); - writer.Double(0.12345); // "0.123" - writer.Double(0.0001); // "0.0" - writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent) - writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent) - writer.EndArray(); - \endcode - - The default setting does not truncate any decimal places. You can restore to this setting by calling - \code - writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces); - \endcode - */ - void SetMaxDecimalPlaces(int maxDecimalPlaces) { - maxDecimalPlaces_ = maxDecimalPlaces; - } - - /*!@name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { Prefix(kNullType); return EndValue(WriteNull()); } - bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); } - bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); } - bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); } - bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); } - bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); } - - //! Writes the given \c double value to the stream - /*! - \param d The value to be written. - \return Whether it is succeed. - */ - bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); } - - bool RawNumber(const Ch* str, SizeType length, bool copy = false) { - CEREAL_RAPIDJSON_ASSERT(str != 0); - (void)copy; - Prefix(kNumberType); - return EndValue(WriteString(str, length)); - } - - bool String(const Ch* str, SizeType length, bool copy = false) { - CEREAL_RAPIDJSON_ASSERT(str != 0); - (void)copy; - Prefix(kStringType); - return EndValue(WriteString(str, length)); - } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - Prefix(kObjectType); - new (level_stack_.template Push()) Level(false); - return WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - -#if CEREAL_RAPIDJSON_HAS_STDSTRING - bool Key(const std::basic_string& str) - { - return Key(str.data(), SizeType(str.size())); - } -#endif - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - CEREAL_RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object - CEREAL_RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); // currently inside an Array, not Object - CEREAL_RAPIDJSON_ASSERT(0 == level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value - level_stack_.template Pop(1); - return EndValue(WriteEndObject()); - } - - bool StartArray() { - Prefix(kArrayType); - new (level_stack_.template Push()) Level(true); - return WriteStartArray(); - } - - bool EndArray(SizeType elementCount = 0) { - (void)elementCount; - CEREAL_RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); - CEREAL_RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); - level_stack_.template Pop(1); - return EndValue(WriteEndArray()); - } - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); } - - //@} - - //! Write a raw JSON value. - /*! - For user to write a stringified JSON as a value. - - \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. - \param length Length of the json. - \param type Type of the root of json. - */ - bool RawValue(const Ch* json, size_t length, Type type) { - CEREAL_RAPIDJSON_ASSERT(json != 0); - Prefix(type); - return EndValue(WriteRawValue(json, length)); - } - - //! Flush the output stream. - /*! - Allows the user to flush the output stream immediately. - */ - void Flush() { - os_->Flush(); - } - -protected: - //! Information for each nested level - struct Level { - Level(bool inArray_) : valueCount(0), inArray(inArray_) {} - size_t valueCount; //!< number of values in this level - bool inArray; //!< true if in array, otherwise in object - }; - - static const size_t kDefaultLevelDepth = 32; - - bool WriteNull() { - PutReserve(*os_, 4); - PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true; - } - - bool WriteBool(bool b) { - if (b) { - PutReserve(*os_, 4); - PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e'); - } - else { - PutReserve(*os_, 5); - PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e'); - } - return true; - } - - bool WriteInt(int i) { - char buffer[11]; - const char* end = internal::i32toa(i, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteUint(unsigned u) { - char buffer[10]; - const char* end = internal::u32toa(u, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteInt64(int64_t i64) { - char buffer[21]; - const char* end = internal::i64toa(i64, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteUint64(uint64_t u64) { - char buffer[20]; - char* end = internal::u64toa(u64, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteDouble(double d) { - if (internal::Double(d).IsNanOrInf()) { - if (!(writeFlags & kWriteNanAndInfFlag)) - return false; - if (internal::Double(d).IsNan()) { - PutReserve(*os_, 3); - PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); - return true; - } - if (internal::Double(d).Sign()) { - PutReserve(*os_, 9); - PutUnsafe(*os_, '-'); - } - else - PutReserve(*os_, 8); - PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); - PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); - return true; - } - - char buffer[25]; - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - PutReserve(*os_, static_cast(end - buffer)); - for (char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteString(const Ch* str, SizeType length) { - static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - static const char escape[256] = { -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - //0 1 2 3 4 5 6 7 8 9 A B C D E F - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 - 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - Z16, Z16, // 30~4F - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF -#undef Z16 - }; - - if (TargetEncoding::supportUnicode) - PutReserve(*os_, 2 + length * 6); // "\uxxxx..." - else - PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..." - - PutUnsafe(*os_, '\"'); - GenericStringStream is(str); - while (ScanWriteUnescapedString(is, length)) { - const Ch c = is.Peek(); - if (!TargetEncoding::supportUnicode && static_cast(c) >= 0x80) { - // Unicode escaping - unsigned codepoint; - if (CEREAL_RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint))) - return false; - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, 'u'); - if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { - PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint ) & 15]); - } - else { - CEREAL_RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); - // Surrogate pair - unsigned s = codepoint - 0x010000; - unsigned lead = (s >> 10) + 0xD800; - unsigned trail = (s & 0x3FF) + 0xDC00; - PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(lead ) & 15]); - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, 'u'); - PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(trail ) & 15]); - } - } - else if ((sizeof(Ch) == 1 || static_cast(c) < 256) && CEREAL_RAPIDJSON_UNLIKELY(escape[static_cast(c)])) { - is.Take(); - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, static_cast(escape[static_cast(c)])); - if (escape[static_cast(c)] == 'u') { - PutUnsafe(*os_, '0'); - PutUnsafe(*os_, '0'); - PutUnsafe(*os_, hexDigits[static_cast(c) >> 4]); - PutUnsafe(*os_, hexDigits[static_cast(c) & 0xF]); - } - } - else if (CEREAL_RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? - Transcoder::Validate(is, *os_) : - Transcoder::TranscodeUnsafe(is, *os_)))) - return false; - } - PutUnsafe(*os_, '\"'); - return true; - } - - bool ScanWriteUnescapedString(GenericStringStream& is, size_t length) { - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); - } - - bool WriteStartObject() { os_->Put('{'); return true; } - bool WriteEndObject() { os_->Put('}'); return true; } - bool WriteStartArray() { os_->Put('['); return true; } - bool WriteEndArray() { os_->Put(']'); return true; } - - bool WriteRawValue(const Ch* json, size_t length) { - PutReserve(*os_, length); - GenericStringStream is(json); - while (CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) { - CEREAL_RAPIDJSON_ASSERT(is.Peek() != '\0'); - if (CEREAL_RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? - Transcoder::Validate(is, *os_) : - Transcoder::TranscodeUnsafe(is, *os_)))) - return false; - } - return true; - } - - void Prefix(Type type) { - (void)type; - if (CEREAL_RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root - Level* level = level_stack_.template Top(); - if (level->valueCount > 0) { - if (level->inArray) - os_->Put(','); // add comma if it is not the first element in array - else // in object - os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); - } - if (!level->inArray && level->valueCount % 2 == 0) - CEREAL_RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - CEREAL_RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. - hasRoot_ = true; - } - } - - // Flush the value if it is the top level one. - bool EndValue(bool ret) { - if (CEREAL_RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text - Flush(); - return ret; - } - - OutputStream* os_; - internal::Stack level_stack_; - int maxDecimalPlaces_; - bool hasRoot_; - -private: - // Prohibit copy constructor & assignment operator. - Writer(const Writer&); - Writer& operator=(const Writer&); -}; - -// Full specialization for StringStream to prevent memory copying - -template<> -inline bool Writer::WriteInt(int i) { - char *buffer = os_->Push(11); - const char* end = internal::i32toa(i, buffer); - os_->Pop(static_cast(11 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteUint(unsigned u) { - char *buffer = os_->Push(10); - const char* end = internal::u32toa(u, buffer); - os_->Pop(static_cast(10 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteInt64(int64_t i64) { - char *buffer = os_->Push(21); - const char* end = internal::i64toa(i64, buffer); - os_->Pop(static_cast(21 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteUint64(uint64_t u) { - char *buffer = os_->Push(20); - const char* end = internal::u64toa(u, buffer); - os_->Pop(static_cast(20 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteDouble(double d) { - if (internal::Double(d).IsNanOrInf()) { - // Note: This code path can only be reached if (CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag). - if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) - return false; - if (internal::Double(d).IsNan()) { - PutReserve(*os_, 3); - PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); - return true; - } - if (internal::Double(d).Sign()) { - PutReserve(*os_, 9); - PutUnsafe(*os_, '-'); - } - else - PutReserve(*os_, 8); - PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); - PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); - return true; - } - - char *buffer = os_->Push(25); - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - os_->Pop(static_cast(25 - (end - buffer))); - return true; -} - -#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) -template<> -inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { - if (length < 16) - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); - - if (!CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) - return false; - - const char* p = is.src_; - const char* end = is.head_ + length; - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); - if (nextAligned > end) - return true; - - while (p != nextAligned) - if (*p < 0x20 || *p == '\"' || *p == '\\') { - is.src_ = p; - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); - } - else - os_->PutUnsafe(*p++); - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (; p != endAligned; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (CEREAL_RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - SizeType len; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - len = offset; -#else - len = static_cast(__builtin_ffs(r) - 1); -#endif - char* q = reinterpret_cast(os_->PushUnsafe(len)); - for (size_t i = 0; i < len; i++) - q[i] = p[i]; - - p += len; - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s); - } - - is.src_ = p; - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); -} -#elif defined(CEREAL_RAPIDJSON_NEON) -template<> -inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { - if (length < 16) - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); - - if (!CEREAL_RAPIDJSON_LIKELY(is.Tell() < length)) - return false; - - const char* p = is.src_; - const char* end = is.head_ + length; - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); - if (nextAligned > end) - return true; - - while (p != nextAligned) - if (*p < 0x20 || *p == '\"' || *p == '\\') { - is.src_ = p; - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); - } - else - os_->PutUnsafe(*p++); - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (; p != endAligned; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract - uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract - - SizeType len = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - unsigned lz = (unsigned)__builtin_clzll(high); - len = 8 + (lz >> 3); - escaped = true; - } - } else { - unsigned lz = (unsigned)__builtin_clzll(low); - len = lz >> 3; - escaped = true; - } - if (CEREAL_RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - char* q = reinterpret_cast(os_->PushUnsafe(len)); - for (size_t i = 0; i < len; i++) - q[i] = p[i]; - - p += len; - break; - } - vst1q_u8(reinterpret_cast(os_->PushUnsafe(16)), s); - } - - is.src_ = p; - return CEREAL_RAPIDJSON_LIKELY(is.Tell() < length); -} -#endif // CEREAL_RAPIDJSON_NEON - -CEREAL_RAPIDJSON_NAMESPACE_END - -#if defined(_MSC_VER) || defined(__clang__) -CEREAL_RAPIDJSON_DIAG_POP -#endif - -#endif // CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt b/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt deleted file mode 100644 index 0095bc72f..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/license.txt +++ /dev/null @@ -1,52 +0,0 @@ -Use of this software is granted under one of the following two licenses, -to be chosen freely by the user. - -1. Boost Software License - Version 1.0 - August 17th, 2003 -=============================================================================== - -Copyright (c) 2006, 2007 Marcin Kalicinski - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -2. The MIT License -=============================================================================== - -Copyright (c) 2006, 2007 Marcin Kalicinski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html b/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html deleted file mode 100644 index 4e6a5f1a9..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/manual.html +++ /dev/null @@ -1,406 +0,0 @@ -

RAPIDXML Manual

Version 1.13

Copyright (C) 2006, 2009 Marcin Kalicinski
See accompanying file
license.txt for license information.

Table of Contents

1. What is RapidXml?
1.1 Dependencies And Compatibility
1.2 Character Types And Encodings
1.3 Error Handling
1.4 Memory Allocation
1.5 W3C Compliance
1.6 API Design
1.7 Reliability
1.8 Acknowledgements
2. Two Minute Tutorial
2.1 Parsing
2.2 Accessing The DOM Tree
2.3 Modifying The DOM Tree
2.4 Printing XML
3. Differences From Regular XML Parsers
3.1 Lifetime Of Source Text
3.2 Ownership Of Strings
3.3 Destructive Vs Non-Destructive Mode
4. Performance
4.1 Comparison With Other Parsers
5. Reference

1. What is RapidXml?

RapidXml is an attempt to create the fastest XML DOM parser possible, while retaining useability, portability and reasonable W3C compatibility. It is an in-situ parser written in C++, with parsing speed approaching that of strlen() function executed on the same data.

- Entire parser is contained in a single header file, so no building or linking is neccesary. To use it you just need to copy rapidxml.hpp file to a convenient place (such as your project directory), and include it where needed. You may also want to use printing functions contained in header rapidxml_print.hpp.

1.1 Dependencies And Compatibility

RapidXml has no dependencies other than a very small subset of standard C++ library (<cassert>, <cstdlib>, <new> and <exception>, unless exceptions are disabled). It should compile on any reasonably conformant compiler, and was tested on Visual C++ 2003, Visual C++ 2005, Visual C++ 2008, gcc 3, gcc 4, and Comeau 4.3.3. Care was taken that no warnings are produced on these compilers, even with highest warning levels enabled.

1.2 Character Types And Encodings

RapidXml is character type agnostic, and can work both with narrow and wide characters. Current version does not fully support UTF-16 or UTF-32, so use of wide characters is somewhat incapacitated. However, it should succesfully parse wchar_t strings containing UTF-16 or UTF-32 if endianness of the data matches that of the machine. UTF-8 is fully supported, including all numeric character references, which are expanded into appropriate UTF-8 byte sequences (unless you enable parse_no_utf8 flag).

- Note that RapidXml performs no decoding - strings returned by name() and value() functions will contain text encoded using the same encoding as source file. Rapidxml understands and expands the following character references: &apos; &amp; &quot; &lt; &gt; &#...; Other character references are not expanded.

1.3 Error Handling

By default, RapidXml uses C++ exceptions to report errors. If this behaviour is undesirable, RAPIDXML_NO_EXCEPTIONS can be defined to suppress exception code. See parse_error class and parse_error_handler() function for more information.

1.4 Memory Allocation

RapidXml uses a special memory pool object to allocate nodes and attributes, because direct allocation using new operator would be far too slow. Underlying memory allocations performed by the pool can be customized by use of memory_pool::set_allocator() function. See class memory_pool for more information.

1.5 W3C Compliance

RapidXml is not a W3C compliant parser, primarily because it ignores DOCTYPE declarations. There is a number of other, minor incompatibilities as well. Still, it can successfully parse and produce complete trees of all valid XML files in W3C conformance suite (over 1000 files specially designed to find flaws in XML processors). In destructive mode it performs whitespace normalization and character entity substitution for a small set of built-in entities.

1.6 API Design

RapidXml API is minimalistic, to reduce code size as much as possible, and facilitate use in embedded environments. Additional convenience functions are provided in separate headers: rapidxml_utils.hpp and rapidxml_print.hpp. Contents of these headers is not an essential part of the library, and is currently not documented (otherwise than with comments in code).

1.7 Reliability

RapidXml is very robust and comes with a large harness of unit tests. Special care has been taken to ensure stability of the parser no matter what source text is thrown at it. One of the unit tests produces 100,000 randomly corrupted variants of XML document, which (when uncorrupted) contains all constructs recognized by RapidXml. RapidXml passes this test when it correctly recognizes that errors have been introduced, and does not crash or loop indefinitely.

- Another unit test puts RapidXml head-to-head with another, well estabilished XML parser, and verifies that their outputs match across a wide variety of small and large documents.

- Yet another test feeds RapidXml with over 1000 test files from W3C compliance suite, and verifies that correct results are obtained. There are also additional tests that verify each API function separately, and test that various parsing modes work as expected.

1.8 Acknowledgements

I would like to thank Arseny Kapoulkine for his work on pugixml, which was an inspiration for this project. Additional thanks go to Kristen Wegner for creating pugxml, from which pugixml was derived. Janusz Wohlfeil kindly ran RapidXml speed tests on hardware that I did not have access to, allowing me to expand performance comparison table.

2. Two Minute Tutorial

2.1 Parsing

The following code causes RapidXml to parse a zero-terminated string named text:
using namespace rapidxml;
-xml_document<> doc;    // character type defaults to char
-doc.parse<0>(text);    // 0 means default parse flags
-
doc object is now a root of DOM tree containing representation of the parsed XML. Because all RapidXml interface is contained inside namespace rapidxml, users must either bring contents of this namespace into scope, or fully qualify all the names. Class xml_document represents a root of the DOM hierarchy. By means of public inheritance, it is also an xml_node and a memory_pool. Template parameter of xml_document::parse() function is used to specify parsing flags, with which you can fine-tune behaviour of the parser. Note that flags must be a compile-time constant.

2.2 Accessing The DOM Tree

To access the DOM tree, use methods of xml_node and xml_attribute classes:
cout << "Name of my first node is: " << doc.first_node()->name() << "\n";
-xml_node<> *node = doc.first_node("foobar");
-cout << "Node foobar has value " << node->value() << "\n";
-for (xml_attribute<> *attr = node->first_attribute();
-     attr; attr = attr->next_attribute())
-{
-    cout << "Node foobar has attribute " << attr->name() << " ";
-    cout << "with value " << attr->value() << "\n";
-}
-

2.3 Modifying The DOM Tree

DOM tree produced by the parser is fully modifiable. Nodes and attributes can be added/removed, and their contents changed. The below example creates a HTML document, whose sole contents is a link to google.com website:
xml_document<> doc;
-xml_node<> *node = doc.allocate_node(node_element, "a", "Google");
-doc.append_node(node);
-xml_attribute<> *attr = doc.allocate_attribute("href", "google.com");
-node->append_attribute(attr);
-
One quirk is that nodes and attributes do not own the text of their names and values. This is because normally they only store pointers to the source text. So, when assigning a new name or value to the node, care must be taken to ensure proper lifetime of the string. The easiest way to achieve it is to allocate the string from the xml_document memory pool. In the above example this is not necessary, because we are only assigning character constants. But the code below uses memory_pool::allocate_string() function to allocate node name (which will have the same lifetime as the document), and assigns it to a new node:
xml_document<> doc;
-char *node_name = doc.allocate_string(name);        // Allocate string and copy name into it
-xml_node<> *node = doc.allocate_node(node_element, node_name);  // Set node name to node_name
-
Check Reference section for description of the entire interface.

2.4 Printing XML

You can print xml_document and xml_node objects into an XML string. Use print() function or operator <<, which are defined in rapidxml_print.hpp header.
using namespace rapidxml;
-xml_document<> doc;    // character type defaults to char
-// ... some code to fill the document
-
-// Print to stream using operator <<
-std::cout << doc;   
-
-// Print to stream using print function, specifying printing flags
-print(std::cout, doc, 0);   // 0 means default printing flags
-
-// Print to string using output iterator
-std::string s;
-print(std::back_inserter(s), doc, 0);
-
-// Print to memory buffer using output iterator
-char buffer[4096];                      // You are responsible for making the buffer large enough!
-char *end = print(buffer, doc, 0);      // end contains pointer to character after last printed character
-*end = 0;                               // Add string terminator after XML
-

3. Differences From Regular XML Parsers

RapidXml is an in-situ parser, which allows it to achieve very high parsing speed. In-situ means that parser does not make copies of strings. Instead, it places pointers to the source text in the DOM hierarchy.

3.1 Lifetime Of Source Text

In-situ parsing requires that source text lives at least as long as the document object. If source text is destroyed, names and values of nodes in DOM tree will become destroyed as well. Additionally, whitespace processing, character entity translation, and zero-termination of strings require that source text be modified during parsing (but see non-destructive mode). This makes the text useless for further processing once it was parsed by RapidXml.

- In many cases however, these are not serious issues.

3.2 Ownership Of Strings

Nodes and attributes produced by RapidXml do not own their name and value strings. They merely hold the pointers to them. This means you have to be careful when setting these values manually, by using xml_base::name(const Ch *) or xml_base::value(const Ch *) functions. Care must be taken to ensure that lifetime of the string passed is at least as long as lifetime of the node/attribute. The easiest way to achieve it is to allocate the string from memory_pool owned by the document. Use memory_pool::allocate_string() function for this purpose.

3.3 Destructive Vs Non-Destructive Mode

By default, the parser modifies source text during the parsing process. This is required to achieve character entity translation, whitespace normalization, and zero-termination of strings.

- In some cases this behaviour may be undesirable, for example if source text resides in read only memory, or is mapped to memory directly from file. By using appropriate parser flags (parse_non_destructive), source text modifications can be disabled. However, because RapidXml does in-situ parsing, it obviously has the following side-effects:

4. Performance

RapidXml achieves its speed through use of several techniques:
  • In-situ parsing. When building DOM tree, RapidXml does not make copies of string data, such as node names and values. Instead, it stores pointers to interior of the source text.
  • Use of template metaprogramming techniques. This allows it to move much of the work to compile time. Through magic of the templates, C++ compiler generates a separate copy of parsing code for any combination of parser flags you use. In each copy, all possible decisions are made at compile time and all unused code is omitted.
  • Extensive use of lookup tables for parsing.
  • Hand-tuned C++ with profiling done on several most popular CPUs.
This results in a very small and fast code: a parser which is custom tailored to exact needs with each invocation.

4.1 Comparison With Other Parsers

The table below compares speed of RapidXml to some other parsers, and to strlen() function executed on the same data. On a modern CPU (as of 2007), you can expect parsing throughput to be close to 1 GB/s. As a rule of thumb, parsing speed is about 50-100x faster than Xerces DOM, 30-60x faster than TinyXml, 3-12x faster than pugxml, and about 5% - 30% faster than pugixml, the fastest XML parser I know of.
  • The test file is a real-world, 50kB large, moderately dense XML file.
  • All timing is done by using RDTSC instruction present in Pentium-compatible CPUs.
  • No profile-guided optimizations are used.
  • All parsers are running in their fastest modes.
  • The results are given in CPU cycles per character, so frequency of CPUs is irrelevant.
  • The results are minimum values from a large number of runs, to minimize effects of operating system activity, task switching, interrupt handling etc.
  • A single parse of the test file takes about 1/10th of a millisecond, so with large number of runs there is a good chance of hitting at least one no-interrupt streak, and obtaining undisturbed results.
Platform
Compiler
strlen() RapidXml pugixml 0.3 pugxml TinyXml
Pentium 4
MSVC 8.0
2.5
5.4
7.0
61.7
298.8
Pentium 4
gcc 4.1.1
0.8
6.1
9.5
67.0
413.2
Core 2
MSVC 8.0
1.0
4.5
5.0
24.6
154.8
Core 2
gcc 4.1.1
0.6
4.6
5.4
28.3
229.3
Athlon XP
MSVC 8.0
3.1
7.7
8.0
25.5
182.6
Athlon XP
gcc 4.1.1
0.9
8.2
9.2
33.7
265.2
Pentium 3
MSVC 8.0
2.0
6.3
7.0
30.9
211.9
Pentium 3
gcc 4.1.1
1.0
6.7
8.9
35.3
316.0
(*) All results are in CPU cycles per character of source text

5. Reference

This section lists all classes, functions, constants etc. and describes them in detail.
class - template - rapidxml::memory_pool
- constructor - memory_pool()
- destructor - ~memory_pool()
function allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)
function allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)
function allocate_string(const Ch *source=0, std::size_t size=0)
function clone_node(const xml_node< Ch > *source, xml_node< Ch > *result=0)
function clear()
function set_allocator(alloc_func *af, free_func *ff)

class rapidxml::parse_error
- constructor - parse_error(const char *what, void *where)
function what() const
function where() const

class - template - rapidxml::xml_attribute
- constructor - xml_attribute()
function document() const
function previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const

class - template - rapidxml::xml_base
- constructor - xml_base()
function name() const
function name_size() const
function value() const
function value_size() const
function name(const Ch *name, std::size_t size)
function name(const Ch *name)
function value(const Ch *value, std::size_t size)
function value(const Ch *value)
function parent() const

class - template - rapidxml::xml_document
- constructor - xml_document()
function parse(Ch *text)
function clear()

class - template - rapidxml::xml_node
- constructor - xml_node(node_type type)
function type() const
function document() const
function first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
function type(node_type type)
function prepend_node(xml_node< Ch > *child)
function append_node(xml_node< Ch > *child)
function insert_node(xml_node< Ch > *where, xml_node< Ch > *child)
function remove_first_node()
function remove_last_node()
function remove_node(xml_node< Ch > *where)
function remove_all_nodes()
function prepend_attribute(xml_attribute< Ch > *attribute)
function append_attribute(xml_attribute< Ch > *attribute)
function insert_attribute(xml_attribute< Ch > *where, xml_attribute< Ch > *attribute)
function remove_first_attribute()
function remove_last_attribute()
function remove_attribute(xml_attribute< Ch > *where)
function remove_all_attributes()

namespace rapidxml
enum node_type
function parse_error_handler(const char *what, void *where)
function print(OutIt out, const xml_node< Ch > &node, int flags=0)
function print(std::basic_ostream< Ch > &out, const xml_node< Ch > &node, int flags=0)
function operator<<(std::basic_ostream< Ch > &out, const xml_node< Ch > &node)
- constant - parse_no_data_nodes
- constant - parse_no_element_values
- constant - parse_no_string_terminators
- constant - parse_no_entity_translation
- constant - parse_no_utf8
- constant - parse_declaration_node
- constant - parse_comment_nodes
- constant - parse_doctype_node
- constant - parse_pi_nodes
- constant - parse_validate_closing_tags
- constant - parse_trim_whitespace
- constant - parse_normalize_whitespace
- constant - parse_default
- constant - parse_non_destructive
- constant - parse_fastest
- constant - parse_full
- constant - print_no_indenting


class - template - rapidxml::memory_pool

- - Defined in rapidxml.hpp
- Base class for - xml_document

Description

This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. In most cases, you will not need to use this class directly. However, if you need to create nodes manually or modify names/values of nodes, you are encouraged to use memory_pool of relevant xml_document to allocate the memory. Not only is this faster than allocating them by using new operator, but also their lifetime will be tied to the lifetime of document, possibly simplyfing memory management.

- Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. You can also call allocate_string() function to allocate strings. Such strings can then be used as names or values of nodes without worrying about their lifetime. Note that there is no free() function -- all allocations are freed at once when clear() function is called, or when the pool is destroyed.

- It is also possible to create a standalone memory_pool, and use it to allocate nodes, whose lifetime will not be tied to any document.

- Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. Until static memory is exhausted, no dynamic memory allocations are done. When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, by using global new[] and delete[] operators. This behaviour can be changed by setting custom allocation routines. Use set_allocator() function to set them.

- Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. This value defaults to the size of pointer on target architecture.

- To obtain absolutely top performance from the parser, it is important that all nodes are allocated from a single, contiguous block of memory. Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT to obtain best wasted memory to performance compromise. To do it, define their values before rapidxml.hpp file is included.

Parameters

Ch
Character type of created nodes.

- constructor - memory_pool::memory_pool

Synopsis

memory_pool(); -

Description

Constructs empty pool with default allocator functions.

- destructor - memory_pool::~memory_pool

Synopsis

~memory_pool(); -

Description

Destroys pool and frees all the memory. This causes memory occupied by nodes allocated by the pool to be freed. Nodes allocated from the pool are no longer valid.

function memory_pool::allocate_node

Synopsis

xml_node<Ch>* allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0); -

Description

Allocates a new node from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

type
Type of node to create.
name
Name to assign to the node, or 0 to assign no name.
value
Value to assign to the node, or 0 to assign no value.
name_size
Size of name to assign, or 0 to automatically calculate size from name string.
value_size
Size of value to assign, or 0 to automatically calculate size from value string.

Returns

Pointer to allocated node. This pointer will never be NULL.

function memory_pool::allocate_attribute

Synopsis

xml_attribute<Ch>* allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0); -

Description

Allocates a new attribute from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

name
Name to assign to the attribute, or 0 to assign no name.
value
Value to assign to the attribute, or 0 to assign no value.
name_size
Size of name to assign, or 0 to automatically calculate size from name string.
value_size
Size of value to assign, or 0 to automatically calculate size from value string.

Returns

Pointer to allocated attribute. This pointer will never be NULL.

function memory_pool::allocate_string

Synopsis

Ch* allocate_string(const Ch *source=0, std::size_t size=0); -

Description

Allocates a char array of given size from the pool, and optionally copies a given string to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters

source
String to initialize the allocated memory with, or 0 to not initialize it.
size
Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated.

Returns

Pointer to allocated char array. This pointer will never be NULL.

function memory_pool::clone_node

Synopsis

xml_node<Ch>* clone_node(const xml_node< Ch > *source, xml_node< Ch > *result=0); -

Description

Clones an xml_node and its hierarchy of child nodes and attributes. Nodes and attributes are allocated from this memory pool. Names and values are not cloned, they are shared between the clone and the source. Result node can be optionally specified as a second parameter, in which case its contents will be replaced with cloned source node. This is useful when you want to clone entire document.

Parameters

source
Node to clone.
result
Node to put results in, or 0 to automatically allocate result node

Returns

Pointer to cloned node. This pointer will never be NULL.

function memory_pool::clear

Synopsis

void clear(); -

Description

Clears the pool. This causes memory occupied by nodes allocated by the pool to be freed. Any nodes or strings allocated from the pool will no longer be valid.

function memory_pool::set_allocator

Synopsis

void set_allocator(alloc_func *af, free_func *ff); -

Description

Sets or resets the user-defined memory allocation functions for the pool. This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. Allocation function must not return invalid pointer on failure. It should either throw, stop the program, or use longjmp() function to pass control to other place of program. If it returns invalid pointer, results are undefined.

- User defined allocation functions must have the following forms:

-void *allocate(std::size_t size);
-void free(void *pointer);

Parameters

af
Allocation function, or 0 to restore default function
ff
Free function, or 0 to restore default function

class rapidxml::parse_error

- - Defined in rapidxml.hpp

Description

Parse error exception. This exception is thrown by the parser when an error occurs. Use what() function to get human-readable error message. Use where() function to get a pointer to position within source text where error was detected.

- If throwing exceptions by the parser is undesirable, it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. This function must be defined by the user.

- This class derives from std::exception class.

- constructor - parse_error::parse_error

Synopsis

parse_error(const char *what, void *where); -

Description

Constructs parse error.

function parse_error::what

Synopsis

virtual const char* what() const; -

Description

Gets human readable description of error.

Returns

Pointer to null terminated description of the error.

function parse_error::where

Synopsis

Ch* where() const; -

Description

Gets pointer to character data where error happened. Ch should be the same as char type of xml_document that produced the error.

Returns

Pointer to location within the parsed string where error occured.

class - template - rapidxml::xml_attribute

- - Defined in rapidxml.hpp
- Inherits from - xml_base

Description

Class representing attribute node of XML document. Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). Note that after parse, both name and value of attribute will point to interior of source text used for parsing. Thus, this text must persist in memory for the lifetime of attribute.

Parameters

Ch
Character type to use.

- constructor - xml_attribute::xml_attribute

Synopsis

xml_attribute(); -

Description

Constructs an empty attribute with the specified type. Consider using memory_pool of appropriate xml_document if allocating attributes manually.

function xml_attribute::document

Synopsis

xml_document<Ch>* document() const; -

Description

Gets document of which attribute is a child.

Returns

Pointer to document that contains this attribute, or 0 if there is no parent document.

function xml_attribute::previous_attribute

Synopsis

xml_attribute<Ch>* previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets previous attribute, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_attribute::next_attribute

Synopsis

xml_attribute<Ch>* next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets next attribute, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

class - template - rapidxml::xml_base

- - Defined in rapidxml.hpp
- Base class for - xml_attribute xml_node

Description

Base class for xml_node and xml_attribute implementing common functions: name(), name_size(), value(), value_size() and parent().

Parameters

Ch
Character type to use

- constructor - xml_base::xml_base

Synopsis

xml_base(); -

function xml_base::name

Synopsis

Ch* name() const; -

Description

Gets name of the node. Interpretation of name depends on type of node. Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.

- Use name_size() function to determine length of the name.

Returns

Name of node, or empty string if node has no name.

function xml_base::name_size

Synopsis

std::size_t name_size() const; -

Description

Gets size of node name, not including terminator character. This function works correctly irrespective of whether name is or is not zero terminated.

Returns

Size of node name, in characters.

function xml_base::value

Synopsis

Ch* value() const; -

Description

Gets value of node. Interpretation of value depends on type of node. Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.

- Use value_size() function to determine length of the value.

Returns

Value of node, or empty string if node has no value.

function xml_base::value_size

Synopsis

std::size_t value_size() const; -

Description

Gets size of node value, not including terminator character. This function works correctly irrespective of whether value is or is not zero terminated.

Returns

Size of node value, in characters.

function xml_base::name

Synopsis

void name(const Ch *name, std::size_t size); -

Description

Sets name of node to a non zero-terminated string. See Ownership Of Strings .

- Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.

- Size of name must be specified separately, because name does not have to be zero terminated. Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).

Parameters

name
Name of node to set. Does not have to be zero terminated.
size
Size of name, in characters. This does not include zero terminator, if one is present.

function xml_base::name

Synopsis

void name(const Ch *name); -

Description

Sets name of node to a zero-terminated string. See also Ownership Of Strings and xml_node::name(const Ch *, std::size_t).

Parameters

name
Name of node to set. Must be zero terminated.

function xml_base::value

Synopsis

void value(const Ch *value, std::size_t size); -

Description

Sets value of node to a non zero-terminated string. See Ownership Of Strings .

- Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.

- Size of value must be specified separately, because it does not have to be zero terminated. Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated).

- If an element has a child node of type node_data, it will take precedence over element value when printing. If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.

Parameters

value
value of node to set. Does not have to be zero terminated.
size
Size of value, in characters. This does not include zero terminator, if one is present.

function xml_base::value

Synopsis

void value(const Ch *value); -

Description

Sets value of node to a zero-terminated string. See also Ownership Of Strings and xml_node::value(const Ch *, std::size_t).

Parameters

value
Vame of node to set. Must be zero terminated.

function xml_base::parent

Synopsis

xml_node<Ch>* parent() const; -

Description

Gets node parent.

Returns

Pointer to parent node, or 0 if there is no parent.

class - template - rapidxml::xml_document

- - Defined in rapidxml.hpp
- Inherits from - xml_node memory_pool

Description

This class represents root of the DOM hierarchy. It is also an xml_node and a memory_pool through public inheritance. Use parse() function to build a DOM tree from a zero-terminated XML text string. parse() function allocates memory for nodes and attributes by using functions of xml_document, which are inherited from memory_pool. To access root node of the document, use the document itself, as if it was an xml_node.

Parameters

Ch
Character type to use.

- constructor - xml_document::xml_document

Synopsis

xml_document(); -

Description

Constructs empty XML document.

function xml_document::parse

Synopsis

void parse(Ch *text); -

Description

Parses zero-terminated XML string according to given flags. Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. The string must persist for the lifetime of the document. In case of error, rapidxml::parse_error exception will be thrown.

- If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. Make sure that data is zero-terminated.

- Document can be parsed into multiple times. Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool.

Parameters

text
XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser.

function xml_document::clear

Synopsis

void clear(); -

Description

Clears the document by deleting all nodes and clearing the memory pool. All nodes owned by document pool are destroyed.

class - template - rapidxml::xml_node

- - Defined in rapidxml.hpp
- Inherits from - xml_base
- Base class for - xml_document

Description

Class representing a node of XML document. Each node may have associated name and value strings, which are available through name() and value() functions. Interpretation of name and value depends on type of the node. Type of node can be determined by using type() function.

- Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. Thus, this text must persist in the memory for the lifetime of node.

Parameters

Ch
Character type to use.

- constructor - xml_node::xml_node

Synopsis

xml_node(node_type type); -

Description

Constructs an empty node with the specified type. Consider using memory_pool of appropriate document to allocate nodes manually.

Parameters

type
Type of node to construct.

function xml_node::type

Synopsis

node_type type() const; -

Description

Gets type of node.

Returns

Type of node.

function xml_node::document

Synopsis

xml_document<Ch>* document() const; -

Description

Gets document of which node is a child.

Returns

Pointer to document that contains this node, or 0 if there is no parent document.

function xml_node::first_node

Synopsis

xml_node<Ch>* first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets first child node, optionally matching node name.

Parameters

name
Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found child, or 0 if not found.

function xml_node::last_node

Synopsis

xml_node<Ch>* last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets last child node, optionally matching node name. Behaviour is undefined if node has no children. Use first_node() to test if node has children.

Parameters

name
Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found child, or 0 if not found.

function xml_node::previous_sibling

Synopsis

xml_node<Ch>* previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets previous sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent.

Parameters

name
Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found sibling, or 0 if not found.

function xml_node::next_sibling

Synopsis

xml_node<Ch>* next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets next sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent.

Parameters

name
Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found sibling, or 0 if not found.

function xml_node::first_attribute

Synopsis

xml_attribute<Ch>* first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets first attribute of node, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_node::last_attribute

Synopsis

xml_attribute<Ch>* last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const; -

Description

Gets last attribute of node, optionally matching attribute name.

Parameters

name
Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters

Returns

Pointer to found attribute, or 0 if not found.

function xml_node::type

Synopsis

void type(node_type type); -

Description

Sets type of node.

Parameters

type
Type of node to set.

function xml_node::prepend_node

Synopsis

void prepend_node(xml_node< Ch > *child); -

Description

Prepends a new child node. The prepended child becomes the first child, and all existing children are moved one position back.

Parameters

child
Node to prepend.

function xml_node::append_node

Synopsis

void append_node(xml_node< Ch > *child); -

Description

Appends a new child node. The appended child becomes the last child.

Parameters

child
Node to append.

function xml_node::insert_node

Synopsis

void insert_node(xml_node< Ch > *where, xml_node< Ch > *child); -

Description

Inserts a new child node at specified place inside the node. All children after and including the specified node are moved one position back.

Parameters

where
Place where to insert the child, or 0 to insert at the back.
child
Node to insert.

function xml_node::remove_first_node

Synopsis

void remove_first_node(); -

Description

Removes first child node. If node has no children, behaviour is undefined. Use first_node() to test if node has children.

function xml_node::remove_last_node

Synopsis

void remove_last_node(); -

Description

Removes last child of the node. If node has no children, behaviour is undefined. Use first_node() to test if node has children.

function xml_node::remove_node

Synopsis

void remove_node(xml_node< Ch > *where); -

Description

Removes specified child from the node.

function xml_node::remove_all_nodes

Synopsis

void remove_all_nodes(); -

Description

Removes all child nodes (but not attributes).

function xml_node::prepend_attribute

Synopsis

void prepend_attribute(xml_attribute< Ch > *attribute); -

Description

Prepends a new attribute to the node.

Parameters

attribute
Attribute to prepend.

function xml_node::append_attribute

Synopsis

void append_attribute(xml_attribute< Ch > *attribute); -

Description

Appends a new attribute to the node.

Parameters

attribute
Attribute to append.

function xml_node::insert_attribute

Synopsis

void insert_attribute(xml_attribute< Ch > *where, xml_attribute< Ch > *attribute); -

Description

Inserts a new attribute at specified place inside the node. All attributes after and including the specified attribute are moved one position back.

Parameters

where
Place where to insert the attribute, or 0 to insert at the back.
attribute
Attribute to insert.

function xml_node::remove_first_attribute

Synopsis

void remove_first_attribute(); -

Description

Removes first attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes.

function xml_node::remove_last_attribute

Synopsis

void remove_last_attribute(); -

Description

Removes last attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes.

function xml_node::remove_attribute

Synopsis

void remove_attribute(xml_attribute< Ch > *where); -

Description

Removes specified attribute from node.

Parameters

where
Pointer to attribute to be removed.

function xml_node::remove_all_attributes

Synopsis

void remove_all_attributes(); -

Description

Removes all attributes of node.

enum node_type

Description

Enumeration listing all node types produced by the parser. Use xml_node::type() function to query node type.

Values

node_document
A document node. Name and value are empty.
node_element
An element node. Name contains element name. Value contains text of first data node.
node_data
A data node. Name is empty. Value contains data text.
node_cdata
A CDATA node. Name is empty. Value contains data text.
node_comment
A comment node. Name is empty. Value contains comment text.
node_declaration
A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes.
node_doctype
A DOCTYPE node. Name is empty. Value contains DOCTYPE text.
node_pi
A PI node. Name contains target. Value contains instructions.

function parse_error_handler

Synopsis

void rapidxml::parse_error_handler(const char *what, void *where); -

Description

When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function is called to notify user about the error. It must be defined by the user.

- This function cannot return. If it does, the results are undefined.

- A very simple definition might look like that: - void rapidxml::parse_error_handler(const char *what, void *where) - { - std::cout << "Parse error: " << what << "\n"; - std::abort(); - } -

Parameters

what
Human readable description of the error.
where
Pointer to character data where error was detected.

function print

Synopsis

OutIt rapidxml::print(OutIt out, const xml_node< Ch > &node, int flags=0); -

Description

Prints XML to given output iterator.

Parameters

out
Output iterator to print to.
node
Node to be printed. Pass xml_document to print entire document.
flags
Flags controlling how XML is printed.

Returns

Output iterator pointing to position immediately after last character of printed text.

function print

Synopsis

std::basic_ostream<Ch>& rapidxml::print(std::basic_ostream< Ch > &out, const xml_node< Ch > &node, int flags=0); -

Description

Prints XML to given output stream.

Parameters

out
Output stream to print to.
node
Node to be printed. Pass xml_document to print entire document.
flags
Flags controlling how XML is printed.

Returns

Output stream.

function operator<<

Synopsis

std::basic_ostream<Ch>& rapidxml::operator<<(std::basic_ostream< Ch > &out, const xml_node< Ch > &node); -

Description

Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process.

Parameters

out
Output stream to print to.
node
Node to be printed.

Returns

Output stream.

- constant - parse_no_data_nodes

Synopsis

const int parse_no_data_nodes - = 0x1; -

Description

Parse flag instructing the parser to not create data nodes. Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_no_element_values

Synopsis

const int parse_no_element_values - = 0x2; -

Description

Parse flag instructing the parser to not use text of first data node as a value of parent element. Can be combined with other flags by use of | operator. Note that child data nodes of element node take precendence over its value when printing. That is, if element has one or more child data nodes and a value, the value will be ignored. Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements.

- See xml_document::parse() function.

- constant - parse_no_string_terminators

Synopsis

const int parse_no_string_terminators - = 0x4; -

Description

Parse flag instructing the parser to not place zero terminators after strings in the source text. By default zero terminators are placed, modifying source text. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_no_entity_translation

Synopsis

const int parse_no_entity_translation - = 0x8; -

Description

Parse flag instructing the parser to not translate entities in the source text. By default entities are translated, modifying source text. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_no_utf8

Synopsis

const int parse_no_utf8 - = 0x10; -

Description

Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. By default, UTF-8 handling is enabled. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_declaration_node

Synopsis

const int parse_declaration_node - = 0x20; -

Description

Parse flag instructing the parser to create XML declaration node. By default, declaration node is not created. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_comment_nodes

Synopsis

const int parse_comment_nodes - = 0x40; -

Description

Parse flag instructing the parser to create comments nodes. By default, comment nodes are not created. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_doctype_node

Synopsis

const int parse_doctype_node - = 0x80; -

Description

Parse flag instructing the parser to create DOCTYPE node. By default, doctype node is not created. Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_pi_nodes

Synopsis

const int parse_pi_nodes - = 0x100; -

Description

Parse flag instructing the parser to create PI nodes. By default, PI nodes are not created. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_validate_closing_tags

Synopsis

const int parse_validate_closing_tags - = 0x200; -

Description

Parse flag instructing the parser to validate closing tag names. If not set, name inside closing tag is irrelevant to the parser. By default, closing tags are not validated. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_trim_whitespace

Synopsis

const int parse_trim_whitespace - = 0x400; -

Description

Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. By default, whitespace is not trimmed. This flag does not cause the parser to modify source text. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_normalize_whitespace

Synopsis

const int parse_normalize_whitespace - = 0x800; -

Description

Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. By default, whitespace is not normalized. If this flag is specified, source text will be modified. Can be combined with other flags by use of | operator.

- See xml_document::parse() function.

- constant - parse_default

Synopsis

const int parse_default - = 0; -

Description

Parse flags which represent default behaviour of the parser. This is always equal to 0, so that all other flags can be simply ored together. Normally there is no need to inconveniently disable flags by anding with their negated (~) values. This also means that meaning of each flag is a negation of the default setting. For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, and using the flag will disable it.

- See xml_document::parse() function.

- constant - parse_non_destructive

Synopsis

const int parse_non_destructive - = parse_no_string_terminators | parse_no_entity_translation; -

Description

A combination of parse flags that forbids any modifications of the source text. This also results in faster parsing. However, note that the following will occur:
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • entities will not be translated
  • whitespace will not be normalized
-See xml_document::parse() function.

- constant - parse_fastest

Synopsis

const int parse_fastest - = parse_non_destructive | parse_no_data_nodes; -

Description

A combination of parse flags resulting in fastest possible parsing, without sacrificing important data.

- See xml_document::parse() function.

- constant - parse_full

Synopsis

const int parse_full - = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; -

Description

A combination of parse flags resulting in largest amount of data being extracted. This usually results in slowest parsing.

- See xml_document::parse() function.

- constant - print_no_indenting

Synopsis

const int print_no_indenting - = 0x1; -

Description

Printer flag instructing the printer to suppress indenting of XML. See print() function.

\ No newline at end of file diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp deleted file mode 100644 index d82893a63..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml.hpp +++ /dev/null @@ -1,2624 +0,0 @@ -#ifndef CEREAL_RAPIDXML_HPP_INCLUDED -#define CEREAL_RAPIDXML_HPP_INCLUDED - -// Copyright (C) 2006, 2009 Marcin Kalicinski -// Version 1.13 -// Revision $DateTime: 2009/05/13 01:46:17 $ - -// If standard library is disabled, user must provide implementations of required functions and typedefs -#if !defined(CEREAL_RAPIDXML_NO_STDLIB) - #include // For std::size_t - #include // For assert - #include // For placement new -#endif - -// On MSVC, disable "conditional expression is constant" warning (level 4). -// This warning is almost impossible to avoid with certain types of templated code -#ifdef _MSC_VER - #pragma warning(push) - #pragma warning(disable:4127) // Conditional expression is constant - #pragma warning(disable:4100) // unreferenced formal parameter -#endif - -/////////////////////////////////////////////////////////////////////////// -// CEREAL_RAPIDXML_PARSE_ERROR - -#if defined(CEREAL_RAPIDXML_NO_EXCEPTIONS) - -#define CEREAL_RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } - -namespace cereal { -namespace rapidxml -{ - //! When exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, - //! this function is called to notify user about the error. - //! It must be defined by the user. - //!

- //! This function cannot return. If it does, the results are undefined. - //!

- //! A very simple definition might look like that: - //!

-    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
-    //! {
-    //!     std::cout << "Parse error: " << what << "\n";
-    //!     std::abort();
-    //! }
-    //! 
- //! \param what Human readable description of the error. - //! \param where Pointer to character data where error was detected. - void parse_error_handler(const char *what, void *where); -} -} // end namespace cereal - -#else - -#include // For std::exception - -#define CEREAL_RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) - -namespace cereal { -namespace rapidxml -{ - - //! Parse error exception. - //! This exception is thrown by the parser when an error occurs. - //! Use what() function to get human-readable error message. - //! Use where() function to get a pointer to position within source text where error was detected. - //!

- //! If throwing exceptions by the parser is undesirable, - //! it can be disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. - //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. - //! This function must be defined by the user. - //!

- //! This class derives from std::exception class. - class parse_error: public std::exception - { - - public: - - //! Constructs parse error - parse_error(const char *what_, void *where_) - : m_what(what_) - , m_where(where_) - { - } - - //! Gets human readable description of error. - //! \return Pointer to null terminated description of the error. - virtual const char *what() const CEREAL_NOEXCEPT override - { - return m_what; - } - - //! Gets pointer to character data where error happened. - //! Ch should be the same as char type of xml_document that produced the error. - //! \return Pointer to location within the parsed string where error occured. - template - Ch *where() const - { - return reinterpret_cast(m_where); - } - - private: - - const char *m_what; - void *m_where; - - }; -} -} // end namespace cereal - -#endif - -/////////////////////////////////////////////////////////////////////////// -// Pool sizes - -#ifndef CEREAL_RAPIDXML_STATIC_POOL_SIZE - // Size of static memory block of memory_pool. - // Define CEREAL_RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. - // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. - #define CEREAL_RAPIDXML_STATIC_POOL_SIZE (64 * 1024) -#endif - -#ifndef CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE - // Size of dynamic memory block of memory_pool. - // Define CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. - // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. - #define CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) -#endif - -#ifndef CEREAL_RAPIDXML_ALIGNMENT - // Memory allocation alignment. - // Define CEREAL_RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. - // All memory allocations for nodes, attributes and strings will be aligned to this value. - // This must be a power of 2 and at least 1, otherwise memory_pool will not work. - #define CEREAL_RAPIDXML_ALIGNMENT sizeof(void *) -#endif - -namespace cereal { -namespace rapidxml -{ - // Forward declarations - template class xml_node; - template class xml_attribute; - template class xml_document; - - //! Enumeration listing all node types produced by the parser. - //! Use xml_node::type() function to query node type. - enum node_type - { - node_document, //!< A document node. Name and value are empty. - node_element, //!< An element node. Name contains element name. Value contains text of first data node. - node_data, //!< A data node. Name is empty. Value contains data text. - node_cdata, //!< A CDATA node. Name is empty. Value contains data text. - node_comment, //!< A comment node. Name is empty. Value contains comment text. - node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. - node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. - node_pi //!< A PI node. Name contains target. Value contains instructions. - }; - - /////////////////////////////////////////////////////////////////////// - // Parsing flags - - //! Parse flag instructing the parser to not create data nodes. - //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_no_data_nodes = 0x1; - - //! Parse flag instructing the parser to not use text of first data node as a value of parent element. - //! Can be combined with other flags by use of | operator. - //! Note that child data nodes of element node take precendence over its value when printing. - //! That is, if element has one or more child data nodes and a value, the value will be ignored. - //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. - //!

- //! See xml_document::parse() function. - const int parse_no_element_values = 0x2; - - //! Parse flag instructing the parser to not place zero terminators after strings in the source text. - //! By default zero terminators are placed, modifying source text. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_no_string_terminators = 0x4; - - //! Parse flag instructing the parser to not translate entities in the source text. - //! By default entities are translated, modifying source text. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_no_entity_translation = 0x8; - - //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. - //! By default, UTF-8 handling is enabled. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_no_utf8 = 0x10; - - //! Parse flag instructing the parser to create XML declaration node. - //! By default, declaration node is not created. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_declaration_node = 0x20; - - //! Parse flag instructing the parser to create comments nodes. - //! By default, comment nodes are not created. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_comment_nodes = 0x40; - - //! Parse flag instructing the parser to create DOCTYPE node. - //! By default, doctype node is not created. - //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_doctype_node = 0x80; - - //! Parse flag instructing the parser to create PI nodes. - //! By default, PI nodes are not created. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_pi_nodes = 0x100; - - //! Parse flag instructing the parser to validate closing tag names. - //! If not set, name inside closing tag is irrelevant to the parser. - //! By default, closing tags are not validated. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_validate_closing_tags = 0x200; - - //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. - //! By default, whitespace is not trimmed. - //! This flag does not cause the parser to modify source text. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_trim_whitespace = 0x400; - - //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. - //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. - //! By default, whitespace is not normalized. - //! If this flag is specified, source text will be modified. - //! Can be combined with other flags by use of | operator. - //!

- //! See xml_document::parse() function. - const int parse_normalize_whitespace = 0x800; - - // Compound flags - - //! Parse flags which represent default behaviour of the parser. - //! This is always equal to 0, so that all other flags can be simply ored together. - //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. - //! This also means that meaning of each flag is a negation of the default setting. - //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, - //! and using the flag will disable it. - //!

- //! See xml_document::parse() function. - const int parse_default = 0; - - //! A combination of parse flags that forbids any modifications of the source text. - //! This also results in faster parsing. However, note that the following will occur: - //!
    - //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • - //!
  • entities will not be translated
  • - //!
  • whitespace will not be normalized
  • - //!
- //! See xml_document::parse() function. - const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; - - //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. - //!

- //! See xml_document::parse() function. - const int parse_fastest = parse_non_destructive | parse_no_data_nodes; - - //! A combination of parse flags resulting in largest amount of data being extracted. - //! This usually results in slowest parsing. - //!

- //! See xml_document::parse() function. - const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; - - /////////////////////////////////////////////////////////////////////// - // Internals - - //! \cond internal - namespace internal - { - - // Struct that contains lookup tables for the parser - // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). - template - struct lookup_tables - { - static const unsigned char lookup_whitespace[256]; // Whitespace table - static const unsigned char lookup_node_name[256]; // Node name table - static const unsigned char lookup_text[256]; // Text table - static const unsigned char lookup_text_pure_no_ws[256]; // Text table - static const unsigned char lookup_text_pure_with_ws[256]; // Text table - static const unsigned char lookup_attribute_name[256]; // Attribute name table - static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote - static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote - static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes - static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes - static const unsigned char lookup_digits[256]; // Digits - static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters - }; - - // Find length of the string - template - inline std::size_t measure(const Ch *p) - { - const Ch *tmp = p; - while (*tmp) - ++tmp; - return static_cast(tmp - p); - } - - // Compare strings for equality - template - inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) - { - if (size1 != size2) - return false; - if (case_sensitive) - { - for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) - if (*p1 != *p2) - return false; - } - else - { - for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) - if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) - return false; - } - return true; - } - - template - inline bool preserve_space(xml_node* node) - { - const Ch preserve_value[] = { Ch('p'), Ch('r'), Ch('e'), Ch('s'), Ch('e'), Ch('r'), Ch('v'), Ch('e') }; - const xml_attribute* space = node->first_attribute("xml:space"); - return space && internal::compare(space->value(), space->value_size(), preserve_value, sizeof(preserve_value) / sizeof(Ch), true); - } - } - //! \endcond - - /////////////////////////////////////////////////////////////////////// - // Memory pool - - //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. - //! In most cases, you will not need to use this class directly. - //! However, if you need to create nodes manually or modify names/values of nodes, - //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. - //! Not only is this faster than allocating them by using new operator, - //! but also their lifetime will be tied to the lifetime of document, - //! possibly simplyfing memory management. - //!

- //! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. - //! You can also call allocate_string() function to allocate strings. - //! Such strings can then be used as names or values of nodes without worrying about their lifetime. - //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, - //! or when the pool is destroyed. - //!

- //! It is also possible to create a standalone memory_pool, and use it - //! to allocate nodes, whose lifetime will not be tied to any document. - //!

- //! Pool maintains CEREAL_RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. - //! Until static memory is exhausted, no dynamic memory allocations are done. - //! When static memory is exhausted, pool allocates additional blocks of memory of size CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE each, - //! by using global new[] and delete[] operators. - //! This behaviour can be changed by setting custom allocation routines. - //! Use set_allocator() function to set them. - //!

- //! Allocations for nodes, attributes and strings are aligned at CEREAL_RAPIDXML_ALIGNMENT bytes. - //! This value defaults to the size of pointer on target architecture. - //!

- //! To obtain absolutely top performance from the parser, - //! it is important that all nodes are allocated from a single, contiguous block of memory. - //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. - //! If required, you can tweak CEREAL_RAPIDXML_STATIC_POOL_SIZE, CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE and CEREAL_RAPIDXML_ALIGNMENT - //! to obtain best wasted memory to performance compromise. - //! To do it, define their values before rapidxml.hpp file is included. - //! \tparam Ch Character type of created nodes. - template - class memory_pool - { - - public: - - //! \cond internal - typedef void *(alloc_func)(std::size_t); // Type of user-defined function used to allocate memory - typedef void (free_func)(void *); // Type of user-defined function used to free memory - //! \endcond - - //! Constructs empty pool with default allocator functions. - memory_pool() - : m_alloc_func(0) - , m_free_func(0) - { - init(); - } - - //! Destroys pool and frees all the memory. - //! This causes memory occupied by nodes allocated by the pool to be freed. - //! Nodes allocated from the pool are no longer valid. - ~memory_pool() - { - clear(); - } - - //! Allocates a new node from the pool, and optionally assigns name and value to it. - //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. - //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function - //! will call rapidxml::parse_error_handler() function. - //! \param type Type of node to create. - //! \param name Name to assign to the node, or 0 to assign no name. - //! \param value Value to assign to the node, or 0 to assign no value. - //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. - //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. - //! \return Pointer to allocated node. This pointer will never be NULL. - xml_node *allocate_node(node_type type, - const Ch *name = 0, const Ch *value = 0, - std::size_t name_size = 0, std::size_t value_size = 0) - { - void *memory = allocate_aligned(sizeof(xml_node)); - xml_node *node = new(memory) xml_node(type); - if (name) - { - if (name_size > 0) - node->name(name, name_size); - else - node->name(name); - } - if (value) - { - if (value_size > 0) - node->value(value, value_size); - else - node->value(value); - } - return node; - } - - //! Allocates a new attribute from the pool, and optionally assigns name and value to it. - //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. - //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function - //! will call rapidxml::parse_error_handler() function. - //! \param name Name to assign to the attribute, or 0 to assign no name. - //! \param value Value to assign to the attribute, or 0 to assign no value. - //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. - //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. - //! \return Pointer to allocated attribute. This pointer will never be NULL. - xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, - std::size_t name_size = 0, std::size_t value_size = 0) - { - void *memory = allocate_aligned(sizeof(xml_attribute)); - xml_attribute *attribute = new(memory) xml_attribute; - if (name) - { - if (name_size > 0) - attribute->name(name, name_size); - else - attribute->name(name); - } - if (value) - { - if (value_size > 0) - attribute->value(value, value_size); - else - attribute->value(value); - } - return attribute; - } - - //! Allocates a char array of given size from the pool, and optionally copies a given string to it. - //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. - //! If exceptions are disabled by defining CEREAL_RAPIDXML_NO_EXCEPTIONS, this function - //! will call rapidxml::parse_error_handler() function. - //! \param source String to initialize the allocated memory with, or 0 to not initialize it. - //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. - //! \return Pointer to allocated char array. This pointer will never be NULL. - Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) - { - assert(source || size); // Either source or size (or both) must be specified - if (size == 0) - size = internal::measure(source) + 1; - Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); - if (source) - for (std::size_t i = 0; i < size; ++i) - result[i] = source[i]; - return result; - } - - //! Clones an xml_node and its hierarchy of child nodes and attributes. - //! Nodes and attributes are allocated from this memory pool. - //! Names and values are not cloned, they are shared between the clone and the source. - //! Result node can be optionally specified as a second parameter, - //! in which case its contents will be replaced with cloned source node. - //! This is useful when you want to clone entire document. - //! \param source Node to clone. - //! \param result Node to put results in, or 0 to automatically allocate result node - //! \return Pointer to cloned node. This pointer will never be NULL. - xml_node *clone_node(const xml_node *source, xml_node *result = 0) - { - // Prepare result node - if (result) - { - result->remove_all_attributes(); - result->remove_all_nodes(); - result->type(source->type()); - } - else - result = allocate_node(source->type()); - - // Clone name and value - result->name(source->name(), source->name_size()); - result->value(source->value(), source->value_size()); - - // Clone child nodes and attributes - for (xml_node *child = source->first_node(); child; child = child->next_sibling()) - result->append_node(clone_node(child)); - for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) - result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); - - return result; - } - - //! Clears the pool. - //! This causes memory occupied by nodes allocated by the pool to be freed. - //! Any nodes or strings allocated from the pool will no longer be valid. - void clear() - { - while (m_begin != m_static_memory) - { - char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; - if (m_free_func) - m_free_func(m_begin); - else - delete[] m_begin; - m_begin = previous_begin; - } - init(); - } - - //! Sets or resets the user-defined memory allocation functions for the pool. - //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. - //! Allocation function must not return invalid pointer on failure. It should either throw, - //! stop the program, or use longjmp() function to pass control to other place of program. - //! If it returns invalid pointer, results are undefined. - //!

- //! User defined allocation functions must have the following forms: - //!
- //!
void *allocate(std::size_t size); - //!
void free(void *pointer); - //!

- //! \param af Allocation function, or 0 to restore default function - //! \param ff Free function, or 0 to restore default function - void set_allocator(alloc_func *af, free_func *ff) - { - assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet - m_alloc_func = af; - m_free_func = ff; - } - - private: - - struct header - { - char *previous_begin; - }; - - void init() - { - m_begin = m_static_memory; - m_ptr = align(m_begin); - m_end = m_static_memory + sizeof(m_static_memory); - } - - char *align(char *ptr) - { - std::size_t alignment = ((CEREAL_RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (CEREAL_RAPIDXML_ALIGNMENT - 1))) & (CEREAL_RAPIDXML_ALIGNMENT - 1)); - return ptr + alignment; - } - - char *allocate_raw(std::size_t size) - { - // Allocate - void *memory; - if (m_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] - { - memory = m_alloc_func(size); - assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp - } - else - { - memory = new char[size]; -#ifdef CEREAL_RAPIDXML_NO_EXCEPTIONS - if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc - CEREAL_RAPIDXML_PARSE_ERROR("out of memory", 0); -#endif - } - return static_cast(memory); - } - - void *allocate_aligned(std::size_t size) - { - // Calculate aligned pointer - char *result = align(m_ptr); - - // If not enough memory left in current pool, allocate a new pool - if (result + size > m_end) - { - // Calculate required pool size (may be bigger than CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE) - std::size_t pool_size = CEREAL_RAPIDXML_DYNAMIC_POOL_SIZE; - if (pool_size < size) - pool_size = size; - - // Allocate - std::size_t alloc_size = sizeof(header) + (2 * CEREAL_RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation - char *raw_memory = allocate_raw(alloc_size); - - // Setup new pool in allocated memory - char *pool = align(raw_memory); - header *new_header = reinterpret_cast
(pool); - new_header->previous_begin = m_begin; - m_begin = raw_memory; - m_ptr = pool + sizeof(header); - m_end = raw_memory + alloc_size; - - // Calculate aligned pointer again using new pool - result = align(m_ptr); - } - - // Update pool and return aligned pointer - m_ptr = result + size; - return result; - } - - char *m_begin; // Start of raw memory making up current pool - char *m_ptr; // First free byte in current pool - char *m_end; // One past last available byte in current pool - char m_static_memory[CEREAL_RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory - alloc_func *m_alloc_func; // Allocator function, or 0 if default is to be used - free_func *m_free_func; // Free function, or 0 if default is to be used - }; - - /////////////////////////////////////////////////////////////////////////// - // XML base - - //! Base class for xml_node and xml_attribute implementing common functions: - //! name(), name_size(), value(), value_size() and parent(). - //! \tparam Ch Character type to use - template - class xml_base - { - - public: - - /////////////////////////////////////////////////////////////////////////// - // Construction & destruction - - // Construct a base with empty name, value and parent - xml_base() - : m_name(0) - , m_value(0) - , m_parent(0) - { - } - - /////////////////////////////////////////////////////////////////////////// - // Node data access - - //! Gets name of the node. - //! Interpretation of name depends on type of node. - //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. - //!

- //! Use name_size() function to determine length of the name. - //! \return Name of node, or empty string if node has no name. - Ch *name() const - { - return m_name ? m_name : nullstr(); - } - - //! Gets size of node name, not including terminator character. - //! This function works correctly irrespective of whether name is or is not zero terminated. - //! \return Size of node name, in characters. - std::size_t name_size() const - { - return m_name ? m_name_size : 0; - } - - //! Gets value of node. - //! Interpretation of value depends on type of node. - //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. - //!

- //! Use value_size() function to determine length of the value. - //! \return Value of node, or empty string if node has no value. - Ch *value() const - { - return m_value ? m_value : nullstr(); - } - - //! Gets size of node value, not including terminator character. - //! This function works correctly irrespective of whether value is or is not zero terminated. - //! \return Size of node value, in characters. - std::size_t value_size() const - { - return m_value ? m_value_size : 0; - } - - /////////////////////////////////////////////////////////////////////////// - // Node modification - - //! Sets name of node to a non zero-terminated string. - //! See \ref ownership_of_strings. - //!

- //! Note that node does not own its name or value, it only stores a pointer to it. - //! It will not delete or otherwise free the pointer on destruction. - //! It is reponsibility of the user to properly manage lifetime of the string. - //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - - //! on destruction of the document the string will be automatically freed. - //!

- //! Size of name must be specified separately, because name does not have to be zero terminated. - //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). - //! \param name_ Name of node to set. Does not have to be zero terminated. - //! \param size Size of name, in characters. This does not include zero terminator, if one is present. - void name(const Ch *name_, std::size_t size) - { - m_name = const_cast(name_); - m_name_size = size; - } - - //! Sets name of node to a zero-terminated string. - //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). - //! \param name_ Name of node to set. Must be zero terminated. - void name(const Ch *name_) - { - this->name(name_, internal::measure(name_)); - } - - //! Sets value of node to a non zero-terminated string. - //! See \ref ownership_of_strings. - //!

- //! Note that node does not own its name or value, it only stores a pointer to it. - //! It will not delete or otherwise free the pointer on destruction. - //! It is reponsibility of the user to properly manage lifetime of the string. - //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - - //! on destruction of the document the string will be automatically freed. - //!

- //! Size of value must be specified separately, because it does not have to be zero terminated. - //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). - //!

- //! If an element has a child node of type node_data, it will take precedence over element value when printing. - //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. - //! \param value_ value of node to set. Does not have to be zero terminated. - //! \param size Size of value, in characters. This does not include zero terminator, if one is present. - void value(const Ch *value_, std::size_t size) - { - m_value = const_cast(value_); - m_value_size = size; - } - - //! Sets value of node to a zero-terminated string. - //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). - //! \param value_ Vame of node to set. Must be zero terminated. - void value(const Ch *value_) - { - this->value(value_, internal::measure(value_)); - } - - /////////////////////////////////////////////////////////////////////////// - // Related nodes access - - //! Gets node parent. - //! \return Pointer to parent node, or 0 if there is no parent. - xml_node *parent() const - { - return m_parent; - } - - protected: - - // Return empty string - static Ch *nullstr() - { - static Ch zero = Ch('\0'); - return &zero; - } - - Ch *m_name; // Name of node, or 0 if no name - Ch *m_value; // Value of node, or 0 if no value - std::size_t m_name_size; // Length of node name, or undefined of no name - std::size_t m_value_size; // Length of node value, or undefined if no value - xml_node *m_parent; // Pointer to parent node, or 0 if none - - }; - - //! Class representing attribute node of XML document. - //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). - //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. - //! Thus, this text must persist in memory for the lifetime of attribute. - //! \tparam Ch Character type to use. - template - class xml_attribute: public xml_base - { - - friend class xml_node; - - public: - - /////////////////////////////////////////////////////////////////////////// - // Construction & destruction - - //! Constructs an empty attribute with the specified type. - //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. - xml_attribute() - { - } - - /////////////////////////////////////////////////////////////////////////// - // Related nodes access - - //! Gets document of which attribute is a child. - //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. - xml_document *document() const - { - if (xml_node *node = this->parent()) - { - while (node->parent()) - node = node->parent(); - return node->type() == node_document ? static_cast *>(node) : 0; - } - else - return 0; - } - - //! Gets previous attribute, optionally matching attribute name. - //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found attribute, or 0 if not found. - xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const - { - if (name) - { - if (name_size == 0) - name_size = internal::measure(name); - for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) - if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) - return attribute; - return 0; - } - else - return this->m_parent ? m_prev_attribute : 0; - } - - //! Gets next attribute, optionally matching attribute name. - //! \param name_ Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found attribute, or 0 if not found. - xml_attribute *next_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const - { - if (name_) - { - if (name_size_ == 0) - name_size_ = internal::measure(name_); - for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) - if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive)) - return attribute; - return 0; - } - else - return this->m_parent ? m_next_attribute : 0; - } - - private: - - xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero - xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero - - }; - - /////////////////////////////////////////////////////////////////////////// - // XML node - - //! Class representing a node of XML document. - //! Each node may have associated name and value strings, which are available through name() and value() functions. - //! Interpretation of name and value depends on type of the node. - //! Type of node can be determined by using type() function. - //!

- //! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. - //! Thus, this text must persist in the memory for the lifetime of node. - //! \tparam Ch Character type to use. - template - class xml_node: public xml_base - { - - public: - - /////////////////////////////////////////////////////////////////////////// - // Construction & destruction - - //! Constructs an empty node with the specified type. - //! Consider using memory_pool of appropriate document to allocate nodes manually. - //! \param type_ Type of node to construct. - xml_node(node_type type_) - : m_type(type_) - , m_first_node(0) - , m_first_attribute(0) - { - } - - /////////////////////////////////////////////////////////////////////////// - // Node data access - - //! Gets type of node. - //! \return Type of node. - node_type type() const - { - return m_type; - } - - /////////////////////////////////////////////////////////////////////////// - // Related nodes access - - //! Gets document of which node is a child. - //! \return Pointer to document that contains this node, or 0 if there is no parent document. - xml_document *document() const - { - xml_node *node = const_cast *>(this); - while (node->parent()) - node = node->parent(); - return node->type() == node_document ? static_cast *>(node) : 0; - } - - //! Gets first child node, optionally matching node name. - //! \param name_ Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found child, or 0 if not found. - xml_node *first_node(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const - { - if (name_) - { - if (name_size_ == 0) - name_size_ = internal::measure(name_); - for (xml_node *child = m_first_node; child; child = child->next_sibling()) - if (internal::compare(child->name(), child->name_size(), name_, name_size_, case_sensitive)) - return child; - return 0; - } - else - return m_first_node; - } - - //! Gets last child node, optionally matching node name. - //! Behaviour is undefined if node has no children. - //! Use first_node() to test if node has children. - //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found child, or 0 if not found. - xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const - { - assert(m_first_node); // Cannot query for last child if node has no children - if (name) - { - if (name_size == 0) - name_size = internal::measure(name); - for (xml_node *child = m_last_node; child; child = child->previous_sibling()) - if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) - return child; - return 0; - } - else - return m_last_node; - } - - //! Gets previous sibling node, optionally matching node name. - //! Behaviour is undefined if node has no parent. - //! Use parent() to test if node has a parent. - //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found sibling, or 0 if not found. - xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const - { - assert(this->m_parent); // Cannot query for siblings if node has no parent - if (name) - { - if (name_size == 0) - name_size = internal::measure(name); - for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) - if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) - return sibling; - return 0; - } - else - return m_prev_sibling; - } - - //! Gets next sibling node, optionally matching node name. - //! Behaviour is undefined if node has no parent. - //! Use parent() to test if node has a parent. - //! \param name_ Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found sibling, or 0 if not found. - xml_node *next_sibling(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const - { - assert(this->m_parent); // Cannot query for siblings if node has no parent - if (name_) - { - if (name_size_ == 0) - name_size_ = internal::measure(name_); - for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) - if (internal::compare(sibling->name(), sibling->name_size(), name_, name_size_, case_sensitive)) - return sibling; - return 0; - } - else - return m_next_sibling; - } - - //! Gets first attribute of node, optionally matching attribute name. - //! \param name_ Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size_ Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found attribute, or 0 if not found. - xml_attribute *first_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const - { - if (name_) - { - if (name_size_ == 0) - name_size_ = internal::measure(name_); - for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) - if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive)) - return attribute; - return 0; - } - else - return m_first_attribute; - } - - //! Gets last attribute of node, optionally matching attribute name. - //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero - //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string - //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters - //! \return Pointer to found attribute, or 0 if not found. - xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const - { - if (name) - { - if (name_size == 0) - name_size = internal::measure(name); - for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) - if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) - return attribute; - return 0; - } - else - return m_first_attribute ? m_last_attribute : 0; - } - - /////////////////////////////////////////////////////////////////////////// - // Node modification - - //! Sets type of node. - //! \param type_ Type of node to set. - void type(node_type type_) - { - m_type = type_; - } - - /////////////////////////////////////////////////////////////////////////// - // Node manipulation - - //! Prepends a new child node. - //! The prepended child becomes the first child, and all existing children are moved one position back. - //! \param child Node to prepend. - void prepend_node(xml_node *child) - { - assert(child && !child->parent() && child->type() != node_document); - if (first_node()) - { - child->m_next_sibling = m_first_node; - m_first_node->m_prev_sibling = child; - } - else - { - child->m_next_sibling = 0; - m_last_node = child; - } - m_first_node = child; - child->m_parent = this; - child->m_prev_sibling = 0; - } - - //! Appends a new child node. - //! The appended child becomes the last child. - //! \param child Node to append. - void append_node(xml_node *child) - { - assert(child && !child->parent() && child->type() != node_document); - if (first_node()) - { - child->m_prev_sibling = m_last_node; - m_last_node->m_next_sibling = child; - } - else - { - child->m_prev_sibling = 0; - m_first_node = child; - } - m_last_node = child; - child->m_parent = this; - child->m_next_sibling = 0; - } - - //! Inserts a new child node at specified place inside the node. - //! All children after and including the specified node are moved one position back. - //! \param where Place where to insert the child, or 0 to insert at the back. - //! \param child Node to insert. - void insert_node(xml_node *where, xml_node *child) - { - assert(!where || where->parent() == this); - assert(child && !child->parent() && child->type() != node_document); - if (where == m_first_node) - prepend_node(child); - else if (where == 0) - append_node(child); - else - { - child->m_prev_sibling = where->m_prev_sibling; - child->m_next_sibling = where; - where->m_prev_sibling->m_next_sibling = child; - where->m_prev_sibling = child; - child->m_parent = this; - } - } - - //! Removes first child node. - //! If node has no children, behaviour is undefined. - //! Use first_node() to test if node has children. - void remove_first_node() - { - assert(first_node()); - xml_node *child = m_first_node; - m_first_node = child->m_next_sibling; - if (child->m_next_sibling) - child->m_next_sibling->m_prev_sibling = 0; - else - m_last_node = 0; - child->m_parent = 0; - } - - //! Removes last child of the node. - //! If node has no children, behaviour is undefined. - //! Use first_node() to test if node has children. - void remove_last_node() - { - assert(first_node()); - xml_node *child = m_last_node; - if (child->m_prev_sibling) - { - m_last_node = child->m_prev_sibling; - child->m_prev_sibling->m_next_sibling = 0; - } - else - m_first_node = 0; - child->m_parent = 0; - } - - //! Removes specified child from the node - // \param where Pointer to child to be removed. - void remove_node(xml_node *where) - { - assert(where && where->parent() == this); - assert(first_node()); - if (where == m_first_node) - remove_first_node(); - else if (where == m_last_node) - remove_last_node(); - else - { - where->m_prev_sibling->m_next_sibling = where->m_next_sibling; - where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; - where->m_parent = 0; - } - } - - //! Removes all child nodes (but not attributes). - void remove_all_nodes() - { - for (xml_node *node = first_node(); node; node = node->m_next_sibling) - node->m_parent = 0; - m_first_node = 0; - } - - //! Prepends a new attribute to the node. - //! \param attribute Attribute to prepend. - void prepend_attribute(xml_attribute *attribute) - { - assert(attribute && !attribute->parent()); - if (first_attribute()) - { - attribute->m_next_attribute = m_first_attribute; - m_first_attribute->m_prev_attribute = attribute; - } - else - { - attribute->m_next_attribute = 0; - m_last_attribute = attribute; - } - m_first_attribute = attribute; - attribute->m_parent = this; - attribute->m_prev_attribute = 0; - } - - //! Appends a new attribute to the node. - //! \param attribute Attribute to append. - void append_attribute(xml_attribute *attribute) - { - assert(attribute && !attribute->parent()); - if (first_attribute()) - { - attribute->m_prev_attribute = m_last_attribute; - m_last_attribute->m_next_attribute = attribute; - } - else - { - attribute->m_prev_attribute = 0; - m_first_attribute = attribute; - } - m_last_attribute = attribute; - attribute->m_parent = this; - attribute->m_next_attribute = 0; - } - - //! Inserts a new attribute at specified place inside the node. - //! All attributes after and including the specified attribute are moved one position back. - //! \param where Place where to insert the attribute, or 0 to insert at the back. - //! \param attribute Attribute to insert. - void insert_attribute(xml_attribute *where, xml_attribute *attribute) - { - assert(!where || where->parent() == this); - assert(attribute && !attribute->parent()); - if (where == m_first_attribute) - prepend_attribute(attribute); - else if (where == 0) - append_attribute(attribute); - else - { - attribute->m_prev_attribute = where->m_prev_attribute; - attribute->m_next_attribute = where; - where->m_prev_attribute->m_next_attribute = attribute; - where->m_prev_attribute = attribute; - attribute->m_parent = this; - } - } - - //! Removes first attribute of the node. - //! If node has no attributes, behaviour is undefined. - //! Use first_attribute() to test if node has attributes. - void remove_first_attribute() - { - assert(first_attribute()); - xml_attribute *attribute = m_first_attribute; - if (attribute->m_next_attribute) - { - attribute->m_next_attribute->m_prev_attribute = 0; - } - else - m_last_attribute = 0; - attribute->m_parent = 0; - m_first_attribute = attribute->m_next_attribute; - } - - //! Removes last attribute of the node. - //! If node has no attributes, behaviour is undefined. - //! Use first_attribute() to test if node has attributes. - void remove_last_attribute() - { - assert(first_attribute()); - xml_attribute *attribute = m_last_attribute; - if (attribute->m_prev_attribute) - { - attribute->m_prev_attribute->m_next_attribute = 0; - m_last_attribute = attribute->m_prev_attribute; - } - else - m_first_attribute = 0; - attribute->m_parent = 0; - } - - //! Removes specified attribute from node. - //! \param where Pointer to attribute to be removed. - void remove_attribute(xml_attribute *where) - { - assert(first_attribute() && where->parent() == this); - if (where == m_first_attribute) - remove_first_attribute(); - else if (where == m_last_attribute) - remove_last_attribute(); - else - { - where->m_prev_attribute->m_next_attribute = where->m_next_attribute; - where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; - where->m_parent = 0; - } - } - - //! Removes all attributes of node. - void remove_all_attributes() - { - for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) - attribute->m_parent = 0; - m_first_attribute = 0; - } - - private: - - /////////////////////////////////////////////////////////////////////////// - // Restrictions - - // No copying - xml_node(const xml_node &); - void operator =(const xml_node &); - - /////////////////////////////////////////////////////////////////////////// - // Data members - - // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. - // This is required for maximum performance, as it allows the parser to omit initialization of - // unneded/redundant values. - // - // The rules are as follows: - // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively - // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage - // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage - - node_type m_type; // Type of node; always valid - xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid - xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero - xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid - xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero - xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero - xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero - - }; - - /////////////////////////////////////////////////////////////////////////// - // XML document - - //! This class represents root of the DOM hierarchy. - //! It is also an xml_node and a memory_pool through public inheritance. - //! Use parse() function to build a DOM tree from a zero-terminated XML text string. - //! parse() function allocates memory for nodes and attributes by using functions of xml_document, - //! which are inherited from memory_pool. - //! To access root node of the document, use the document itself, as if it was an xml_node. - //! \tparam Ch Character type to use. - template - class xml_document: public xml_node, public memory_pool - { - - public: - - //! Constructs empty XML document - xml_document() - : xml_node(node_document) - { - } - - //! Parses zero-terminated XML string according to given flags. - //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. - //! The string must persist for the lifetime of the document. - //! In case of error, rapidxml::parse_error exception will be thrown. - //!

- //! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. - //! Make sure that data is zero-terminated. - //!

- //! Document can be parsed into multiple times. - //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. - //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. - template - void parse(Ch *text) - { - assert(text); - - // Remove current contents - this->remove_all_nodes(); - this->remove_all_attributes(); - - // Parse BOM, if any - parse_bom(text); - - // Parse children - while (1) - { - // Skip whitespace before node - skip(text); - if (*text == 0) - break; - - // Parse and append new child - if (*text == Ch('<')) - { - ++text; // Skip '<' - if (xml_node *node = parse_node(text)) - this->append_node(node); - } - else - CEREAL_RAPIDXML_PARSE_ERROR("expected <", text); - } - - } - - //! Clears the document by deleting all nodes and clearing the memory pool. - //! All nodes owned by document pool are destroyed. - void clear() - { - this->remove_all_nodes(); - this->remove_all_attributes(); - memory_pool::clear(); - } - - private: - - /////////////////////////////////////////////////////////////////////// - // Internal character utility functions - - // Detect whitespace character - struct whitespace_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; - } - }; - - // Detect node name character - struct node_name_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; - } - }; - - // Detect attribute name character - struct attribute_name_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; - } - }; - - // Detect text character (PCDATA) - struct text_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; - } - }; - - // Detect text character (PCDATA) that does not require processing - struct text_pure_no_ws_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; - } - }; - - // Detect text character (PCDATA) that does not require processing - struct text_pure_with_ws_pred - { - static unsigned char test(Ch ch) - { - return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; - } - }; - - // Detect attribute value character - template - struct attribute_value_pred - { - static unsigned char test(Ch ch) - { - if (Quote == Ch('\'')) - return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; - if (Quote == Ch('\"')) - return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; - return 0; // Should never be executed, to avoid warnings on Comeau - } - }; - - // Detect attribute value character - template - struct attribute_value_pure_pred - { - static unsigned char test(Ch ch) - { - if (Quote == Ch('\'')) - return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; - if (Quote == Ch('\"')) - return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; - return 0; // Should never be executed, to avoid warnings on Comeau - } - }; - - // Insert coded character, using UTF8 or 8-bit ASCII - template - static void insert_coded_character(Ch *&text, unsigned long code) - { - if (Flags & parse_no_utf8) - { - // Insert 8-bit ASCII character - // Todo: possibly verify that code is less than 256 and use replacement char otherwise? - text[0] = static_cast(code); - text += 1; - } - else - { - // Insert UTF8 sequence - if (code < 0x80) // 1 byte sequence - { - text[0] = static_cast(code); - text += 1; - } - else if (code < 0x800) // 2 byte sequence - { - text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[0] = static_cast(code | 0xC0); - text += 2; - } - else if (code < 0x10000) // 3 byte sequence - { - text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[0] = static_cast(code | 0xE0); - text += 3; - } - else if (code < 0x110000) // 4 byte sequence - { - text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; - text[0] = static_cast(code | 0xF0); - text += 4; - } - else // Invalid, only codes up to 0x10FFFF are allowed in Unicode - { - CEREAL_RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); - } - } - } - - // Skip characters until predicate evaluates to true - template - static void skip(Ch *&text) - { - Ch *tmp = text; - while (StopPred::test(*tmp)) - ++tmp; - text = tmp; - } - - // Skip characters until predicate evaluates to true while doing the following: - // - replacing XML character entity references with proper characters (' & " < > &#...;) - // - condensing whitespace sequences to single space character - template - static Ch *skip_and_expand_character_refs(Ch *&text, bool preserve_space) - { - // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip - if (Flags & parse_no_entity_translation && - !(Flags & parse_normalize_whitespace) && - !(Flags & parse_trim_whitespace)) - { - skip(text); - return text; - } - - // Use simple skip until first modification is detected - skip(text); - - // Use translation skip - Ch *src = text; - Ch *dest = src; - while (StopPred::test(*src)) - { - // If entity translation is enabled - if (!(Flags & parse_no_entity_translation)) - { - // Test if replacement is needed - if (src[0] == Ch('&')) - { - switch (src[1]) - { - - // & ' - case Ch('a'): - if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) - { - *dest = Ch('&'); - ++dest; - src += 5; - continue; - } - if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) - { - *dest = Ch('\''); - ++dest; - src += 6; - continue; - } - break; - - // " - case Ch('q'): - if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) - { - *dest = Ch('"'); - ++dest; - src += 6; - continue; - } - break; - - // > - case Ch('g'): - if (src[2] == Ch('t') && src[3] == Ch(';')) - { - *dest = Ch('>'); - ++dest; - src += 4; - continue; - } - break; - - // < - case Ch('l'): - if (src[2] == Ch('t') && src[3] == Ch(';')) - { - *dest = Ch('<'); - ++dest; - src += 4; - continue; - } - break; - - // &#...; - assumes ASCII - case Ch('#'): - if (src[2] == Ch('x')) - { - unsigned long code = 0; - src += 3; // Skip &#x - while (1) - { - unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; - if (digit == 0xFF) - break; - code = code * 16 + digit; - ++src; - } - insert_coded_character(dest, code); // Put character in output - } - else - { - unsigned long code = 0; - src += 2; // Skip &# - while (1) - { - unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; - if (digit == 0xFF) - break; - code = code * 10 + digit; - ++src; - } - insert_coded_character(dest, code); // Put character in output - } - if (*src == Ch(';')) - ++src; - else - CEREAL_RAPIDXML_PARSE_ERROR("expected ;", src); - continue; - - // Something else - default: - // Ignore, just copy '&' verbatim - break; - - } - } - } - - // If whitespace condensing is enabled - if ((Flags & parse_normalize_whitespace) && !preserve_space) - { - // Test if condensing is needed - if (whitespace_pred::test(*src)) - { - *dest = Ch(' '); ++dest; // Put single space in dest - ++src; // Skip first whitespace char - // Skip remaining whitespace chars - while (whitespace_pred::test(*src)) - ++src; - continue; - } - } - - // No replacement, only copy character - *dest++ = *src++; - - } - - // Return new end - text = src; - return dest; - - } - - /////////////////////////////////////////////////////////////////////// - // Internal parsing functions - - // Parse BOM, if any - template - void parse_bom(Ch *&text) - { - // UTF-8? - if (static_cast(text[0]) == 0xEF && - static_cast(text[1]) == 0xBB && - static_cast(text[2]) == 0xBF) - { - text += 3; // Skup utf-8 bom - } - } - - // Parse XML declaration ( - xml_node *parse_xml_declaration(Ch *&text) - { - // If parsing of declaration is disabled - if (!(Flags & parse_declaration_node)) - { - // Skip until end of declaration - while (text[0] != Ch('?') || text[1] != Ch('>')) - { - if (!text[0]) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - text += 2; // Skip '?>' - return 0; - } - - // Create declaration - xml_node *declaration = this->allocate_node(node_declaration); - - // Skip whitespace before attributes or ?> - skip(text); - - // Parse declaration attributes - parse_node_attributes(text, declaration); - - // Skip ?> - if (text[0] != Ch('?') || text[1] != Ch('>')) - CEREAL_RAPIDXML_PARSE_ERROR("expected ?>", text); - text += 2; - - return declaration; - } - - // Parse XML comment (' - return 0; // Do not produce comment node - } - - // Remember value start - Ch *value_ = text; - - // Skip until end of comment - while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) - { - if (!text[0]) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - - // Create comment node - xml_node *comment = this->allocate_node(node_comment); - comment->value(value_, static_cast(text - value_)); - - // Place zero terminator after comment value - if (!(Flags & parse_no_string_terminators)) - *text = Ch('\0'); - - text += 3; // Skip '-->' - return comment; - } - - // Parse DOCTYPE - template - xml_node *parse_doctype(Ch *&text) - { - // Remember value start - Ch *value_ = text; - - // Skip to > - while (*text != Ch('>')) - { - // Determine character type - switch (*text) - { - - // If '[' encountered, scan for matching ending ']' using naive algorithm with depth - // This works for all W3C test files except for 2 most wicked - case Ch('['): - { - ++text; // Skip '[' - int depth = 1; - while (depth > 0) - { - switch (*text) - { - case Ch('['): ++depth; break; - case Ch(']'): --depth; break; - case 0: CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - } - ++text; - } - break; - } - - // Error on end of text - case Ch('\0'): - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - - // Other character, skip it - default: - ++text; - - } - } - - // If DOCTYPE nodes enabled - if (Flags & parse_doctype_node) - { - // Create a new doctype node - xml_node *doctype = this->allocate_node(node_doctype); - doctype->value(value_, static_cast(text - value_)); - - // Place zero terminator after value - if (!(Flags & parse_no_string_terminators)) - *text = Ch('\0'); - - text += 1; // skip '>' - return doctype; - } - else - { - text += 1; // skip '>' - return 0; - } - - } - - // Parse PI - template - xml_node *parse_pi(Ch *&text) - { - // If creation of PI nodes is enabled - if (Flags & parse_pi_nodes) - { - // Create pi node - xml_node *pi = this->allocate_node(node_pi); - - // Extract PI target name - Ch *name_ = text; - skip(text); - if (text == name_) - CEREAL_RAPIDXML_PARSE_ERROR("expected PI target", text); - pi->name(name_, static_cast(text - name_)); - - // Skip whitespace between pi target and pi - skip(text); - - // Remember start of pi - Ch *value_ = text; - - // Skip to '?>' - while (text[0] != Ch('?') || text[1] != Ch('>')) - { - if (*text == Ch('\0')) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - - // Set pi value (verbatim, no entity expansion or whitespace normalization) - pi->value(value_, static_cast(text - value_)); - - // Place zero terminator after name and value - if (!(Flags & parse_no_string_terminators)) - { - pi->name()[pi->name_size()] = Ch('\0'); - pi->value()[pi->value_size()] = Ch('\0'); - } - - text += 2; // Skip '?>' - return pi; - } - else - { - // Skip to '?>' - while (text[0] != Ch('?') || text[1] != Ch('>')) - { - if (*text == Ch('\0')) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - text += 2; // Skip '?>' - return 0; - } - } - - // Parse and append data - // Return character that ends data. - // This is necessary because this character might have been overwritten by a terminating 0 - template - Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) - { - // Backup to contents start if whitespace trimming is disabled - if (!(Flags & parse_trim_whitespace)) - text = contents_start; - - const bool preserve_space = internal::preserve_space(node); - - // Skip until end of data - Ch *value_ = text, *end; - if ((Flags & parse_normalize_whitespace) && !preserve_space) - end = skip_and_expand_character_refs(text, false); - else - end = skip_and_expand_character_refs(text, preserve_space); - - // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > - if ((Flags & parse_trim_whitespace) && !preserve_space) - { - if (Flags & parse_normalize_whitespace) - { - // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end - if (*(end - 1) == Ch(' ')) - --end; - } - else - { - // Backup until non-whitespace character is found - while (whitespace_pred::test(*(end - 1))) - --end; - } - } - - // If characters are still left between end and value (this test is only necessary if normalization is enabled) - // Create new data node - if (!(Flags & parse_no_data_nodes)) - { - xml_node *data = this->allocate_node(node_data); - data->value(value_, static_cast(end - value_)); - node->append_node(data); - } - - // Add data to parent node if no data exists yet - if (!(Flags & parse_no_element_values)) - if (*node->value() == Ch('\0')) - node->value(value_, static_cast(end - value_)); - - // Place zero terminator after value - if (!(Flags & parse_no_string_terminators)) - { - Ch ch = *text; - *end = Ch('\0'); - return ch; // Return character that ends data; this is required because zero terminator overwritten it - } - - // Return character that ends data - return *text; - } - - // Parse CDATA - template - xml_node *parse_cdata(Ch *&text) - { - // If CDATA is disabled - if (Flags & parse_no_data_nodes) - { - // Skip until end of cdata - while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) - { - if (!text[0]) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - text += 3; // Skip ]]> - return 0; // Do not produce CDATA node - } - - // Skip until end of cdata - Ch *value_ = text; - while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) - { - if (!text[0]) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - - // Create new cdata node - xml_node *cdata = this->allocate_node(node_cdata); - cdata->value(value_, static_cast(text - value_)); - - // Place zero terminator after value - if (!(Flags & parse_no_string_terminators)) - *text = Ch('\0'); - - text += 3; // Skip ]]> - return cdata; - } - - // Parse element node - template - xml_node *parse_element(Ch *&text) - { - // Create element node - xml_node *element = this->allocate_node(node_element); - - // Extract element name - Ch *name_ = text; - skip(text); - if (text == name_) - CEREAL_RAPIDXML_PARSE_ERROR("expected element name", text); - element->name(name_, static_cast(text - name_)); - - // Skip whitespace between element name and attributes or > - skip(text); - - // Parse attributes, if any - parse_node_attributes(text, element); - - // Determine ending type - if (*text == Ch('>')) - { - ++text; - parse_node_contents(text, element); - } - else if (*text == Ch('/')) - { - ++text; - if (*text != Ch('>')) - CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); - ++text; - } - else - CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); - - // Place zero terminator after name - if (!(Flags & parse_no_string_terminators)) - element->name()[element->name_size()] = Ch('\0'); - - // Return parsed element - return element; - } - - // Determine node type, and parse it - template - xml_node *parse_node(Ch *&text) - { - // Parse proper node type - switch (text[0]) - { - - // <... - default: - // Parse and append element node - return parse_element(text); - - // (text); - } - else - { - // Parse PI - return parse_pi(text); - } - - // (text); - } - break; - - // (text); - } - break; - - // (text); - } - - } // switch - - // Attempt to skip other, unrecognized node types starting with ')) - { - if (*text == 0) - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - ++text; - } - ++text; // Skip '>' - return 0; // No node recognized - - } - } - - // Parse contents of the node - children, data etc. - template - void parse_node_contents(Ch *&text, xml_node *node) - { - // For all children and text - while (1) - { - // Skip whitespace between > and node contents - Ch *contents_start = text; // Store start of node contents before whitespace is skipped - skip(text); - Ch next_char = *text; - - // After data nodes, instead of continuing the loop, control jumps here. - // This is because zero termination inside parse_and_append_data() function - // would wreak havoc with the above code. - // Also, skipping whitespace after data nodes is unnecessary. - after_data_node: - - // Determine what comes next: node closing, child node, data node, or 0? - switch (next_char) - { - - // Node closing or child node - case Ch('<'): - if (text[1] == Ch('/')) - { - Ch *contents_end = 0; - if (internal::preserve_space(node)) - { - contents_end = text; - } - - // Node closing - text += 2; // Skip '(text); - if (!internal::compare(node->name(), node->name_size(), closing_name, static_cast(text - closing_name), true)) - CEREAL_RAPIDXML_PARSE_ERROR("invalid closing tag name", text); - } - else - { - // No validation, just skip name - skip(text); - } - // Skip remaining whitespace after node name - skip(text); - if (*text != Ch('>')) - CEREAL_RAPIDXML_PARSE_ERROR("expected >", text); - ++text; // Skip '>' - - if (contents_end && contents_end != contents_start) - { - node->value(contents_start, static_cast(contents_end - contents_start)); - node->value()[node->value_size()] = Ch('\0'); - } - return; // Node closed, finished parsing contents - } - else - { - // Child node - ++text; // Skip '<' - if (xml_node *child = parse_node(text)) - node->append_node(child); - } - break; - - // End of data - error - case Ch('\0'): - CEREAL_RAPIDXML_PARSE_ERROR("unexpected end of data", text); - - // Data node - default: - next_char = parse_and_append_data(node, text, contents_start); - goto after_data_node; // Bypass regular processing after data nodes - - } - } - } - - // Parse XML attributes of the node - template - void parse_node_attributes(Ch *&text, xml_node *node) - { - // For all attributes - while (attribute_name_pred::test(*text)) - { - // Extract attribute name - Ch *name_ = text; - ++text; // Skip first character of attribute name - skip(text); - if (text == name_) - CEREAL_RAPIDXML_PARSE_ERROR("expected attribute name", name_); - - // Create new attribute - xml_attribute *attribute = this->allocate_attribute(); - attribute->name(name_, static_cast(text - name_)); - node->append_attribute(attribute); - - // Skip whitespace after attribute name - skip(text); - - // Skip = - if (*text != Ch('=')) - CEREAL_RAPIDXML_PARSE_ERROR("expected =", text); - ++text; - - // Add terminating zero after name - if (!(Flags & parse_no_string_terminators)) - attribute->name()[attribute->name_size()] = 0; - - // Skip whitespace after = - skip(text); - - // Skip quote and remember if it was ' or " - Ch quote = *text; - if (quote != Ch('\'') && quote != Ch('"')) - CEREAL_RAPIDXML_PARSE_ERROR("expected ' or \"", text); - ++text; - - // Extract attribute value and expand char refs in it - Ch *value_ = text, *end; - const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes - if (quote == Ch('\'')) - end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text, false); - else - end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text, false); - - // Set attribute value - attribute->value(value_, static_cast(end - value_)); - - // Make sure that end quote is present - if (*text != quote) - CEREAL_RAPIDXML_PARSE_ERROR("expected ' or \"", text); - ++text; // Skip quote - - // Add terminating zero after value - if (!(Flags & parse_no_string_terminators)) - attribute->value()[attribute->value_size()] = 0; - - // Skip whitespace after attribute value - skip(text); - } - } - - }; - - //! \cond internal - namespace internal - { - - // Whitespace (space \n \r \t) - template - const unsigned char lookup_tables::lookup_whitespace[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F - }; - - // Node name (anything but space \n \r \t / > ? \0) - template - const unsigned char lookup_tables::lookup_node_name[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Text (i.e. PCDATA) (anything but < \0) - template - const unsigned char lookup_tables::lookup_text[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled - // (anything but < \0 &) - template - const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled - // (anything but < \0 & space \n \r \t) - template - const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Attribute name (anything but space \n \r \t / < > = ? ! \0) - template - const unsigned char lookup_tables::lookup_attribute_name[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Attribute data with single quote (anything but ' \0) - template - const unsigned char lookup_tables::lookup_attribute_data_1[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Attribute data with single quote that does not require processing (anything but ' \0 &) - template - const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Attribute data with double quote (anything but " \0) - template - const unsigned char lookup_tables::lookup_attribute_data_2[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Attribute data with double quote that does not require processing (anything but " \0 &) - template - const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 - 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F - }; - - // Digits (dec and hex, 255 denotes end of numeric character reference) - template - const unsigned char lookup_tables::lookup_digits[256] = - { - // 0 1 2 3 4 5 6 7 8 9 A B C D E F - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 - 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 - 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F - }; - - // Upper case conversion - template - const unsigned char lookup_tables::lookup_upcase[256] = - { - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F - }; - } - //! \endcond - -} -} // end namespace cereal - -// Undefine internal macros -#undef CEREAL_RAPIDXML_PARSE_ERROR - -// On MSVC, restore warnings state -#ifdef _MSC_VER - #pragma warning(pop) -#endif - -#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp deleted file mode 100644 index 736d46c39..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_iterators.hpp +++ /dev/null @@ -1,175 +0,0 @@ -#ifndef CEREAL_RAPIDXML_ITERATORS_HPP_INCLUDED -#define CEREAL_RAPIDXML_ITERATORS_HPP_INCLUDED - -// Copyright (C) 2006, 2009 Marcin Kalicinski -// Version 1.13 -// Revision $DateTime: 2009/05/13 01:46:17 $ - -#include "rapidxml.hpp" - -namespace cereal { -namespace rapidxml -{ - - //! Iterator of child nodes of xml_node - template - class node_iterator - { - - public: - - typedef typename xml_node value_type; - typedef typename xml_node &reference; - typedef typename xml_node *pointer; - typedef std::ptrdiff_t difference_type; - typedef std::bidirectional_iterator_tag iterator_category; - - node_iterator() - : m_node(0) - { - } - - node_iterator(xml_node *node) - : m_node(node->first_node()) - { - } - - reference operator *() const - { - assert(m_node); - return *m_node; - } - - pointer operator->() const - { - assert(m_node); - return m_node; - } - - node_iterator& operator++() - { - assert(m_node); - m_node = m_node->next_sibling(); - return *this; - } - - node_iterator operator++(int) - { - node_iterator tmp = *this; - ++this; - return tmp; - } - - node_iterator& operator--() - { - assert(m_node && m_node->previous_sibling()); - m_node = m_node->previous_sibling(); - return *this; - } - - node_iterator operator--(int) - { - node_iterator tmp = *this; - ++this; - return tmp; - } - - bool operator ==(const node_iterator &rhs) - { - return m_node == rhs.m_node; - } - - bool operator !=(const node_iterator &rhs) - { - return m_node != rhs.m_node; - } - - private: - - xml_node *m_node; - - }; - - //! Iterator of child attributes of xml_node - template - class attribute_iterator - { - - public: - - typedef typename xml_attribute value_type; - typedef typename xml_attribute &reference; - typedef typename xml_attribute *pointer; - typedef std::ptrdiff_t difference_type; - typedef std::bidirectional_iterator_tag iterator_category; - - attribute_iterator() - : m_attribute(0) - { - } - - attribute_iterator(xml_node *node) - : m_attribute(node->first_attribute()) - { - } - - reference operator *() const - { - assert(m_attribute); - return *m_attribute; - } - - pointer operator->() const - { - assert(m_attribute); - return m_attribute; - } - - attribute_iterator& operator++() - { - assert(m_attribute); - m_attribute = m_attribute->next_attribute(); - return *this; - } - - attribute_iterator operator++(int) - { - attribute_iterator tmp = *this; - ++this; - return tmp; - } - - attribute_iterator& operator--() - { - assert(m_attribute && m_attribute->previous_attribute()); - m_attribute = m_attribute->previous_attribute(); - return *this; - } - - attribute_iterator operator--(int) - { - attribute_iterator tmp = *this; - ++this; - return tmp; - } - - bool operator ==(const attribute_iterator &rhs) - { - return m_attribute == rhs.m_attribute; - } - - bool operator !=(const attribute_iterator &rhs) - { - return m_attribute != rhs.m_attribute; - } - - private: - - xml_attribute *m_attribute; - - }; - -} -} // namespace cereal - -#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp deleted file mode 100644 index 7fbb962e1..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_print.hpp +++ /dev/null @@ -1,428 +0,0 @@ -#ifndef CEREAL_RAPIDXML_PRINT_HPP_INCLUDED -#define CEREAL_RAPIDXML_PRINT_HPP_INCLUDED - -// Copyright (C) 2006, 2009 Marcin Kalicinski -// Version 1.13 -// Revision $DateTime: 2009/05/13 01:46:17 $ - -#include "rapidxml.hpp" - -// Only include streams if not disabled -#ifndef CEREAL_RAPIDXML_NO_STREAMS - #include - #include -#endif - -namespace cereal { -namespace rapidxml -{ - - /////////////////////////////////////////////////////////////////////// - // Printing flags - - const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. - - /////////////////////////////////////////////////////////////////////// - // Internal - - //! \cond internal - namespace internal - { - - /////////////////////////////////////////////////////////////////////////// - // Internal character operations - - // Copy characters from given range to given output iterator - template - inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) - { - while (begin != end) - *out++ = *begin++; - return out; - } - - // Copy characters from given range to given output iterator and expand - // characters into references (< > ' " &) - template - inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) - { - while (begin != end) - { - if (*begin == noexpand) - { - *out++ = *begin; // No expansion, copy character - } - else - { - switch (*begin) - { - case Ch('<'): - *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); - break; - case Ch('>'): - *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); - break; - case Ch('\''): - *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); - break; - case Ch('"'): - *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); - break; - case Ch('&'): - *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); - break; - default: - *out++ = *begin; // No expansion, copy character - } - } - ++begin; // Step to next character - } - return out; - } - - // Fill given output iterator with repetitions of the same character - template - inline OutIt fill_chars(OutIt out, int n, Ch ch) - { - for (int i = 0; i < n; ++i) - *out++ = ch; - return out; - } - - // Find character - template - inline bool find_char(const Ch *begin, const Ch *end) - { - while (begin != end) - if (*begin++ == ch) - return true; - return false; - } - - /////////////////////////////////////////////////////////////////////////// - // Internal printing operations - - // Print node - template - inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); - - // Print children of the node - template - inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) - { - for (xml_node *child = node->first_node(); child; child = child->next_sibling()) - out = print_node(out, child, flags, indent); - return out; - } - - // Print attributes of the node - template - inline OutIt print_attributes(OutIt out, const xml_node *node, int /*flags*/) - { - for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) - { - if (attribute->name() && attribute->value()) - { - // Print attribute name - *out = Ch(' '), ++out; - out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); - *out = Ch('='), ++out; - // Print attribute value using appropriate quote type - if (find_char(attribute->value(), attribute->value() + attribute->value_size())) - { - *out = Ch('\''), ++out; - out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); - *out = Ch('\''), ++out; - } - else - { - *out = Ch('"'), ++out; - out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); - *out = Ch('"'), ++out; - } - } - } - return out; - } - - // Print data node - template - inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_data); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); - return out; - } - - // Print data node - template - inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_cdata); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'); ++out; - *out = Ch('!'); ++out; - *out = Ch('['); ++out; - *out = Ch('C'); ++out; - *out = Ch('D'); ++out; - *out = Ch('A'); ++out; - *out = Ch('T'); ++out; - *out = Ch('A'); ++out; - *out = Ch('['); ++out; - out = copy_chars(node->value(), node->value() + node->value_size(), out); - *out = Ch(']'); ++out; - *out = Ch(']'); ++out; - *out = Ch('>'); ++out; - return out; - } - - // Print element node - template - inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_element); - - // Print element name and attributes, if any - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'), ++out; - out = copy_chars(node->name(), node->name() + node->name_size(), out); - out = print_attributes(out, node, flags); - - // If node is childless - if (node->value_size() == 0 && !node->first_node()) - { - // Print childless node tag ending - *out = Ch('/'), ++out; - *out = Ch('>'), ++out; - } - else - { - // Print normal node tag ending - *out = Ch('>'), ++out; - - // Test if node contains a single data node only (and no other nodes) - xml_node *child = node->first_node(); - if (!child) - { - // If node has no children, only print its value without indenting - out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); - } - else if (child->next_sibling() == 0 && child->type() == node_data) - { - // If node has a sole data child, only print its value without indenting - out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); - } - else - { - // Print all children with full indenting - if (!(flags & print_no_indenting)) - *out = Ch('\n'), ++out; - out = print_children(out, node, flags, indent + 1); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - } - - // Print node end - *out = Ch('<'), ++out; - *out = Ch('/'), ++out; - out = copy_chars(node->name(), node->name() + node->name_size(), out); - *out = Ch('>'), ++out; - } - return out; - } - - // Print declaration node - template - inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) - { - // Print declaration start - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'), ++out; - *out = Ch('?'), ++out; - *out = Ch('x'), ++out; - *out = Ch('m'), ++out; - *out = Ch('l'), ++out; - - // Print attributes - out = print_attributes(out, node, flags); - - // Print declaration end - *out = Ch('?'), ++out; - *out = Ch('>'), ++out; - - return out; - } - - // Print comment node - template - inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_comment); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'), ++out; - *out = Ch('!'), ++out; - *out = Ch('-'), ++out; - *out = Ch('-'), ++out; - out = copy_chars(node->value(), node->value() + node->value_size(), out); - *out = Ch('-'), ++out; - *out = Ch('-'), ++out; - *out = Ch('>'), ++out; - return out; - } - - // Print doctype node - template - inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_doctype); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'), ++out; - *out = Ch('!'), ++out; - *out = Ch('D'), ++out; - *out = Ch('O'), ++out; - *out = Ch('C'), ++out; - *out = Ch('T'), ++out; - *out = Ch('Y'), ++out; - *out = Ch('P'), ++out; - *out = Ch('E'), ++out; - *out = Ch(' '), ++out; - out = copy_chars(node->value(), node->value() + node->value_size(), out); - *out = Ch('>'), ++out; - return out; - } - - // Print pi node - template - inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) - { - assert(node->type() == node_pi); - if (!(flags & print_no_indenting)) - out = fill_chars(out, indent, Ch('\t')); - *out = Ch('<'), ++out; - *out = Ch('?'), ++out; - out = copy_chars(node->name(), node->name() + node->name_size(), out); - *out = Ch(' '), ++out; - out = copy_chars(node->value(), node->value() + node->value_size(), out); - *out = Ch('?'), ++out; - *out = Ch('>'), ++out; - return out; - } - - // Print node - template - inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) - { - // Print proper node type - switch (node->type()) - { - - // Document - case node_document: - out = print_children(out, node, flags, indent); - break; - - // Element - case node_element: - out = print_element_node(out, node, flags, indent); - break; - - // Data - case node_data: - out = print_data_node(out, node, flags, indent); - break; - - // CDATA - case node_cdata: - out = print_cdata_node(out, node, flags, indent); - break; - - // Declaration - case node_declaration: - out = print_declaration_node(out, node, flags, indent); - break; - - // Comment - case node_comment: - out = print_comment_node(out, node, flags, indent); - break; - - // Doctype - case node_doctype: - out = print_doctype_node(out, node, flags, indent); - break; - - // Pi - case node_pi: - out = print_pi_node(out, node, flags, indent); - break; - -#ifndef __GNUC__ - // Unknown - default: - assert(0); - break; -#endif - } - - // If indenting not disabled, add line break after node - if (!(flags & print_no_indenting)) - *out = Ch('\n'), ++out; - - // Return modified iterator - return out; - } - - } - //! \endcond - - /////////////////////////////////////////////////////////////////////////// - // Printing - - //! Prints XML to given output iterator. - //! \param out Output iterator to print to. - //! \param node Node to be printed. Pass xml_document to print entire document. - //! \param flags Flags controlling how XML is printed. - //! \return Output iterator pointing to position immediately after last character of printed text. - template - inline OutIt print(OutIt out, const xml_node &node, int flags = 0) - { - return internal::print_node(out, &node, flags, 0); - } - -#ifndef CEREAL_RAPIDXML_NO_STREAMS - - //! Prints XML to given output stream. - //! \param out Output stream to print to. - //! \param node Node to be printed. Pass xml_document to print entire document. - //! \param flags Flags controlling how XML is printed. - //! \return Output stream. - template - inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) - { - print(std::ostream_iterator(out), node, flags); - return out; - } - - //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. - //! \param out Output stream to print to. - //! \param node Node to be printed. - //! \return Output stream. - template - inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) - { - return print(out, node); - } - -#endif - -} -} // namespace cereal - -#endif diff --git a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp b/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp deleted file mode 100644 index e11ecf319..000000000 --- a/cpp/src/cylon/thridparty/cereal/external/rapidxml/rapidxml_utils.hpp +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef CEREAL_RAPIDXML_UTILS_HPP_INCLUDED -#define CEREAL_RAPIDXML_UTILS_HPP_INCLUDED - -// Copyright (C) 2006, 2009 Marcin Kalicinski -// Version 1.13 -// Revision $DateTime: 2009/05/13 01:46:17 $ -//! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. - -#include "rapidxml.hpp" -#include -#include -#include -#include - -namespace cereal { -namespace rapidxml -{ - - //! Represents data loaded from a file - template - class file - { - - public: - - //! Loads file into the memory. Data will be automatically destroyed by the destructor. - //! \param filename Filename to load. - file(const char *filename) - { - using namespace std; - - // Open stream - basic_ifstream stream(filename, ios::binary); - if (!stream) - throw runtime_error(string("cannot open file ") + filename); - stream.unsetf(ios::skipws); - - // Determine stream size - stream.seekg(0, ios::end); - size_t size = stream.tellg(); - stream.seekg(0); - - // Load data and add terminating 0 - m_data.resize(size + 1); - stream.read(&m_data.front(), static_cast(size)); - m_data[size] = 0; - } - - //! Loads file into the memory. Data will be automatically destroyed by the destructor - //! \param stream Stream to load from - file(std::basic_istream &stream) - { - using namespace std; - - // Load data and add terminating 0 - stream.unsetf(ios::skipws); - m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); - if (stream.fail() || stream.bad()) - throw runtime_error("error reading stream"); - m_data.push_back(0); - } - - //! Gets file data. - //! \return Pointer to data of file. - Ch *data() - { - return &m_data.front(); - } - - //! Gets file data. - //! \return Pointer to data of file. - const Ch *data() const - { - return &m_data.front(); - } - - //! Gets file data size. - //! \return Size of file data, in characters. - std::size_t size() const - { - return m_data.size(); - } - - private: - - std::vector m_data; // File data - - }; - - //! Counts children of node. Time complexity is O(n). - //! \return Number of children of node - template - inline std::size_t count_children(xml_node *node) - { - xml_node *child = node->first_node(); - std::size_t count = 0; - while (child) - { - ++count; - child = child->next_sibling(); - } - return count; - } - - //! Counts attributes of node. Time complexity is O(n). - //! \return Number of attributes of node - template - inline std::size_t count_attributes(xml_node *node) - { - xml_attribute *attr = node->first_attribute(); - std::size_t count = 0; - while (attr) - { - ++count; - attr = attr->next_attribute(); - } - return count; - } - -} -} // namespace cereal - -#endif diff --git a/cpp/src/cylon/thridparty/cereal/macros.hpp b/cpp/src/cylon/thridparty/cereal/macros.hpp deleted file mode 100644 index 85cf9b58c..000000000 --- a/cpp/src/cylon/thridparty/cereal/macros.hpp +++ /dev/null @@ -1,156 +0,0 @@ -/*! \file macros.hpp - \brief Preprocessor macros that can customise the cereal library - - By default, cereal looks for serialization functions with very - specific names, that is: serialize, load, save, load_minimal, - or save_minimal. - - This file allows an advanced user to change these names to conform - to some other style or preference. This is implemented using - preprocessor macros. - - As a result of this, in internal cereal code you will see macros - used for these function names. In user code, you should name - the functions like you normally would and not use the macros - to improve readability. - \ingroup utility */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CEREAL_MACROS_HPP_ -#define CEREAL_MACROS_HPP_ - -#ifndef CEREAL_THREAD_SAFE -//! Whether cereal should be compiled for a threaded environment -/*! This macro causes cereal to use mutexes to control access to - global internal state in a thread safe manner. - - Note that even with this enabled you must still ensure that - archives are accessed by only one thread at a time; it is safe - to use multiple archives in parallel, but not to access one archive - from many places simultaneously. */ -#define CEREAL_THREAD_SAFE 0 -#endif // CEREAL_THREAD_SAFE - -#ifndef CEREAL_SIZE_TYPE -//! Determines the data type used for size_type -/*! cereal uses size_type to ensure that the serialized size of - dynamic containers is compatible across different architectures - (e.g. 32 vs 64 bit), which may use different underlying types for - std::size_t. - - More information can be found in cereal/details/helpers.hpp. - - If you choose to modify this type, ensure that you use a fixed - size type (e.g. uint32_t). */ -#define CEREAL_SIZE_TYPE uint64_t -#endif // CEREAL_SIZE_TYPE - -// ###################################################################### -#ifndef CEREAL_SERIALIZE_FUNCTION_NAME -//! The serialization/deserialization function name to search for. -/*! You can define @c CEREAL_SERIALIZE_FUNCTION_NAME to be different assuming - you do so before this file is included. */ -#define CEREAL_SERIALIZE_FUNCTION_NAME serialize -#endif // CEREAL_SERIALIZE_FUNCTION_NAME - -#ifndef CEREAL_LOAD_FUNCTION_NAME -//! The deserialization (load) function name to search for. -/*! You can define @c CEREAL_LOAD_FUNCTION_NAME to be different assuming you do so - before this file is included. */ -#define CEREAL_LOAD_FUNCTION_NAME load -#endif // CEREAL_LOAD_FUNCTION_NAME - -#ifndef CEREAL_SAVE_FUNCTION_NAME -//! The serialization (save) function name to search for. -/*! You can define @c CEREAL_SAVE_FUNCTION_NAME to be different assuming you do so - before this file is included. */ -#define CEREAL_SAVE_FUNCTION_NAME save -#endif // CEREAL_SAVE_FUNCTION_NAME - -#ifndef CEREAL_LOAD_MINIMAL_FUNCTION_NAME -//! The deserialization (load_minimal) function name to search for. -/*! You can define @c CEREAL_LOAD_MINIMAL_FUNCTION_NAME to be different assuming you do so - before this file is included. */ -#define CEREAL_LOAD_MINIMAL_FUNCTION_NAME load_minimal -#endif // CEREAL_LOAD_MINIMAL_FUNCTION_NAME - -#ifndef CEREAL_SAVE_MINIMAL_FUNCTION_NAME -//! The serialization (save_minimal) function name to search for. -/*! You can define @c CEREAL_SAVE_MINIMAL_FUNCTION_NAME to be different assuming you do so - before this file is included. */ -#define CEREAL_SAVE_MINIMAL_FUNCTION_NAME save_minimal -#endif // CEREAL_SAVE_MINIMAL_FUNCTION_NAME - -// ###################################################################### -//! Defines the CEREAL_NOEXCEPT macro to use instead of noexcept -/*! If a compiler we support does not support noexcept, this macro - will detect this and define CEREAL_NOEXCEPT as a no-op - @internal */ -#if !defined(CEREAL_HAS_NOEXCEPT) - #if defined(__clang__) - #if __has_feature(cxx_noexcept) - #define CEREAL_HAS_NOEXCEPT - #endif - #else // NOT clang - #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \ - defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 - #define CEREAL_HAS_NOEXCEPT - #endif // end GCC/MSVC check - #endif // end NOT clang block - - #ifndef CEREAL_NOEXCEPT - #ifdef CEREAL_HAS_NOEXCEPT - #define CEREAL_NOEXCEPT noexcept - #else - #define CEREAL_NOEXCEPT - #endif // end CEREAL_HAS_NOEXCEPT - #endif // end !defined(CEREAL_HAS_NOEXCEPT) -#endif // ifndef CEREAL_NOEXCEPT - -// ###################################################################### -//! Checks if C++17 is available -//! NOTE: clang v5 has a bug with inline variables, so disable C++17 on that compiler -#if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) \ - && (!defined(__clang__) || __clang_major__ > 5) -#define CEREAL_HAS_CPP17 -#endif - -//! Checks if C++14 is available -#if __cplusplus >= 201402L -#define CEREAL_HAS_CPP14 -#endif - -// ###################################################################### -//! Defines the CEREAL_ALIGNOF macro to use instead of alignof -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define CEREAL_ALIGNOF __alignof -#else // not MSVC 2013 or older -#define CEREAL_ALIGNOF alignof -#endif // end MSVC check - -#endif // CEREAL_MACROS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/specialize.hpp b/cpp/src/cylon/thridparty/cereal/specialize.hpp deleted file mode 100644 index da9c9a5a8..000000000 --- a/cpp/src/cylon/thridparty/cereal/specialize.hpp +++ /dev/null @@ -1,139 +0,0 @@ -/*! \file specialize.hpp - \brief Serialization disambiguation */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CEREAL_SPECIALIZE_HPP_ -#define CEREAL_SPECIALIZE_HPP_ - -namespace cereal -{ - // Forward declaration of access class that users can become friends with - class access; - - // ###################################################################### - //! A specifier used in conjunction with cereal::specialize to disambiguate - //! serialization in special cases - /*! @relates specialize - @ingroup Access */ - enum class specialization - { - member_serialize, //!< Force the use of a member serialize function - member_load_save, //!< Force the use of a member load/save pair - member_load_save_minimal, //!< Force the use of a member minimal load/save pair - non_member_serialize, //!< Force the use of a non-member serialize function - non_member_load_save, //!< Force the use of a non-member load/save pair - non_member_load_save_minimal //!< Force the use of a non-member minimal load/save pair - }; - - //! A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class - /*! cereal attempts to figure out which method of serialization (member vs. non-member serialize - or load/save pair) at compile time. If for some reason cereal cannot find a non-ambiguous way - of serializing a type, it will produce a static assertion complaining about this. - - This can happen because you have both a serialize and load/save pair, or even because a base - class has a serialize (public or private with friend access) and a derived class does not - overwrite this due to choosing some other serialization type. - - Specializing this class will tell cereal to explicitly use the serialization type you specify - and it will not complain about ambiguity in its compile time selection. However, if cereal detects - an ambiguity in specializations, it will continue to issue a static assertion. - - @code{.cpp} - class MyParent - { - friend class cereal::access; - template - void serialize( Archive & ar ) {} - }; - - // Although serialize is private in MyParent, to cereal::access it will look public, - // even through MyDerived - class MyDerived : public MyParent - { - public: - template - void load( Archive & ar ) {} - - template - void save( Archive & ar ) {} - }; - - // The load/save pair in MyDerived is ambiguous because serialize in MyParent can - // be accessed from cereal::access. This looks the same as making serialize public - // in MyParent, making it seem as though MyDerived has both a serialize and a load/save pair. - // cereal will complain about this at compile time unless we disambiguate: - - namespace cereal - { - // This struct specialization will tell cereal which is the right way to serialize the ambiguity - template struct specialize {}; - - // If we only had a disambiguation for a specific archive type, it would look something like this - template <> struct specialize {}; - } - @endcode - - You can also choose to use the macros CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES or - CEREAL_SPECIALIZE_FOR_ARCHIVE if you want to type a little bit less. - - @tparam T The type to specialize the serialization for - @tparam S The specialization type to use for T - @ingroup Access */ - template - struct specialize : public std::false_type {}; - - //! Convenient macro for performing specialization for all archive types - /*! This performs specialization for the specific type for all types of archives. - This macro should be placed at the global namespace. - - @code{cpp} - struct MyType {}; - CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( MyType, cereal::specialization::member_load_save ); - @endcode - - @relates specialize - @ingroup Access */ - #define CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES( Type, Specialization ) \ - namespace cereal { template struct specialize {}; } - - //! Convenient macro for performing specialization for a single archive type - /*! This performs specialization for the specific type for a single type of archive. - This macro should be placed at the global namespace. - - @code{cpp} - struct MyType {}; - CEREAL_SPECIALIZE_FOR_ARCHIVE( cereal::XMLInputArchive, MyType, cereal::specialization::member_load_save ); - @endcode - - @relates specialize - @ingroup Access */ - #define CEREAL_SPECIALIZE_FOR_ARCHIVE( Archive, Type, Specialization ) \ - namespace cereal { template <> struct specialize {}; } -} - -#endif diff --git a/cpp/src/cylon/thridparty/cereal/types/array.hpp b/cpp/src/cylon/thridparty/cereal/types/array.hpp deleted file mode 100644 index f9d941dbc..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/array.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*! \file array.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_ARRAY_HPP_ -#define CEREAL_TYPES_ARRAY_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Saving for std::array primitive types - //! using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array const & array ) - { - ar( binary_data( array.data(), sizeof(array) ) ); - } - - //! Loading for std::array primitive types - //! using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array & array ) - { - ar( binary_data( array.data(), sizeof(array) ) ); - } - - //! Saving for std::array all other types - template inline - typename std::enable_if, Archive>::value - || !std::is_arithmetic::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array const & array ) - { - for( auto const & i : array ) - ar( i ); - } - - //! Loading for std::array all other types - template inline - typename std::enable_if, Archive>::value - || !std::is_arithmetic::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array & array ) - { - for( auto & i : array ) - ar( i ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_ARRAY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/atomic.hpp b/cpp/src/cylon/thridparty/cereal/types/atomic.hpp deleted file mode 100644 index 22809a8f0..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/atomic.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*! \file atomic.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_ATOMIC_HPP_ -#define CEREAL_TYPES_ATOMIC_HPP_ - -#include -#include - -namespace cereal -{ - //! Serializing (save) for std::atomic - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::atomic const & a ) - { - ar( CEREAL_NVP_("atomic_data", a.load()) ); - } - - //! Serializing (load) for std::atomic - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::atomic & a ) - { - T tmp; - ar( CEREAL_NVP_("atomic_data", tmp) ); - a.store( tmp ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_ATOMIC_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/base_class.hpp b/cpp/src/cylon/thridparty/cereal/types/base_class.hpp deleted file mode 100644 index 81130a373..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/base_class.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/*! \file base_class.hpp - \brief Support for base classes (virtual and non-virtual) - \ingroup OtherTypes */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_BASE_CLASS_HPP_ -#define CEREAL_TYPES_BASE_CLASS_HPP_ - -#include "cylon/thridparty/cereal/details/traits.hpp" -#include "cylon/thridparty/cereal/details/polymorphic_impl_fwd.hpp" - -namespace cereal -{ - namespace base_class_detail - { - //! Used to register polymorphic relations and avoid the need to include - //! polymorphic.hpp when no polymorphism is used - /*! @internal */ - template ::value> - struct RegisterPolymorphicBaseClass - { - static void bind() - { } - }; - - //! Polymorphic version - /*! @internal */ - template - struct RegisterPolymorphicBaseClass - { - static void bind() - { detail::RegisterPolymorphicCaster::bind(); } - }; - } - - //! Casts a derived class to its non-virtual base class in a way that safely supports abstract classes - /*! This should be used in cases when a derived type needs to serialize its base type. This is better than directly - using static_cast, as it allows for serialization of pure virtual (abstract) base classes. - - This also automatically registers polymorphic relation between the base and derived class, assuming they - are indeed polymorphic. Note this is not the same as polymorphic type registration. For more information - see the documentation on polymorphism. If using a polymorphic class, be sure to include support for - polymorphism (cereal/types/polymorphic.hpp). - - \sa virtual_base_class - - @code{.cpp} - struct MyBase - { - int x; - - virtual void foo() = 0; - - template - void serialize( Archive & ar ) - { - ar( x ); - } - }; - - struct MyDerived : public MyBase //<-- Note non-virtual inheritance - { - int y; - - virtual void foo() {}; - - template - void serialize( Archive & ar ) - { - ar( cereal::base_class(this) ); - ar( y ); - } - }; - @endcode */ - template - struct base_class : private traits::detail::BaseCastBase - { - template - base_class(Derived const * derived) : - base_ptr(const_cast(static_cast(derived))) - { - static_assert( std::is_base_of::value, "Can only use base_class on a valid base class" ); - base_class_detail::RegisterPolymorphicBaseClass::bind(); - } - - Base * base_ptr; - }; - - //! Casts a derived class to its virtual base class in a way that allows cereal to track inheritance - /*! This should be used in cases when a derived type features virtual inheritance from some - base type. This allows cereal to track the inheritance and to avoid making duplicate copies - during serialization. - - It is safe to use virtual_base_class in all circumstances for serializing base classes, even in cases - where virtual inheritance does not take place, though it may be slightly faster to utilize - cereal::base_class<> if you do not need to worry about virtual inheritance. - - This also automatically registers polymorphic relation between the base and derived class, assuming they - are indeed polymorphic. Note this is not the same as polymorphic type registration. For more information - see the documentation on polymorphism. If using a polymorphic class, be sure to include support for - polymorphism (cereal/types/polymorphic.hpp). - - \sa base_class - - @code{.cpp} - struct MyBase - { - int x; - - template - void serialize( Archive & ar ) - { - ar( x ); - } - }; - - struct MyLeft : virtual MyBase //<-- Note the virtual inheritance - { - int y; - - template - void serialize( Archive & ar ) - { - ar( cereal::virtual_base_class( this ) ); - ar( y ); - } - }; - - struct MyRight : virtual MyBase - { - int z; - - template - void serialize( Archive & ar ) - { - ar( cereal::virtual_base_clas( this ) ); - ar( z ); - } - }; - - // diamond virtual inheritance; contains one copy of each base class - struct MyDerived : virtual MyLeft, virtual MyRight - { - int a; - - template - void serialize( Archive & ar ) - { - ar( cereal::virtual_base_class( this ) ); // safely serialize data members in MyLeft - ar( cereal::virtual_base_class( this ) ); // safely serialize data members in MyRight - ar( a ); - - // Because we used virtual_base_class, cereal will ensure that only one instance of MyBase is - // serialized as we traverse the inheritance heirarchy. This means that there will be one copy - // each of the variables x, y, z, and a - - // If we had chosen to use static_cast<> instead, cereal would perform no tracking and - // assume that every base class should be serialized (in this case leading to a duplicate - // serialization of MyBase due to diamond inheritance - }; - } - @endcode */ - template - struct virtual_base_class : private traits::detail::BaseCastBase - { - template - virtual_base_class(Derived const * derived) : - base_ptr(const_cast(static_cast(derived))) - { - static_assert( std::is_base_of::value, "Can only use virtual_base_class on a valid base class" ); - base_class_detail::RegisterPolymorphicBaseClass::bind(); - } - - Base * base_ptr; - }; - -} // namespace cereal - -#endif // CEREAL_TYPES_BASE_CLASS_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/bitset.hpp b/cpp/src/cylon/thridparty/cereal/types/bitset.hpp deleted file mode 100644 index 619d9f9d6..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/bitset.hpp +++ /dev/null @@ -1,176 +0,0 @@ -/*! \file bitset.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_BITSET_HPP_ -#define CEREAL_TYPES_BITSET_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include "cylon/thridparty/cereal/types/string.hpp" -#include - -namespace cereal -{ - namespace bitset_detail - { - //! The type the bitset is encoded with - /*! @internal */ - enum class type : uint8_t - { - ulong, - ullong, - string, - bits - }; - } - - //! Serializing (save) for std::bitset when BinaryData optimization supported - template , Archive>::value> - = traits::sfinae> inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::bitset const & bits ) - { - ar( CEREAL_NVP_("type", bitset_detail::type::bits) ); - - // Serialize 8 bit chunks - std::uint8_t chunk = 0; - std::uint8_t mask = 0x80; - - // Set each chunk using a rotating mask for the current bit - for( std::size_t i = 0; i < N; ++i ) - { - if( bits[i] ) - chunk |= mask; - - mask = static_cast(mask >> 1); - - // output current chunk when mask is empty (8 bits) - if( mask == 0 ) - { - ar( chunk ); - chunk = 0; - mask = 0x80; - } - } - - // serialize remainder, if it exists - if( mask != 0x80 ) - ar( chunk ); - } - - //! Serializing (save) for std::bitset when BinaryData is not supported - template , Archive>::value> - = traits::sfinae> inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::bitset const & bits ) - { - try - { - auto const b = bits.to_ulong(); - ar( CEREAL_NVP_("type", bitset_detail::type::ulong) ); - ar( CEREAL_NVP_("data", b) ); - } - catch( std::overflow_error const & ) - { - try - { - auto const b = bits.to_ullong(); - ar( CEREAL_NVP_("type", bitset_detail::type::ullong) ); - ar( CEREAL_NVP_("data", b) ); - } - catch( std::overflow_error const & ) - { - ar( CEREAL_NVP_("type", bitset_detail::type::string) ); - ar( CEREAL_NVP_("data", bits.to_string()) ); - } - } - } - - //! Serializing (load) for std::bitset - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::bitset & bits ) - { - bitset_detail::type t; - ar( CEREAL_NVP_("type", t) ); - - switch( t ) - { - case bitset_detail::type::ulong: - { - unsigned long b; - ar( CEREAL_NVP_("data", b) ); - bits = std::bitset( b ); - break; - } - case bitset_detail::type::ullong: - { - unsigned long long b; - ar( CEREAL_NVP_("data", b) ); - bits = std::bitset( b ); - break; - } - case bitset_detail::type::string: - { - std::string b; - ar( CEREAL_NVP_("data", b) ); - bits = std::bitset( b ); - break; - } - case bitset_detail::type::bits: - { - // Normally we would use BinaryData to route this at compile time, - // but doing this at runtime doesn't break any old serialization - std::uint8_t chunk = 0; - std::uint8_t mask = 0; - - bits.reset(); - - // Load one chunk at a time, rotating through the chunk - // to set bits in the bitset - for( std::size_t i = 0; i < N; ++i ) - { - if( mask == 0 ) - { - ar( chunk ); - mask = 0x80; - } - - if( chunk & mask ) - bits[i] = 1; - - mask = static_cast(mask >> 1); - } - break; - } - default: - throw Exception("Invalid bitset data representation"); - } - } -} // namespace cereal - -#endif // CEREAL_TYPES_BITSET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp b/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp deleted file mode 100644 index fe7747375..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/boost_variant.hpp +++ /dev/null @@ -1,164 +0,0 @@ -/*! \file boost_variant.hpp - \brief Support for boost::variant - \ingroup OtherTypes */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_BOOST_VARIANT_HPP_ -#define CEREAL_TYPES_BOOST_VARIANT_HPP_ - -//! @internal -#if defined(_MSC_VER) && _MSC_VER < 1911 -#define CEREAL_CONSTEXPR_LAMBDA -#else // MSVC 2017 or newer, all other compilers -#define CEREAL_CONSTEXPR_LAMBDA constexpr -#endif - -#include "cylon/thridparty/cereal/cereal.hpp" -#include -#include - -namespace cereal -{ - namespace boost_variant_detail - { - //! @internal - template - struct variant_save_visitor : boost::static_visitor<> - { - variant_save_visitor(Archive & ar_) : ar(ar_) {} - - template - void operator()(T const & value) const - { - ar( CEREAL_NVP_("data", value) ); - } - - Archive & ar; - }; - - //! @internal - template - struct LoadAndConstructLoadWrapper - { - using ST = typename std::aligned_storage::type; - - LoadAndConstructLoadWrapper() : - construct( reinterpret_cast( &st ) ) - { } - - ~LoadAndConstructLoadWrapper() - { - if (construct.itsValid) - { - construct->~T(); - } - } - - void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar ) - { - ::cereal::detail::Construct::load_andor_construct( ar, construct ); - } - - ST st; - ::cereal::construct construct; - }; - - //! @internal - template struct load_variant_wrapper; - - //! Avoid serializing variant void_ type - /*! @internal */ - template <> - struct load_variant_wrapper - { - template - static void load_variant( Archive &, Variant & ) - { } - }; - - //! @internal - template - struct load_variant_wrapper - { - // default constructible - template - static void load_variant_impl( Archive & ar, Variant & variant, std::true_type ) - { - T value; - ar( CEREAL_NVP_("data", value) ); - variant = std::move(value); - } - - // not default constructible - template - static void load_variant_impl(Archive & ar, Variant & variant, std::false_type ) - { - LoadAndConstructLoadWrapper loadWrapper; - - ar( CEREAL_NVP_("data", loadWrapper) ); - variant = std::move(*loadWrapper.construct.ptr()); - } - - //! @internal - template - static void load_variant(Archive & ar, Variant & variant) - { - load_variant_impl( ar, variant, typename std::is_default_constructible::type() ); - } - }; - } // namespace boost_variant_detail - - //! Saving for boost::variant - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, boost::variant const & variant ) - { - int32_t which = variant.which(); - ar( CEREAL_NVP_("which", which) ); - boost_variant_detail::variant_save_visitor visitor(ar); - variant.apply_visitor(visitor); - } - - //! Loading for boost::variant - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, boost::variant & variant ) - { - int32_t which; - ar( CEREAL_NVP_("which", which) ); - - using LoadFuncType = void(*)(Archive &, boost::variant &); - CEREAL_CONSTEXPR_LAMBDA LoadFuncType loadFuncArray[] = {&boost_variant_detail::load_variant_wrapper::load_variant...}; - - if(which >= int32_t(sizeof(loadFuncArray)/sizeof(loadFuncArray[0]))) - throw Exception("Invalid 'which' selector when deserializing boost::variant"); - - loadFuncArray[which](ar, variant); - } -} // namespace cereal - -#undef CEREAL_CONSTEXPR_LAMBDA - -#endif // CEREAL_TYPES_BOOST_VARIANT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/chrono.hpp b/cpp/src/cylon/thridparty/cereal/types/chrono.hpp deleted file mode 100644 index da1ef42c0..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/chrono.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*! \file chrono.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_CHRONO_HPP_ -#define CEREAL_TYPES_CHRONO_HPP_ - -#include - -namespace cereal -{ - //! Saving std::chrono::duration - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::chrono::duration const & dur ) - { - ar( CEREAL_NVP_("count", dur.count()) ); - } - - //! Loading std::chrono::duration - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::chrono::duration & dur ) - { - R count; - ar( CEREAL_NVP_("count", count) ); - - dur = std::chrono::duration{count}; - } - - //! Saving std::chrono::time_point - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::chrono::time_point const & dur ) - { - ar( CEREAL_NVP_("time_since_epoch", dur.time_since_epoch()) ); - } - - //! Loading std::chrono::time_point - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::chrono::time_point & dur ) - { - D elapsed; - ar( CEREAL_NVP_("time_since_epoch", elapsed) ); - - dur = std::chrono::time_point{elapsed}; - } -} // namespace cereal - -#endif // CEREAL_TYPES_CHRONO_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/common.hpp b/cpp/src/cylon/thridparty/cereal/types/common.hpp deleted file mode 100644 index d9524a17a..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/common.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/*! \file common.hpp - \brief Support common types - always included automatically - \ingroup OtherTypes */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_COMMON_HPP_ -#define CEREAL_TYPES_COMMON_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" - -namespace cereal -{ - namespace common_detail - { - //! Serialization for arrays if BinaryData is supported and we are arithmetic - /*! @internal */ - template inline - void serializeArray( Archive & ar, T & array, std::true_type /* binary_supported */ ) - { - ar( binary_data( array, sizeof(array) ) ); - } - - //! Serialization for arrays if BinaryData is not supported or we are not arithmetic - /*! @internal */ - template inline - void serializeArray( Archive & ar, T & array, std::false_type /* binary_supported */ ) - { - for( auto & i : array ) - ar( i ); - } - - namespace - { - //! Gets the underlying type of an enum - /*! @internal */ - template - struct enum_underlying_type : std::false_type {}; - - //! Gets the underlying type of an enum - /*! Specialization for when we actually have an enum - @internal */ - template - struct enum_underlying_type { using type = typename std::underlying_type::type; }; - } // anon namespace - - //! Checks if a type is an enum - /*! This is needed over simply calling std::is_enum because the type - traits checking at compile time will attempt to call something like - load_minimal with a special NoConvertRef struct that wraps up the true type. - - This will strip away any of that and also expose the true underlying type. - @internal */ - template - class is_enum - { - private: - using DecayedT = typename std::decay::type; - using StrippedT = typename ::cereal::traits::strip_minimal::type; - - public: - static const bool value = std::is_enum::value; - using type = StrippedT; - using base_type = typename enum_underlying_type::type; - }; - } - - //! Saving for enum types - template inline - typename std::enable_if::value, - typename common_detail::is_enum::base_type>::type - CEREAL_SAVE_MINIMAL_FUNCTION_NAME( Archive const &, T const & t ) - { - return static_cast::base_type>(t); - } - - //! Loading for enum types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_MINIMAL_FUNCTION_NAME( Archive const &, T && t, - typename common_detail::is_enum::base_type const & value ) - { - t = reinterpret_cast::type const &>( value ); - } - - //! Serialization for raw pointers - /*! This exists only to throw a static_assert to let users know we don't support raw pointers. */ - template inline - void CEREAL_SERIALIZE_FUNCTION_NAME( Archive &, T * & ) - { - static_assert(cereal::traits::detail::delay_static_assert::value, - "Cereal does not support serializing raw pointers - please use a smart pointer"); - } - - //! Serialization for C style arrays - template inline - typename std::enable_if::value, void>::type - CEREAL_SERIALIZE_FUNCTION_NAME(Archive & ar, T & array) - { - common_detail::serializeArray( ar, array, - std::integral_constant, Archive>::value && - std::is_arithmetic::type>::value>() ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_COMMON_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/complex.hpp b/cpp/src/cylon/thridparty/cereal/types/complex.hpp deleted file mode 100644 index b9b86918e..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/complex.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*! \file complex.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_COMPLEX_HPP_ -#define CEREAL_TYPES_COMPLEX_HPP_ - -#include - -namespace cereal -{ - //! Serializing (save) for std::complex - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::complex const & comp ) - { - ar( CEREAL_NVP_("real", comp.real()), - CEREAL_NVP_("imag", comp.imag()) ); - } - - //! Serializing (load) for std::complex - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::complex & bits ) - { - T real, imag; - ar( CEREAL_NVP_("real", real), - CEREAL_NVP_("imag", imag) ); - bits = {real, imag}; - } -} // namespace cereal - -#endif // CEREAL_TYPES_COMPLEX_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp b/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp deleted file mode 100644 index 7ad39e69e..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*! \file pair_associative_container.hpp - \brief Support for the PairAssociativeContainer refinement of the - AssociativeContainer concept. - \ingroup TypeConcepts */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ -#define CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" - -namespace cereal -{ - //! Saving for std-like pair associative containers - template class Map, typename... Args, typename = typename Map::mapped_type> inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, Map const & map ) - { - ar( make_size_tag( static_cast(map.size()) ) ); - - for( const auto & i : map ) - ar( make_map_item(i.first, i.second) ); - } - - //! Loading for std-like pair associative containers - template class Map, typename... Args, typename = typename Map::mapped_type> inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, Map & map ) - { - size_type size; - ar( make_size_tag( size ) ); - - map.clear(); - - auto hint = map.begin(); - for( size_t i = 0; i < size; ++i ) - { - typename Map::key_type key; - typename Map::mapped_type value; - - ar( make_map_item(key, value) ); - #ifdef CEREAL_OLDER_GCC - hint = map.insert( hint, std::make_pair(std::move(key), std::move(value)) ); - #else // NOT CEREAL_OLDER_GCC - hint = map.emplace_hint( hint, std::move( key ), std::move( value ) ); - #endif // NOT CEREAL_OLDER_GCC - } - } -} // namespace cereal - -#endif // CEREAL_CONCEPTS_PAIR_ASSOCIATIVE_CONTAINER_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/deque.hpp b/cpp/src/cylon/thridparty/cereal/types/deque.hpp deleted file mode 100644 index 0eb8d1e62..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/deque.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*! \file deque.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_DEQUE_HPP_ -#define CEREAL_TYPES_DEQUE_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Saving for std::deque - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::deque const & deque ) - { - ar( make_size_tag( static_cast(deque.size()) ) ); - - for( auto const & i : deque ) - ar( i ); - } - - //! Loading for std::deque - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::deque & deque ) - { - size_type size; - ar( make_size_tag( size ) ); - - deque.resize( static_cast( size ) ); - - for( auto & i : deque ) - ar( i ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_DEQUE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp b/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp deleted file mode 100644 index 22aa7262f..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/forward_list.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*! \file forward_list.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_FORWARD_LIST_HPP_ -#define CEREAL_TYPES_FORWARD_LIST_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Saving for std::forward_list all other types - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::forward_list const & forward_list ) - { - // write the size - note that this is slow because we need to traverse - // the entire list. there are ways we could avoid this but this was chosen - // since it works in the most general fashion with any archive type - size_type const size = std::distance( forward_list.begin(), forward_list.end() ); - - ar( make_size_tag( size ) ); - - // write the list - for( const auto & i : forward_list ) - ar( i ); - } - - //! Loading for std::forward_list all other types from - template - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::forward_list & forward_list ) - { - size_type size; - ar( make_size_tag( size ) ); - - forward_list.resize( static_cast( size ) ); - - for( auto & i : forward_list ) - ar( i ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_FORWARD_LIST_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/functional.hpp b/cpp/src/cylon/thridparty/cereal/types/functional.hpp deleted file mode 100644 index 0b9cdf3fc..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/functional.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*! \file functional.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2016, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_FUNCTIONAL_HPP_ -#define CEREAL_TYPES_FUNCTIONAL_HPP_ - -#include - -namespace cereal -{ - //! Saving for std::less - template inline - void serialize( Archive &, std::less & ) - { } -} // namespace cereal - -#endif // CEREAL_TYPES_FUNCTIONAL_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/list.hpp b/cpp/src/cylon/thridparty/cereal/types/list.hpp deleted file mode 100644 index 36143ab25..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/list.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*! \file list.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_LIST_HPP_ -#define CEREAL_TYPES_LIST_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Saving for std::list - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::list const & list ) - { - ar( make_size_tag( static_cast(list.size()) ) ); - - for( auto const & i : list ) - ar( i ); - } - - //! Loading for std::list - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::list & list ) - { - size_type size; - ar( make_size_tag( size ) ); - - list.resize( static_cast( size ) ); - - for( auto & i : list ) - ar( i ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_LIST_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/map.hpp b/cpp/src/cylon/thridparty/cereal/types/map.hpp deleted file mode 100644 index 1ef4910f1..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/map.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/*! \file map.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_MAP_HPP_ -#define CEREAL_TYPES_MAP_HPP_ - -#include "cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp" -#include - -#endif // CEREAL_TYPES_MAP_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/memory.hpp b/cpp/src/cylon/thridparty/cereal/types/memory.hpp deleted file mode 100644 index 31d0095b0..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/memory.hpp +++ /dev/null @@ -1,425 +0,0 @@ -/*! \file memory.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_SHARED_PTR_HPP_ -#define CEREAL_TYPES_SHARED_PTR_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include -#include - -namespace cereal -{ - namespace memory_detail - { - //! A wrapper class to notify cereal that it is ok to serialize the contained pointer - /*! This mechanism allows us to intercept and properly handle polymorphic pointers - @internal */ - template - struct PtrWrapper - { - PtrWrapper(T && p) : ptr(std::forward(p)) {} - T & ptr; - - PtrWrapper( PtrWrapper const & ) = default; - PtrWrapper & operator=( PtrWrapper const & ) = delete; - }; - - //! Make a PtrWrapper - /*! @internal */ - template inline - PtrWrapper make_ptr_wrapper(T && t) - { - return {std::forward(t)}; - } - - //! A struct that acts as a wrapper around calling load_andor_construct - /*! The purpose of this is to allow a load_and_construct call to properly enter into the - 'data' NVP of the ptr_wrapper - @internal */ - template - struct LoadAndConstructLoadWrapper - { - LoadAndConstructLoadWrapper( T * ptr ) : - construct( ptr ) - { } - - //! Constructor for embedding an early call for restoring shared_from_this - template - LoadAndConstructLoadWrapper( T * ptr, F && sharedFromThisFunc ) : - construct( ptr, sharedFromThisFunc ) - { } - - inline void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar ) - { - ::cereal::detail::Construct::load_andor_construct( ar, construct ); - } - - ::cereal::construct construct; - }; - - //! A helper struct for saving and restoring the state of types that derive from - //! std::enable_shared_from_this - /*! This special struct is necessary because when a user uses load_and_construct, - the weak_ptr (or whatever implementation defined variant) that allows - enable_shared_from_this to function correctly will not be initialized properly. - - This internal weak_ptr can also be modified by the shared_ptr that is created - during the serialization of a polymorphic pointer, where cereal creates a - wrapper shared_ptr out of a void pointer to the real data. - - In the case of load_and_construct, this happens because it is the allocation - of shared_ptr that perform this initialization, which we let happen on a buffer - of memory (aligned_storage). This buffer is then used for placement new - later on, effectively overwriting any initialized weak_ptr with a default - initialized one, eventually leading to issues when the user calls shared_from_this. - - To get around these issues, we will store the memory for the enable_shared_from_this - portion of the class and replace it after whatever happens to modify it (e.g. the - user performing construction or the wrapper shared_ptr in saving). - - Note that this goes into undefined behavior territory, but as of the initial writing - of this, all standard library implementations of std::enable_shared_from_this are - compatible with this memory manipulation. It is entirely possible that this may someday - break or may not work with convoluted use cases. - - Example usage: - - @code{.cpp} - T * myActualPointer; - { - EnableSharedStateHelper helper( myActualPointer ); // save the state - std::shared_ptr myPtr( myActualPointer ); // modifies the internal weak_ptr - // helper restores state when it goes out of scope - } - @endcode - - When possible, this is designed to be used in an RAII fashion - it will save state on - construction and restore it on destruction. The restore can be done at an earlier time - (e.g. after construct() is called in load_and_construct) in which case the destructor will - do nothing. Performing the restore immediately following construct() allows a user to call - shared_from_this within their load_and_construct function. - - @tparam T Type pointed to by shared_ptr - @internal */ - template - class EnableSharedStateHelper - { - // typedefs for parent type and storage type - using BaseType = typename ::cereal::traits::get_shared_from_this_base::type; - using ParentType = std::enable_shared_from_this; - using StorageType = typename std::aligned_storage::type; - - public: - //! Saves the state of some type inheriting from enable_shared_from_this - /*! @param ptr The raw pointer held by the shared_ptr */ - inline EnableSharedStateHelper( T * ptr ) : - itsPtr( static_cast( ptr ) ), - itsState(), - itsRestored( false ) - { - std::memcpy( &itsState, itsPtr, sizeof(ParentType) ); - } - - //! Restores the state of the held pointer (can only be done once) - inline void restore() - { - if( !itsRestored ) - { - // void * cast needed when type has no trivial copy-assignment - std::memcpy( static_cast(itsPtr), &itsState, sizeof(ParentType) ); - itsRestored = true; - } - } - - //! Restores the state of the held pointer if not done previously - inline ~EnableSharedStateHelper() - { - restore(); - } - - private: - ParentType * itsPtr; - StorageType itsState; - bool itsRestored; - }; // end EnableSharedStateHelper - - //! Performs loading and construction for a shared pointer that is derived from - //! std::enable_shared_from_this - /*! @param ar The archive - @param ptr Raw pointer held by the shared_ptr - @internal */ - template inline - void loadAndConstructSharedPtr( Archive & ar, T * ptr, std::true_type /* has_shared_from_this */ ) - { - memory_detail::EnableSharedStateHelper state( ptr ); - memory_detail::LoadAndConstructLoadWrapper loadWrapper( ptr, [&](){ state.restore(); } ); - - // let the user perform their initialization, shared state will be restored as soon as construct() - // is called - ar( CEREAL_NVP_("data", loadWrapper) ); - } - - //! Performs loading and construction for a shared pointer that is NOT derived from - //! std::enable_shared_from_this - /*! This is the typical case, where we simply pass the load wrapper to the - archive. - - @param ar The archive - @param ptr Raw pointer held by the shared_ptr - @internal */ - template inline - void loadAndConstructSharedPtr( Archive & ar, T * ptr, std::false_type /* has_shared_from_this */ ) - { - memory_detail::LoadAndConstructLoadWrapper loadWrapper( ptr ); - ar( CEREAL_NVP_("data", loadWrapper) ); - } - } // end namespace memory_detail - - //! Saving std::shared_ptr for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); - } - - //! Loading std::shared_ptr, case when no user load and construct for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::shared_ptr & ptr ) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); - } - - //! Saving std::weak_ptr for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::weak_ptr const & ptr ) - { - auto const sptr = ptr.lock(); - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( sptr )) ); - } - - //! Loading std::weak_ptr for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::weak_ptr & ptr ) - { - std::shared_ptr sptr; - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( sptr )) ); - ptr = sptr; - } - - //! Saving std::unique_ptr for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); - } - - //! Loading std::unique_ptr, case when user provides load_and_construct for non polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unique_ptr & ptr ) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper( ptr )) ); - } - - // ###################################################################### - // Pointer wrapper implementations follow below - - //! Saving std::shared_ptr (wrapper implementation) - /*! @internal */ - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper const &> const & wrapper ) - { - auto & ptr = wrapper.ptr; - - uint32_t id = ar.registerSharedPointer( ptr ); - ar( CEREAL_NVP_("id", id) ); - - if( id & detail::msb_32bit ) - { - ar( CEREAL_NVP_("data", *ptr) ); - } - } - - //! Loading std::shared_ptr, case when user load and construct (wrapper implementation) - /*! @internal */ - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) - { - uint32_t id; - - ar( CEREAL_NVP_("id", id) ); - - if( id & detail::msb_32bit ) - { - // Storage type for the pointer - since we can't default construct this type, - // we'll allocate it using std::aligned_storage and use a custom deleter - using AlignedStorage = typename std::aligned_storage::type; - - // Valid flag - set to true once construction finishes - // This prevents us from calling the destructor on - // uninitialized data. - auto valid = std::make_shared( false ); - - // Allocate our storage, which we will treat as - // uninitialized until initialized with placement new - using NonConstT = typename std::remove_const::type; - std::shared_ptr ptr(reinterpret_cast(new AlignedStorage()), - [=]( NonConstT * t ) - { - if( *valid ) - t->~T(); - - delete reinterpret_cast( t ); - } ); - - // Register the pointer - ar.registerSharedPointer( id, ptr ); - - // Perform the actual loading and allocation - memory_detail::loadAndConstructSharedPtr( ar, ptr.get(), typename ::cereal::traits::has_shared_from_this::type() ); - - // Mark pointer as valid (initialized) - *valid = true; - wrapper.ptr = std::move(ptr); - } - else - wrapper.ptr = std::static_pointer_cast(ar.getSharedPointer(id)); - } - - //! Loading std::shared_ptr, case when no user load and construct (wrapper implementation) - /*! @internal */ - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) - { - uint32_t id; - - ar( CEREAL_NVP_("id", id) ); - - if( id & detail::msb_32bit ) - { - using NonConstT = typename std::remove_const::type; - std::shared_ptr ptr( detail::Construct::load_andor_construct() ); - ar.registerSharedPointer( id, ptr ); - ar( CEREAL_NVP_("data", *ptr) ); - wrapper.ptr = std::move(ptr); - } - else - wrapper.ptr = std::static_pointer_cast(ar.getSharedPointer(id)); - } - - //! Saving std::unique_ptr (wrapper implementation) - /*! @internal */ - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper const &> const & wrapper ) - { - auto & ptr = wrapper.ptr; - - // unique_ptr get one byte of metadata which signifies whether they were a nullptr - // 0 == nullptr - // 1 == not null - - if( !ptr ) - ar( CEREAL_NVP_("valid", uint8_t(0)) ); - else - { - ar( CEREAL_NVP_("valid", uint8_t(1)) ); - ar( CEREAL_NVP_("data", *ptr) ); - } - } - - //! Loading std::unique_ptr, case when user provides load_and_construct (wrapper implementation) - /*! @internal */ - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) - { - uint8_t isValid; - ar( CEREAL_NVP_("valid", isValid) ); - - auto & ptr = wrapper.ptr; - - if( isValid ) - { - using NonConstT = typename std::remove_const::type; - // Storage type for the pointer - since we can't default construct this type, - // we'll allocate it using std::aligned_storage - using AlignedStorage = typename std::aligned_storage::type; - - // Allocate storage - note the AlignedStorage type so that deleter is correct if - // an exception is thrown before we are initialized - std::unique_ptr stPtr( new AlignedStorage() ); - - // Use wrapper to enter into "data" nvp of ptr_wrapper - memory_detail::LoadAndConstructLoadWrapper loadWrapper( reinterpret_cast( stPtr.get() ) ); - - // Initialize storage - ar( CEREAL_NVP_("data", loadWrapper) ); - - // Transfer ownership to correct unique_ptr type - ptr.reset( reinterpret_cast( stPtr.release() ) ); - } - else - ptr.reset( nullptr ); - } - - //! Loading std::unique_ptr, case when no load_and_construct (wrapper implementation) - /*! @internal */ - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, memory_detail::PtrWrapper &> & wrapper ) - { - uint8_t isValid; - ar( CEREAL_NVP_("valid", isValid) ); - - if( isValid ) - { - using NonConstT = typename std::remove_const::type; - std::unique_ptr ptr( detail::Construct::load_andor_construct() ); - ar( CEREAL_NVP_( "data", *ptr ) ); - wrapper.ptr = std::move(ptr); - } - else - { - wrapper.ptr.reset( nullptr ); - } - } -} // namespace cereal - -// automatically include polymorphic support -#include "cereal/types/polymorphic.hpp" - -#endif // CEREAL_TYPES_SHARED_PTR_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/optional.hpp b/cpp/src/cylon/thridparty/cereal/types/optional.hpp deleted file mode 100644 index 402ce0abd..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/optional.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*! \file optional.hpp - \brief Support for std::optional - \ingroup STLSupport */ -/* - Copyright (c) 2017, Juan Pedro Bolivar Puente - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_STD_OPTIONAL_ -#define CEREAL_TYPES_STD_OPTIONAL_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal { - //! Saving for std::optional - template inline - void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, const std::optional& optional) - { - if(!optional) { - ar(CEREAL_NVP_("nullopt", true)); - } else { - ar(CEREAL_NVP_("nullopt", false), - CEREAL_NVP_("data", *optional)); - } - } - - //! Loading for std::optional - template inline - void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, std::optional& optional) - { - bool nullopt; - ar(CEREAL_NVP_("nullopt", nullopt)); - - if (nullopt) { - optional = std::nullopt; - } else { - optional.emplace(); - ar(CEREAL_NVP_("data", *optional)); - } - } -} // namespace cereal - -#endif // CEREAL_TYPES_STD_OPTIONAL_ diff --git a/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp b/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp deleted file mode 100644 index c41a1e8ff..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/polymorphic.hpp +++ /dev/null @@ -1,483 +0,0 @@ -/*! \file polymorphic.hpp - \brief Support for pointers to polymorphic base classes - \ingroup OtherTypes */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_POLYMORPHIC_HPP_ -#define CEREAL_TYPES_POLYMORPHIC_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include "cylon/thridparty/cereal/types/memory.hpp" - -#include "cylon/thridparty/cereal/details/util.hpp" -#include "cylon/thridparty/cereal/details/helpers.hpp" -#include "cylon/thridparty/cereal/details/traits.hpp" -#include "cylon/thridparty/cereal/details/polymorphic_impl.hpp" - -#if defined(_MSC_VER) && _MSC_VER < 1916 -#define CEREAL_STATIC_CONSTEXPR static -#else -#define CEREAL_STATIC_CONSTEXPR static constexpr -#endif - -//! Registers a derived polymorphic type with cereal -/*! Polymorphic types must be registered before smart - pointers to them can be serialized. Note that base - classes do not need to be registered. - - Registering a type lets cereal know how to properly - serialize it when a smart pointer to a base object is - used in conjunction with a derived class. - - This assumes that all relevant archives have also - previously been registered. Registration for archives - is usually done in the header file in which they are - defined. This means that type registration needs to - happen after specific archives to be used are included. - - It is recommended that type registration be done in - the header file in which the type is declared. - - Registration can also be placed in a source file, - but this may require the use of the - CEREAL_REGISTER_DYNAMIC_INIT macro (see below). - - Registration may be called repeatedly for the same - type in different translation units to add support - for additional archives if they are not initially - available (included and registered). - - When building serialization support as a DLL on - Windows, registration must happen in the header file. - On Linux and Mac things should still work properly - if placed in a source file, but see the above comments - on registering in source files. - - Polymorphic support in cereal requires RTTI to be - enabled */ -#define CEREAL_REGISTER_TYPE(...) \ - namespace cereal { \ - namespace detail { \ - template <> \ - struct binding_name<__VA_ARGS__> \ - { \ - CEREAL_STATIC_CONSTEXPR char const * name() { return #__VA_ARGS__; } \ - }; \ - } } /* end namespaces */ \ - CEREAL_BIND_TO_ARCHIVES(__VA_ARGS__) - -//! Registers a polymorphic type with cereal, giving it a -//! user defined name -/*! In some cases the default name used with - CEREAL_REGISTER_TYPE (the name of the type) may not be - suitable. This macro allows any name to be associated - with the type. The name should be unique */ -#define CEREAL_REGISTER_TYPE_WITH_NAME(T, Name) \ - namespace cereal { \ - namespace detail { \ - template <> \ - struct binding_name \ - { CEREAL_STATIC_CONSTEXPR char const * name() { return Name; } }; \ - } } /* end namespaces */ \ - CEREAL_BIND_TO_ARCHIVES(T) - -//! Registers the base-derived relationship for a polymorphic type -/*! When polymorphic serialization occurs, cereal needs to know how to - properly cast between derived and base types for the polymorphic - type. Normally this happens automatically whenever cereal::base_class - or cereal::virtual_base_class are used to serialize a base class. In - cases where neither of these is ever called but a base class still - exists, this explicit registration is required. - - The Derived class should be the most derived type that will be serialized, - and the Base type any possible base that has not been covered under a base - class serialization that will be used to store a Derived pointer. - - Placement of this is the same as for CEREAL_REGISTER_TYPE. */ -#define CEREAL_REGISTER_POLYMORPHIC_RELATION(Base, Derived) \ - namespace cereal { \ - namespace detail { \ - template <> \ - struct PolymorphicRelation \ - { static void bind() { RegisterPolymorphicCaster::bind(); } }; \ - } } /* end namespaces */ - -//! Adds a way to force initialization of a translation unit containing -//! calls to CEREAL_REGISTER_TYPE -/*! In C++, dynamic initialization of non-local variables of a translation - unit may be deferred until "the first odr-use of any function or variable - defined in the same translation unit as the variable to be initialized." - - Informally, odr-use means that your program takes the address of or binds - a reference directly to an object, which must have a definition. - - Since polymorphic type support in cereal relies on the dynamic - initialization of certain global objects happening before - serialization is performed, it is important to ensure that something - from files that call CEREAL_REGISTER_TYPE is odr-used before serialization - occurs, otherwise the registration will never take place. This may often - be the case when serialization is built as a shared library external from - your main program. - - This macro, with any name of your choosing, should be placed into the - source file that contains calls to CEREAL_REGISTER_TYPE. - - Its counterpart, CEREAL_FORCE_DYNAMIC_INIT, should be placed in its - associated header file such that it is included in the translation units - (source files) in which you want the registration to appear. - - @relates CEREAL_FORCE_DYNAMIC_INIT - */ -#define CEREAL_REGISTER_DYNAMIC_INIT(LibName) \ - namespace cereal { \ - namespace detail { \ - void CEREAL_DLL_EXPORT dynamic_init_dummy_##LibName() {} \ - } } /* end namespaces */ - -//! Forces dynamic initialization of polymorphic support in a -//! previously registered source file -/*! @sa CEREAL_REGISTER_DYNAMIC_INIT - - See CEREAL_REGISTER_DYNAMIC_INIT for detailed explanation - of how this macro should be used. The name used should - match that for CEREAL_REGISTER_DYNAMIC_INIT. */ -#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \ - namespace cereal { \ - namespace detail { \ - void CEREAL_DLL_EXPORT dynamic_init_dummy_##LibName(); \ - } /* end detail */ \ - } /* end cereal */ \ - namespace { \ - struct dynamic_init_##LibName { \ - dynamic_init_##LibName() { \ - ::cereal::detail::dynamic_init_dummy_##LibName(); \ - } \ - } dynamic_init_instance_##LibName; \ - } /* end anonymous namespace */ - -namespace cereal -{ - namespace polymorphic_detail - { - //! Error message used for unregistered polymorphic types - /*! @internal */ - #define UNREGISTERED_POLYMORPHIC_EXCEPTION(LoadSave, Name) \ - throw cereal::Exception("Trying to " #LoadSave " an unregistered polymorphic type (" + Name + ").\n" \ - "Make sure your type is registered with CEREAL_REGISTER_TYPE and that the archive " \ - "you are using was included (and registered with CEREAL_REGISTER_ARCHIVE) prior to calling CEREAL_REGISTER_TYPE.\n" \ - "If your type is already registered and you still see this error, you may need to use CEREAL_REGISTER_DYNAMIC_INIT."); - - //! Get an input binding from the given archive by deserializing the type meta data - /*! @internal */ - template inline - typename ::cereal::detail::InputBindingMap::Serializers getInputBinding(Archive & ar, std::uint32_t const nameid) - { - // If the nameid is zero, we serialized a null pointer - if(nameid == 0) - { - typename ::cereal::detail::InputBindingMap::Serializers emptySerializers; - emptySerializers.shared_ptr = [](void*, std::shared_ptr & ptr, std::type_info const &) { ptr.reset(); }; - emptySerializers.unique_ptr = [](void*, std::unique_ptr> & ptr, std::type_info const &) { ptr.reset( nullptr ); }; - return emptySerializers; - } - - std::string name; - if(nameid & detail::msb_32bit) - { - ar( CEREAL_NVP_("polymorphic_name", name) ); - ar.registerPolymorphicName(nameid, name); - } - else - name = ar.getPolymorphicName(nameid); - - auto const & bindingMap = detail::StaticObject>::getInstance().map; - - auto binding = bindingMap.find(name); - if(binding == bindingMap.end()) - UNREGISTERED_POLYMORPHIC_EXCEPTION(load, name) - return binding->second; - } - - //! Serialize a shared_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee - /*! This check lets us try and skip doing polymorphic machinery if we can get away with - using the derived class serialize function - - Note that on MSVC 2013 preview, is_default_constructible returns true for abstract classes with - default constructors, but on clang/gcc this will return false. So we also need to check for that here. - @internal */ - template inline - typename std::enable_if<(traits::is_default_constructible::value - || traits::has_load_and_construct::value) - && !std::is_abstract::value, bool>::type - serialize_wrapper(Archive & ar, std::shared_ptr & ptr, std::uint32_t const nameid) - { - if(nameid & detail::msb2_32bit) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); - return true; - } - return false; - } - - //! Serialize a unique_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee - /*! This check lets us try and skip doing polymorphic machinery if we can get away with - using the derived class serialize function - @internal */ - template inline - typename std::enable_if<(traits::is_default_constructible::value - || traits::has_load_and_construct::value) - && !std::is_abstract::value, bool>::type - serialize_wrapper(Archive & ar, std::unique_ptr & ptr, std::uint32_t const nameid) - { - if(nameid & detail::msb2_32bit) - { - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); - return true; - } - return false; - } - - //! Serialize a shared_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee - /*! This case is for when we can't actually construct the shared pointer. Normally this would be caught - as the pointer itself is serialized, but since this is a polymorphic pointer, if we tried to serialize - the pointer we'd end up back here recursively. So we have to catch the error here as well, if - this was a polymorphic type serialized by its proper pointer type - @internal */ - template inline - typename std::enable_if<(!traits::is_default_constructible::value - && !traits::has_load_and_construct::value) - || std::is_abstract::value, bool>::type - serialize_wrapper(Archive &, std::shared_ptr &, std::uint32_t const nameid) - { - if(nameid & detail::msb2_32bit) - throw cereal::Exception("Cannot load a polymorphic type that is not default constructable and does not have a load_and_construct function"); - return false; - } - - //! Serialize a unique_ptr if the 2nd msb in the nameid is set, and if we can actually construct the pointee - /*! This case is for when we can't actually construct the unique pointer. Normally this would be caught - as the pointer itself is serialized, but since this is a polymorphic pointer, if we tried to serialize - the pointer we'd end up back here recursively. So we have to catch the error here as well, if - this was a polymorphic type serialized by its proper pointer type - @internal */ - template inline - typename std::enable_if<(!traits::is_default_constructible::value - && !traits::has_load_and_construct::value) - || std::is_abstract::value, bool>::type - serialize_wrapper(Archive &, std::unique_ptr &, std::uint32_t const nameid) - { - if(nameid & detail::msb2_32bit) - throw cereal::Exception("Cannot load a polymorphic type that is not default constructable and does not have a load_and_construct function"); - return false; - } - } // polymorphic_detail - - // ###################################################################### - // Pointer serialization for polymorphic types - - //! Saving std::shared_ptr for polymorphic types, abstract - template inline - typename std::enable_if::value && std::is_abstract::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) - { - if(!ptr) - { - // same behavior as nullptr in memory implementation - ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); - return; - } - - std::type_info const & ptrinfo = typeid(*ptr.get()); - static std::type_info const & tinfo = typeid(T); - // ptrinfo can never be equal to T info since we can't have an instance - // of an abstract object - // this implies we need to do the lookup - - auto const & bindingMap = detail::StaticObject>::getInstance().map; - - auto binding = bindingMap.find(std::type_index(ptrinfo)); - if(binding == bindingMap.end()) - UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) - - binding->second.shared_ptr(&ar, ptr.get(), tinfo); - } - - //! Saving std::shared_ptr for polymorphic types, not abstract - template inline - typename std::enable_if::value && !std::is_abstract::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::shared_ptr const & ptr ) - { - if(!ptr) - { - // same behavior as nullptr in memory implementation - ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); - return; - } - - std::type_info const & ptrinfo = typeid(*ptr.get()); - static std::type_info const & tinfo = typeid(T); - - if(ptrinfo == tinfo) - { - // The 2nd msb signals that the following pointer does not need to be - // cast with our polymorphic machinery - ar( CEREAL_NVP_("polymorphic_id", detail::msb2_32bit) ); - - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); - - return; - } - - auto const & bindingMap = detail::StaticObject>::getInstance().map; - - auto binding = bindingMap.find(std::type_index(ptrinfo)); - if(binding == bindingMap.end()) - UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) - - binding->second.shared_ptr(&ar, ptr.get(), tinfo); - } - - //! Loading std::shared_ptr for polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::shared_ptr & ptr ) - { - std::uint32_t nameid; - ar( CEREAL_NVP_("polymorphic_id", nameid) ); - - // Check to see if we can skip all of this polymorphism business - if(polymorphic_detail::serialize_wrapper(ar, ptr, nameid)) - return; - - auto binding = polymorphic_detail::getInputBinding(ar, nameid); - std::shared_ptr result; - binding.shared_ptr(&ar, result, typeid(T)); - ptr = std::static_pointer_cast(result); - } - - //! Saving std::weak_ptr for polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::weak_ptr const & ptr ) - { - auto const sptr = ptr.lock(); - ar( CEREAL_NVP_("locked_ptr", sptr) ); - } - - //! Loading std::weak_ptr for polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::weak_ptr & ptr ) - { - std::shared_ptr sptr; - ar( CEREAL_NVP_("locked_ptr", sptr) ); - ptr = sptr; - } - - //! Saving std::unique_ptr for polymorphic types that are abstract - template inline - typename std::enable_if::value && std::is_abstract::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) - { - if(!ptr) - { - // same behavior as nullptr in memory implementation - ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); - return; - } - - std::type_info const & ptrinfo = typeid(*ptr.get()); - static std::type_info const & tinfo = typeid(T); - // ptrinfo can never be equal to T info since we can't have an instance - // of an abstract object - // this implies we need to do the lookup - - auto const & bindingMap = detail::StaticObject>::getInstance().map; - - auto binding = bindingMap.find(std::type_index(ptrinfo)); - if(binding == bindingMap.end()) - UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) - - binding->second.unique_ptr(&ar, ptr.get(), tinfo); - } - - //! Saving std::unique_ptr for polymorphic types, not abstract - template inline - typename std::enable_if::value && !std::is_abstract::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unique_ptr const & ptr ) - { - if(!ptr) - { - // same behavior as nullptr in memory implementation - ar( CEREAL_NVP_("polymorphic_id", std::uint32_t(0)) ); - return; - } - - std::type_info const & ptrinfo = typeid(*ptr.get()); - static std::type_info const & tinfo = typeid(T); - - if(ptrinfo == tinfo) - { - // The 2nd msb signals that the following pointer does not need to be - // cast with our polymorphic machinery - ar( CEREAL_NVP_("polymorphic_id", detail::msb2_32bit) ); - - ar( CEREAL_NVP_("ptr_wrapper", memory_detail::make_ptr_wrapper(ptr)) ); - - return; - } - - auto const & bindingMap = detail::StaticObject>::getInstance().map; - - auto binding = bindingMap.find(std::type_index(ptrinfo)); - if(binding == bindingMap.end()) - UNREGISTERED_POLYMORPHIC_EXCEPTION(save, cereal::util::demangle(ptrinfo.name())) - - binding->second.unique_ptr(&ar, ptr.get(), tinfo); - } - - //! Loading std::unique_ptr, case when user provides load_and_construct for polymorphic types - template inline - typename std::enable_if::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unique_ptr & ptr ) - { - std::uint32_t nameid; - ar( CEREAL_NVP_("polymorphic_id", nameid) ); - - // Check to see if we can skip all of this polymorphism business - if(polymorphic_detail::serialize_wrapper(ar, ptr, nameid)) - return; - - auto binding = polymorphic_detail::getInputBinding(ar, nameid); - std::unique_ptr> result; - binding.unique_ptr(&ar, result, typeid(T)); - ptr.reset(static_cast(result.release())); - } - - #undef UNREGISTERED_POLYMORPHIC_EXCEPTION -} // namespace cereal -#endif // CEREAL_TYPES_POLYMORPHIC_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/queue.hpp b/cpp/src/cylon/thridparty/cereal/types/queue.hpp deleted file mode 100644 index 3b602ac99..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/queue.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/*! \file queue.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_QUEUE_HPP_ -#define CEREAL_TYPES_QUEUE_HPP_ - -#include "cylon/thridparty/cereal/details/helpers.hpp" -#include - -// The default container for queue is deque, so let's include that too -#include "cereal/types/deque.hpp" -// The default comparator for queue is less -#include "cereal/types/functional.hpp" - -namespace cereal -{ - namespace queue_detail - { - //! Allows access to the protected container in queue - /*! @internal */ - template inline - C const & container( std::queue const & queue ) - { - struct H : public std::queue - { - static C const & get( std::queue const & q ) - { - return q.*(&H::c); - } - }; - - return H::get( queue ); - } - - //! Allows access to the protected container in priority queue - /*! @internal */ - template inline - C const & container( std::priority_queue const & priority_queue ) - { - struct H : public std::priority_queue - { - static C const & get( std::priority_queue const & pq ) - { - return pq.*(&H::c); - } - }; - - return H::get( priority_queue ); - } - - //! Allows access to the protected comparator in priority queue - /*! @internal */ - template inline - Comp const & comparator( std::priority_queue const & priority_queue ) - { - struct H : public std::priority_queue - { - static Comp const & get( std::priority_queue const & pq ) - { - return pq.*(&H::comp); - } - }; - - return H::get( priority_queue ); - } - } - - //! Saving for std::queue - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::queue const & queue ) - { - ar( CEREAL_NVP_("container", queue_detail::container( queue )) ); - } - - //! Loading for std::queue - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::queue & queue ) - { - C container; - ar( CEREAL_NVP_("container", container) ); - queue = std::queue( std::move( container ) ); - } - - //! Saving for std::priority_queue - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::priority_queue const & priority_queue ) - { - ar( CEREAL_NVP_("comparator", queue_detail::comparator( priority_queue )) ); - ar( CEREAL_NVP_("container", queue_detail::container( priority_queue )) ); - } - - //! Loading for std::priority_queue - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::priority_queue & priority_queue ) - { - Comp comparator; - ar( CEREAL_NVP_("comparator", comparator) ); - - C container; - ar( CEREAL_NVP_("container", container) ); - - priority_queue = std::priority_queue( comparator, std::move( container ) ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_QUEUE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/set.hpp b/cpp/src/cylon/thridparty/cereal/types/set.hpp deleted file mode 100644 index f00034311..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/set.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*! \file set.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_SET_HPP_ -#define CEREAL_TYPES_SET_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - namespace set_detail - { - //! @internal - template inline - void save( Archive & ar, SetT const & set ) - { - ar( make_size_tag( static_cast(set.size()) ) ); - - for( const auto & i : set ) - ar( i ); - } - - //! @internal - template inline - void load( Archive & ar, SetT & set ) - { - size_type size; - ar( make_size_tag( size ) ); - - set.clear(); - - auto hint = set.begin(); - for( size_type i = 0; i < size; ++i ) - { - typename SetT::key_type key; - - ar( key ); - #ifdef CEREAL_OLDER_GCC - hint = set.insert( hint, std::move( key ) ); - #else // NOT CEREAL_OLDER_GCC - hint = set.emplace_hint( hint, std::move( key ) ); - #endif // NOT CEREAL_OLDER_GCC - } - } - } - - //! Saving for std::set - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::set const & set ) - { - set_detail::save( ar, set ); - } - - //! Loading for std::set - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::set & set ) - { - set_detail::load( ar, set ); - } - - //! Saving for std::multiset - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::multiset const & multiset ) - { - set_detail::save( ar, multiset ); - } - - //! Loading for std::multiset - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::multiset & multiset ) - { - set_detail::load( ar, multiset ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_SET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/stack.hpp b/cpp/src/cylon/thridparty/cereal/types/stack.hpp deleted file mode 100644 index 564a5520f..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/stack.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/*! \file stack.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_STACK_HPP_ -#define CEREAL_TYPES_STACK_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -// The default container for stack is deque, so let's include that too -#include "cylon/thridparty/cereal/types/deque.hpp" - -namespace cereal -{ - namespace stack_detail - { - //! Allows access to the protected container in stack - template inline - C const & container( std::stack const & stack ) - { - struct H : public std::stack - { - static C const & get( std::stack const & s ) - { - return s.*(&H::c); - } - }; - - return H::get( stack ); - } - } - - //! Saving for std::stack - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::stack const & stack ) - { - ar( CEREAL_NVP_("container", stack_detail::container( stack )) ); - } - - //! Loading for std::stack - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::stack & stack ) - { - C container; - ar( CEREAL_NVP_("container", container) ); - stack = std::stack( std::move( container ) ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_STACK_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/string.hpp b/cpp/src/cylon/thridparty/cereal/types/string.hpp deleted file mode 100644 index 72480f365..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/string.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*! \file string.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_STRING_HPP_ -#define CEREAL_TYPES_STRING_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Serialization for basic_string types, if binary data is supported - template inline - typename std::enable_if, Archive>::value, void>::type - CEREAL_SAVE_FUNCTION_NAME(Archive & ar, std::basic_string const & str) - { - // Save number of chars + the data - ar( make_size_tag( static_cast(str.size()) ) ); - ar( binary_data( str.data(), str.size() * sizeof(CharT) ) ); - } - - //! Serialization for basic_string types, if binary data is supported - template inline - typename std::enable_if, Archive>::value, void>::type - CEREAL_LOAD_FUNCTION_NAME(Archive & ar, std::basic_string & str) - { - size_type size; - ar( make_size_tag( size ) ); - str.resize(static_cast(size)); - ar( binary_data( const_cast( str.data() ), static_cast(size) * sizeof(CharT) ) ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_STRING_HPP_ - diff --git a/cpp/src/cylon/thridparty/cereal/types/tuple.hpp b/cpp/src/cylon/thridparty/cereal/types/tuple.hpp deleted file mode 100644 index 4dac862c7..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/tuple.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/*! \file tuple.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_TUPLE_HPP_ -#define CEREAL_TYPES_TUPLE_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - namespace tuple_detail - { - //! Creates a c string from a sequence of characters - /*! The c string created will always be prefixed by "tuple_element" - Based on code from: http://stackoverflow/a/20973438/710791 - @internal */ - template - struct char_seq_to_c_str - { - static const int size = 14;// Size of array for the word: tuple_element - typedef const char (&arr_type)[sizeof...(Cs) + size]; - static const char str[sizeof...(Cs) + size]; - }; - - // the word tuple_element plus a number - //! @internal - template - const char char_seq_to_c_str::str[sizeof...(Cs) + size] = - {'t','u','p','l','e','_','e','l','e','m','e','n','t', Cs..., '\0'}; - - //! Converts a number into a sequence of characters - /*! @tparam Q The quotient of dividing the original number by 10 - @tparam R The remainder of dividing the original number by 10 - @tparam C The sequence built so far - @internal */ - template - struct to_string_impl - { - using type = typename to_string_impl(R+std::size_t{'0'}), C...>::type; - }; - - //! Base case with no quotient - /*! @internal */ - template - struct to_string_impl<0, R, C...> - { - using type = char_seq_to_c_str(R+std::size_t{'0'}), C...>; - }; - - //! Generates a c string for a given index of a tuple - /*! Example use: - @code{cpp} - tuple_element_name<3>::c_str();// returns "tuple_element3" - @endcode - @internal */ - template - struct tuple_element_name - { - using type = typename to_string_impl::type; - static const typename type::arr_type c_str(){ return type::str; } - }; - - // unwinds a tuple to save it - //! @internal - template - struct serialize - { - template inline - static void apply( Archive & ar, std::tuple & tuple ) - { - serialize::template apply( ar, tuple ); - ar( CEREAL_NVP_(tuple_element_name::c_str(), - std::get( tuple )) ); - } - }; - - // Zero height specialization - nothing to do here - //! @internal - template <> - struct serialize<0> - { - template inline - static void apply( Archive &, std::tuple & ) - { } - }; - } - - //! Serializing for std::tuple - template inline - void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::tuple & tuple ) - { - tuple_detail::serialize>::value>::template apply( ar, tuple ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_TUPLE_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp b/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp deleted file mode 100644 index b70a0be4e..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/unordered_map.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/*! \file unordered_map.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_UNORDERED_MAP_HPP_ -#define CEREAL_TYPES_UNORDERED_MAP_HPP_ - -#include "cylon/thridparty/cereal/types/concepts/pair_associative_container.hpp" -#include - -#endif // CEREAL_TYPES_UNORDERED_MAP_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp b/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp deleted file mode 100644 index 6334ac727..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/unordered_set.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*! \file unordered_set.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_UNORDERED_SET_HPP_ -#define CEREAL_TYPES_UNORDERED_SET_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - namespace unordered_set_detail - { - //! @internal - template inline - void save( Archive & ar, SetT const & set ) - { - ar( make_size_tag( static_cast(set.size()) ) ); - - for( const auto & i : set ) - ar( i ); - } - - //! @internal - template inline - void load( Archive & ar, SetT & set ) - { - size_type size; - ar( make_size_tag( size ) ); - - set.clear(); - set.reserve( static_cast( size ) ); - - for( size_type i = 0; i < size; ++i ) - { - typename SetT::key_type key; - - ar( key ); - set.emplace( std::move( key ) ); - } - } - } - - //! Saving for std::unordered_set - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unordered_set const & unordered_set ) - { - unordered_set_detail::save( ar, unordered_set ); - } - - //! Loading for std::unordered_set - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unordered_set & unordered_set ) - { - unordered_set_detail::load( ar, unordered_set ); - } - - //! Saving for std::unordered_multiset - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::unordered_multiset const & unordered_multiset ) - { - unordered_set_detail::save( ar, unordered_multiset ); - } - - //! Loading for std::unordered_multiset - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::unordered_multiset & unordered_multiset ) - { - unordered_set_detail::load( ar, unordered_multiset ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_UNORDERED_SET_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/utility.hpp b/cpp/src/cylon/thridparty/cereal/types/utility.hpp deleted file mode 100644 index 82ce0559f..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/utility.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*! \file utility.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_UTILITY_HPP_ -#define CEREAL_TYPES_UTILITY_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Serializing for std::pair - template inline - void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::pair & pair ) - { - ar( CEREAL_NVP_("first", pair.first), - CEREAL_NVP_("second", pair.second) ); - } -} // namespace cereal - -#endif // CEREAL_TYPES_UTILITY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/valarray.hpp b/cpp/src/cylon/thridparty/cereal/types/valarray.hpp deleted file mode 100644 index 546840993..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/valarray.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/*! \file valarray.hpp -\brief Support for types found in \ -\ingroup STLSupport */ - -/* -Copyright (c) 2014, Randolph Voorhies, Shane Grant -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -* Neither the name of cereal nor the -names of its contributors may be used to endorse or promote products -derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CEREAL_TYPES_VALARRAY_HPP_ -#define CEREAL_TYPES_VALARRAY_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Saving for std::valarray arithmetic types, using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::valarray const & valarray ) - { - ar( make_size_tag( static_cast(valarray.size()) ) ); // number of elements - ar( binary_data( &valarray[0], valarray.size() * sizeof(T) ) ); // &valarray[0] ok since guaranteed contiguous - } - - //! Loading for std::valarray arithmetic types, using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::valarray & valarray ) - { - size_type valarraySize; - ar( make_size_tag( valarraySize ) ); - - valarray.resize( static_cast( valarraySize ) ); - ar( binary_data( &valarray[0], static_cast( valarraySize ) * sizeof(T) ) ); - } - - //! Saving for std::valarray all other types - template inline - typename std::enable_if, Archive>::value - || !std::is_arithmetic::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::valarray const & valarray ) - { - ar( make_size_tag( static_cast(valarray.size()) ) ); // number of elements - for(auto && v : valarray) - ar(v); - } - - //! Loading for std::valarray all other types - template inline - typename std::enable_if, Archive>::value - || !std::is_arithmetic::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::valarray & valarray ) - { - size_type valarraySize; - ar( make_size_tag( valarraySize ) ); - - valarray.resize( static_cast( valarraySize ) ); - for(auto && v : valarray) - ar(v); - } -} // namespace cereal - -#endif // CEREAL_TYPES_VALARRAY_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/variant.hpp b/cpp/src/cylon/thridparty/cereal/types/variant.hpp deleted file mode 100644 index e67c76f3e..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/variant.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/*! \file variant.hpp - \brief Support for std::variant - \ingroup STLSupport */ -/* - Copyright (c) 2014, 2017, Randolph Voorhies, Shane Grant, Juan Pedro - Bolivar Puente. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_STD_VARIANT_HPP_ -#define CEREAL_TYPES_STD_VARIANT_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include -#include - -namespace cereal -{ - namespace variant_detail - { - //! @internal - template - struct variant_save_visitor - { - variant_save_visitor(Archive & ar_) : ar(ar_) {} - - template - void operator()(T const & value) const - { - ar( CEREAL_NVP_("data", value) ); - } - - Archive & ar; - }; - - //! @internal - template - typename std::enable_if, void>::type - load_variant(Archive & /*ar*/, int /*target*/, Variant & /*variant*/) - { - throw ::cereal::Exception("Error traversing variant during load"); - } - //! @internal - template - typename std::enable_if, void>::type - load_variant(Archive & ar, int target, Variant & variant) - { - if(N == target) - { - variant.template emplace(); - ar( CEREAL_NVP_("data", std::get(variant)) ); - } - else - load_variant(ar, target, variant); - } - - } // namespace variant_detail - - //! Saving for std::variant - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::variant const & variant ) - { - std::int32_t index = static_cast(variant.index()); - ar( CEREAL_NVP_("index", index) ); - variant_detail::variant_save_visitor visitor(ar); - std::visit(visitor, variant); - } - - //! Loading for std::variant - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::variant & variant ) - { - using variant_t = typename std::variant; - - std::int32_t index; - ar( CEREAL_NVP_("index", index) ); - if(index >= static_cast(std::variant_size_v)) - throw Exception("Invalid 'index' selector when deserializing std::variant"); - - variant_detail::load_variant<0>(ar, index, variant); - } - - //! Serializing a std::monostate - template - void CEREAL_SERIALIZE_FUNCTION_NAME( Archive &, std::monostate const & ) {} -} // namespace cereal - -#endif // CEREAL_TYPES_STD_VARIANT_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/types/vector.hpp b/cpp/src/cylon/thridparty/cereal/types/vector.hpp deleted file mode 100644 index 1374be40c..000000000 --- a/cpp/src/cylon/thridparty/cereal/types/vector.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/*! \file vector.hpp - \brief Support for types found in \ - \ingroup STLSupport */ -/* - Copyright (c) 2014, Randolph Voorhies, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef CEREAL_TYPES_VECTOR_HPP_ -#define CEREAL_TYPES_VECTOR_HPP_ - -#include "cylon/thridparty/cereal/cereal.hpp" -#include - -namespace cereal -{ - //! Serialization for std::vectors of arithmetic (but not bool) using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value && !std::is_same::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) - { - ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements - ar( binary_data( vector.data(), vector.size() * sizeof(T) ) ); - } - - //! Serialization for std::vectors of arithmetic (but not bool) using binary serialization, if supported - template inline - typename std::enable_if, Archive>::value - && std::is_arithmetic::value && !std::is_same::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) - { - size_type vectorSize; - ar( make_size_tag( vectorSize ) ); - - vector.resize( static_cast( vectorSize ) ); - ar( binary_data( vector.data(), static_cast( vectorSize ) * sizeof(T) ) ); - } - - //! Serialization for non-arithmetic vector types - template inline - typename std::enable_if<(!traits::is_output_serializable, Archive>::value - || !std::is_arithmetic::value) && !std::is_same::value, void>::type - CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) - { - ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements - for(auto && v : vector) - ar( v ); - } - - //! Serialization for non-arithmetic vector types - template inline - typename std::enable_if<(!traits::is_input_serializable, Archive>::value - || !std::is_arithmetic::value) && !std::is_same::value, void>::type - CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) - { - size_type size; - ar( make_size_tag( size ) ); - - vector.resize( static_cast( size ) ); - for(auto && v : vector) - ar( v ); - } - - //! Serialization for bool vector types - template inline - void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::vector const & vector ) - { - ar( make_size_tag( static_cast(vector.size()) ) ); // number of elements - for(const auto v : vector) - ar( static_cast(v) ); - } - - //! Serialization for bool vector types - template inline - void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::vector & vector ) - { - size_type size; - ar( make_size_tag( size ) ); - - vector.resize( static_cast( size ) ); - for(auto && v : vector) - { - bool b; - ar( b ); - v = b; - } - } -} // namespace cereal - -#endif // CEREAL_TYPES_VECTOR_HPP_ diff --git a/cpp/src/cylon/thridparty/cereal/version.hpp b/cpp/src/cylon/thridparty/cereal/version.hpp deleted file mode 100644 index 0ad7d41cf..000000000 --- a/cpp/src/cylon/thridparty/cereal/version.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*! \file version.hpp - \brief Macros to detect cereal version - - These macros can assist in determining the version of cereal. Be - warned that cereal is not guaranteed to be compatible across - different versions. For more information on releases of cereal, - see https://github.com/USCiLab/cereal/releases. - - \ingroup utility */ -/* - Copyright (c) 2018, Shane Grant - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef CEREAL_VERSION_HPP_ -#define CEREAL_VERSION_HPP_ - -//! The major version -#define CEREAL_VERSION_MAJOR 1 -//! The minor version -#define CEREAL_VERSION_MINOR 3 -//! The patch version -#define CEREAL_VERSION_PATCH 2 - -//! The full version as a single number -#define CEREAL_VERSION (CEREAL_VERSION_MAJOR * 10000 \ - + CEREAL_VERSION_MINOR * 100 \ - + CEREAL_VERSION_PATCH) - -#endif // CEREAL_VERSION_HPP_ From 5dabd61a52162a73cdf431f59cc7ce17c8af7808 Mon Sep 17 00:00:00 2001 From: mstaylor Date: Sun, 10 Sep 2023 12:36:20 -0400 Subject: [PATCH 05/19] updates aws dockerfile to include local ucx build --- docker/aws/Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile index 3c30ed1c0..55c6cd48d 100644 --- a/docker/aws/Dockerfile +++ b/docker/aws/Dockerfile @@ -9,6 +9,7 @@ ENV PATH /opt/conda/bin:$PATH ENV CYLON_HOME=/cylon ENV CYLON_PREFIX=/cylon/install ENV UCC_HOME=/ucc +ENV UCX_HOME=/ucx #give ARG EXPOSE_ENV a default value ARG EXPOSE_ENV=33000 @@ -44,7 +45,7 @@ RUN cd $CYLON_HOME && git checkout -b aws-docker-support origin/aws-docker-suppo SHELL ["/bin/bash", "--login", "-c"] -RUN conda env create -f $CYLON_HOME/conda/environments/cylon.yml +RUN conda env create -f $CYLON_HOME/conda/environments/cylon_NoUCX.yml RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate cylon_dev && \ @@ -57,12 +58,19 @@ RUN . /opt/conda/etc/profile.d/conda.sh && \ RUN apt-get update && apt-get install autoconf -y && apt-get install libtool -y && apt-get install cmake -y && \ apt-get install libnuma-dev -y +#UCX install +RUN git clone --single-branch -b master https://github.com/openucx/ucx.git $UCX_HOME +RUN cd $UCX_HOME && \ + ./autogen.sh && \ + ./configure --prefix=$UCX_HOME/install && \ + make install + #UCC install RUN git clone --single-branch -b master https://github.com/openucx/ucc.git $UCC_HOME RUN cd $UCC_HOME && \ ./autogen.sh && \ - ./configure --prefix=$UCC_HOME/install --with-ucx=/opt/conda/envs/cylon_dev && \ + ./configure --prefix=$UCC_HOME/install --with-ucx=$UCX_HOME/install && \ make install #REDIS install @@ -81,7 +89,7 @@ RUN git clone https://github.com/redis/hiredis.git /hiredis && \ RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate cylon_dev && \ cd $CYLON_HOME && \ - python build.py -cmake-flags="-DCYLON_UCX=1 -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_HOME/install -DCYLON_USE_REDIS=1 " -ipath="$CYLON_PREFIX" --cpp --python --test --pytest + python build.py -cmake-flags="-DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_HOME/install -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_HOME/install -DCYLON_USE_REDIS=1 " -ipath="$CYLON_PREFIX" --cpp --python --test --pytest RUN chmod 0755 /cylon/aws/scripts/runCylon.sh From a1ab85b765d759570f1334d6726e7b298d065601 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Sun, 10 Sep 2023 19:14:52 -0400 Subject: [PATCH 06/19] aws docker support - adds ucx local support (fixes issue with wrong branch) --- docker/aws/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile index 55c6cd48d..351ce02e7 100644 --- a/docker/aws/Dockerfile +++ b/docker/aws/Dockerfile @@ -39,7 +39,7 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-L RUN git clone https://github.com/mstaylor/cylon.git $CYLON_HOME -RUN cd $CYLON_HOME && git checkout -b aws-docker-support origin/aws-docker-support +RUN cd $CYLON_HOME && git checkout -b ucc-ucx-redis-local-ucx origin/ucc-ucx-redis-local-ucx From 0521735963531e5c4e2a2363892f5a2f00b4c934 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Tue, 12 Sep 2023 12:17:01 -0400 Subject: [PATCH 07/19] aws docker support - adds ucx local support - partial - changes to mstaylor's fork of UCX --- docker/aws/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile index 351ce02e7..aba956bf1 100644 --- a/docker/aws/Dockerfile +++ b/docker/aws/Dockerfile @@ -36,13 +36,10 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-L echo "export LD_LIBRARY_PATH=$CYLON_PREFIX"/lib >> ~/.bashrc - - RUN git clone https://github.com/mstaylor/cylon.git $CYLON_HOME RUN cd $CYLON_HOME && git checkout -b ucc-ucx-redis-local-ucx origin/ucc-ucx-redis-local-ucx - SHELL ["/bin/bash", "--login", "-c"] RUN conda env create -f $CYLON_HOME/conda/environments/cylon_NoUCX.yml @@ -59,8 +56,9 @@ RUN apt-get update && apt-get install autoconf -y && apt-get install libtool - apt-get install libnuma-dev -y #UCX install -RUN git clone --single-branch -b master https://github.com/openucx/ucx.git $UCX_HOME -RUN cd $UCX_HOME && \ +#Note: Includes support for overriding device eth address +RUN git clone --single-branch -b master https://github.com/mstaylor/ucx.git $UCX_HOME +RUN cd $UCX_HOME && git checkout -b override-remote-address3 origin/override-remote-address3 \ ./autogen.sh && \ ./configure --prefix=$UCX_HOME/install && \ make install From 3bea691acca519e4bc37854635fb27f3a65cee06 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Tue, 12 Sep 2023 13:07:32 -0400 Subject: [PATCH 08/19] aws docker support - adds ucx local support - partial - changes to mstaylor's fork of UCX --- docker/aws/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile index aba956bf1..f0a5a684f 100644 --- a/docker/aws/Dockerfile +++ b/docker/aws/Dockerfile @@ -57,8 +57,8 @@ RUN apt-get update && apt-get install autoconf -y && apt-get install libtool - #UCX install #Note: Includes support for overriding device eth address -RUN git clone --single-branch -b master https://github.com/mstaylor/ucx.git $UCX_HOME -RUN cd $UCX_HOME && git checkout -b override-remote-address3 origin/override-remote-address3 \ +RUN git clone --single-branch -b override-remote-address3 https://github.com/mstaylor/ucx.git $UCX_HOME +RUN cd $UCX_HOME && \ ./autogen.sh && \ ./configure --prefix=$UCX_HOME/install && \ make install From 861c5a9b3a94a1fd33ead3e0a83ee33c67dbf98c Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Tue, 12 Sep 2023 18:41:09 -0400 Subject: [PATCH 09/19] aws docker support - adds ucx local support - partial - boto3 test code that extracts a Private IP address from a Fargate ENI --- aws/scripts/TestGetEniLocalIp.py | 348 +++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 aws/scripts/TestGetEniLocalIp.py diff --git a/aws/scripts/TestGetEniLocalIp.py b/aws/scripts/TestGetEniLocalIp.py new file mode 100644 index 000000000..30c0e9eed --- /dev/null +++ b/aws/scripts/TestGetEniLocalIp.py @@ -0,0 +1,348 @@ +import time +import argparse + +import pandas as pd +from numpy.random import default_rng +from pycylon.frame import CylonEnv, DataFrame +from cloudmesh.common.StopWatch import StopWatch +from cloudmesh.common.dotdict import dotdict +from cloudmesh.common.Shell import Shell +from cloudmesh.common.util import writefile +from pycylon.net.ucc_config import UCCConfig +from pycylon.net.redis_ucc_oob_context import UCCRedisOOBContext +from pycylon.net.reduce_op import ReduceOp +import boto3 +from botocore.exceptions import ClientError +import os +import requests +import json + +import logging + +def environ_or_required(key): + return ( + {'default': os.environ.get(key)} if os.environ.get(key) + else {'required': True} + ) +def upload_file(file_name, bucket, object_name=None): + """Upload a file to an S3 bucket + + :param file_name: File to upload + :param bucket: Bucket to upload to + :param object_name: S3 object name. If not specified then file_name is used + :return: True if file was uploaded, else False + """ + + # If S3 object_name was not specified, use file_name + if object_name is None: + object_name = os.path.basename(file_name) + + # Upload the file + s3_client = boto3.client('s3') + try: + response = s3_client.upload_file(file_name, bucket, object_name) + except ClientError as e: + logging.error(e) + return False + return True + + +def cylon_join(data=None): + global ucc_config + StopWatch.start(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) * 1000 + # sum_t = comm.reduce(t) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + + +def cylon_sort(data=None): + StopWatch.start(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.sort_values(by=[0], env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + + + StopWatch.stop(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + redis_context.clearDB() + + +def cylon_slice(data=None): + StopWatch.start(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1[0:20000000, env] # distributed slice + # print(df3) + # df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + + +def get_service_ips(cluster, tasks): + client = boto3.client("ecs", region_name="us-east-1") + + tasks_detail = client.describe_tasks( + cluster=cluster, + tasks=tasks + ) + + # first get the ENIs + enis = [] + for task in tasks_detail.get("tasks", []): + for attachment in task.get("attachments", []): + for detail in attachment.get("details", []): + if detail.get("name") == "networkInterfaceId": + enis.append(detail.get("value")) + + # now the ips + + print("eni: ", enis) + ips = [] + for eni in enis: + eni_resource = boto3.resource("ec2").NetworkInterface(eni) + print("eni_resource", eni_resource) + ips.append(eni_resource.private_ip_address) + + return ips + +def get_ecs_task_arn(host): + path = "/task" + url = host + path + headers = {"Content-Type": "application/json"} + r = requests.get(url, headers=headers) + print(f"r: {r}") + d_r = json.loads(r.text) + print(d_r) + return d_r["TaskARN"] + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="cylon scaling") + parser.add_argument('-n', dest='rows', type=int, **environ_or_required('ROWS')) + parser.add_argument('-i', dest='it', type=int, **environ_or_required('PARTITIONS')) #10 + parser.add_argument('-u', dest='unique', type=float, **environ_or_required('UNIQUENESS'), help="unique factor") #0.9 + parser.add_argument('-s', dest='scaling', type=str, **environ_or_required('SCALING'), choices=['s', 'w'], + help="s=strong w=weak") #w + parser.add_argument('-o', dest='operation', type=str, **environ_or_required('CYLON_OPERATION'), choices=['join', 'sort', 'slice'], + help="s=strong w=weak") # w + parser.add_argument('-w', dest='world_size', type=int, help="world size", **environ_or_required('WORLD_SIZE')) + parser.add_argument("-r", dest='redis_host', type=str, help="redis address, default to 127.0.0.1", + **environ_or_required('REDIS_HOST')) #127.0.0.1 + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", **environ_or_required('REDIS_PORT')) #6379 + parser.add_argument('-f1', dest='output_scaling_filename', type=str, help="Output filename for scaling results", + **environ_or_required('OUTPUT_SCALING_FILENAME')) + parser.add_argument('-f2', dest='output_summary_filename', type=str, help="Output filename for scaling summary results", + **environ_or_required('OUTPUT_SUMMARY_FILENAME')) + parser.add_argument('-b', dest='s3_bucket', type=str, help="S3 Bucket Name", **environ_or_required('S3_BUCKET')) + parser.add_argument('-o1', dest='s3_stopwatch_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_STOPWATCH_OBJECT_NAME')) + parser.add_argument('-o2', dest='s3_summary_object_name', type=str, help="S3 Object Name", + **environ_or_required('S3_SUMMARY_OBJECT_NAME')) + parser.add_argument('-c', dest='aws_ecs_cluster', type=str, help="AWS ECS Cluster", + **environ_or_required('ECS_CLUSTER_NAME')) + + args = vars(parser.parse_args()) + args['host'] = "aws" + #if args['operation'] == 'join': + # print("executing cylon join operation") + # cylon_join(args) + #elif args['operation'] == 'sort': + # print("executing cylon sort operation") + # cylon_sort(args) + #else: + # print ("executing cylon slice operation") + # cylon_slice(args) + print("Extracting task ID from $ECS_CONTAINER_METADATA_URI_V4") + print("Inside get_ecs_task_id.py, redirecting logs to stderr") + print("so that I can pass the task id back in STDOUT") + + host = os.environ["ECS_CONTAINER_METADATA_URI_V4"] + ecs_task_arn = get_ecs_task_arn(host) + # This print statement passes the string back to the bash wrapper, don't remove + print("ecs taskid: ", ecs_task_arn) + + + ips = get_service_ips(args['aws_ecs_cluster'], [ecs_task_arn]) + + print("aws task ip: ", ips) + + # os.system(f"{git} branch | fgrep '*' ") + # os.system(f"{git} rev-parse HEAD") From 8d4cfd3bfb78fc8f957f333c040d2715bead8f6d Mon Sep 17 00:00:00 2001 From: mstaylor Date: Sun, 12 Nov 2023 11:54:29 -0500 Subject: [PATCH 10/19] initial commit - fixes github action build issues --- cpp/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 0415a9a60..e7581731d 100755 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -89,7 +89,12 @@ if ("$ENV{CONDA_BUILD}" STREQUAL "1") set(CMAKE_SYSTEM_PREFIX_PATH "$ENV{BUILD_PREFIX};$ENV{PREFIX};${CMAKE_SYSTEM_PREFIX_PATH}") set(CONDA_INCLUDE_DIRS "$ENV{BUILD_PREFIX}/include" "$ENV{PREFIX}/include") set(CONDA_LINK_DIRS "$ENV{BUILD_PREFIX}/lib" "$ENV{PREFIX}/lib") - set(ARROW_BUILD_TYPE "SYSTEM") + + if (NOT ARROW_BUILD_TYPE) + set(ARROW_BUILD_TYPE "SYSTEM") + endif() + + set(CMAKE_INSTALL_INCLUDEDIR "$ENV{BUILD_PREFIX}/include") message(STATUS "Conda build detected, CMAKE_SYSTEM_PREFIX_PATH set to: ${CMAKE_SYSTEM_PREFIX_PATH}") @@ -106,7 +111,9 @@ elseif (DEFINED ENV{CONDA_PREFIX}) set(CMAKE_SYSTEM_PREFIX_PATH "$ENV{CONDA_PREFIX};${CMAKE_SYSTEM_PREFIX_PATH}") set(CONDA_INCLUDE_DIRS "$ENV{CONDA_PREFIX}/include") set(CONDA_LINK_DIRS "$ENV{CONDA_PREFIX}/lib" "$ENV{CONDA_PREFIX}/Library/lib") - set(ARROW_BUILD_TYPE "SYSTEM") + if (NOT ARROW_BUILD_TYPE) + set(ARROW_BUILD_TYPE "SYSTEM") + endif() message(STATUS "Conda environment detected, CMAKE_SYSTEM_PREFIX_PATH set to: ${CMAKE_SYSTEM_PREFIX_PATH}") message(STATUS "CONDA_INCLUDE_DIRS set to: ${CONDA_INCLUDE_DIRS}") @@ -271,9 +278,8 @@ if (CYLON_UCX) set(UCX_LIBRARIES ${UCX_UCT} ${UCX_UCS} ${UCX_UCM} ${UCX_UCP}) endif () - - else () - message("Using locally installed UCX") + elseif (NOT UCX_INSTALL_PREFIX) + message("Using locally installed UCX without install prefix") # Check if UCX include and lib paths are given if (NOT UCX_INCLUDEDIR) @@ -290,12 +296,29 @@ if (CYLON_UCX) include_directories(SYSTEM ${UCX_INCLUDEDIR}) # Set library directory for later use set(UCX_LIBRARIES - ${UCX_LIBDIR}/ucx/libuct_cma.so - ${UCX_LIBDIR}/ucx/libuct_ib.so ${UCX_LIBDIR}/libuct.so ${UCX_LIBDIR}/libucs.so ${UCX_LIBDIR}/libucm.so ${UCX_LIBDIR}/libucp.so) + else () + message("Using locally installed UCX") + + if (NOT UCX_INSTALL_PREFIX) + message(FATAL_ERROR "CYLON_UCX is set, UCX_INSTALL_PREFIX should also be set") + endif () + + # Set UCX found as true + set(UCX_FOUND TRUE) + + + message("setting UCX include and lib directories from install prefix") + include_directories(SYSTEM ${UCX_INSTALL_PREFIX}/include) + set(UCX_LIBRARIES + ${UCX_INSTALL_PREFIX}/lib/libuct.so + ${UCX_INSTALL_PREFIX}/lib/libucs.so + ${UCX_INSTALL_PREFIX}/lib/libucm.so + ${UCX_INSTALL_PREFIX}/lib/libucp.so) + endif (CONDA_LINK_DIRS) message(STATUS "UCX libs: ${UCX_LIBRARIES}") @@ -322,7 +345,7 @@ if (CYLON_UCX) find_library(HIREDIS_LIB hiredis HINTS ${REDIS_INSTALL_PREFIX}/lib) - find_library(REDIS_PLUS_PLUS_LIB redis++ HINTS ${REDIS_INSTALL_PREFIX}/lib) + find_library(REDIS_PLUS_PLUS_LIB redis++ HINTS ${REDIS_INSTALL_PREFIX}/lib64) set(REDIS_LIBRARIES ${HIREDIS_LIB} ${REDIS_PLUS_PLUS_LIB}) From d27dab619312598cafc2aceca55076086b508bba Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:12:43 -0500 Subject: [PATCH 11/19] partial - merge with rivanna-ucc-ucx-redis --- .github/workflows/conda-cpp.yml | 16 +- aws/scripts/Join_Weak_Scaling.ipynb | 2 +- aws/scripts/Join_Weak_Scaling_round2.ipynb | 473 ++++++++++++++++++ aws/scripts/cylon_scaling.py | 71 ++- aws/scripts/cylon_scaling_fargate.py | 380 ++++++++++++++ ...on_scaling_ec2_strong_145000000_16node.txt | 75 --- ...lon_scaling_ec2_strong_145000000_1node.txt | 75 --- ...lon_scaling_ec2_strong_145000000_2node.txt | 75 --- ...lon_scaling_ec2_strong_145000000_4node.txt | 75 --- ...lon_scaling_ec2_strong_145000000_8node.txt | 75 --- ...mmary_test_ec2_strong_145000000_16node.txt | 10 - ...ummary_test_ec2_strong_145000000_1node.txt | 10 - ...ummary_test_ec2_strong_145000000_2node.txt | 10 - ...mmary_test_ec2_strongt_145000000_4node.txt | 10 - ...mmary_test_ec2_strongt_145000000_8node.txt | 10 - .../cylon_scaling_ec2_weak_9100000_16node.txt | 75 --- .../cylon_scaling_ec2_weak_9100000_1node.txt | 75 --- .../cylon_scaling_ec2_weak_9100000_2node.txt | 75 --- .../cylon_scaling_ec2_weak_9100000_4node.txt | 75 --- .../cylon_scaling_ec2_weak_9100000_8node.txt | 75 --- .../cylon_summary_test_ec2_9100000_16node.txt | 10 - ...on_summary_test_ec2_weak_9100000_1node.txt | 10 - ...on_summary_test_ec2_weak_9100000_2node.txt | 10 - ...on_summary_test_ec2_weak_9100000_4node.txt | 10 - ...on_summary_test_ec2_weak_9100000_8node.txt | 10 - build.py | 1 - build.sh | 21 +- docker/aws/Dockerfile | 2 +- python/pycylon/setup.py | 2 + target/rivanna/installUCCUCX.sh | 35 ++ .../ucc-ucx-redis/cylon-experiment-setup.py | 142 ++++++ .../ucc-ucx-redis/cylon-experiment-setup2.py | 143 ++++++ .../scripts/ucc-ucx-redis/cylon_scaling.py | 108 ++++ 33 files changed, 1382 insertions(+), 864 deletions(-) create mode 100644 aws/scripts/Join_Weak_Scaling_round2.ipynb create mode 100644 aws/scripts/cylon_scaling_fargate.py delete mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt delete mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt delete mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt delete mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt delete mode 100644 aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt delete mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt delete mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt delete mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt delete mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt delete mode 100644 aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt delete mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt delete mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt delete mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt delete mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt delete mode 100644 aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt delete mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt delete mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt delete mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt delete mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt delete mode 100644 aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt create mode 100644 target/rivanna/installUCCUCX.sh create mode 100644 target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup.py create mode 100644 target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup2.py create mode 100644 target/rivanna/scripts/ucc-ucx-redis/cylon_scaling.py diff --git a/.github/workflows/conda-cpp.yml b/.github/workflows/conda-cpp.yml index e557637f8..00111c5aa 100644 --- a/.github/workflows/conda-cpp.yml +++ b/.github/workflows/conda-cpp.yml @@ -25,6 +25,7 @@ jobs: - os: ubuntu-20.04 gcc: 9 ucc: "master" + ucx: "override-remote-address3" steps: - uses: actions/checkout@v2 @@ -39,7 +40,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: cylon_dev - environment-file: conda/environments/cylon.yml + environment-file: conda/environments/cylon_NoUCX.yml - name: Activate conda run: conda activate cylon_dev @@ -51,17 +52,24 @@ jobs: cmake .. -DBUILD_SHARED_LIBS=1 -DUSE_MPI=1 -DCMAKE_INSTALL_PREFIX=$HOME/gloo/install make install + - name: Install UCX + run: | + git clone --single-branch -b ${{ matrix.ucx }} https://github.com/mstaylor/ucx.git $HOME/ucx + cd $HOME/ucx + ./autogen.sh + ./configure --prefix=$HOME/ucx/install --without-go + make install + - name: Install UCC run: | git clone --single-branch -b ${{ matrix.ucc }} https://github.com/openucx/ucc.git $HOME/ucc cd $HOME/ucc - echo "conda ucx: $(conda list | grep ucx)" ./autogen.sh - ./configure --prefix=$HOME/ucc/install --with-ucx=$CONDA/envs/cylon_dev + ./configure --prefix=$HOME/ucc/install --with-ucx=$HOME/ucx/install make install - name: Build cylon, pycylon and run cpp test - run: python build.py -cmake-flags="-DCYLON_UCX=1 -DCYLON_GLOO=1 -DGLOO_INSTALL_PREFIX=$HOME/gloo/install -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$HOME/ucc/install" -ipath="$HOME/cylon/install" --cpp --python --test + run: python build.py -cmake-flags="-DCYLON_UCX=1 -DCYLON_GLOO=1 -DGLOO_INSTALL_PREFIX=$HOME/gloo/install -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$HOME/ucc/install -DUCX_INSTALL_PREFIX=$HOME/ucx/install" -ipath="$HOME/cylon/install" --cpp --python --test - name: Run pytest run: python build.py -ipath="$HOME/cylon/install" --pytest diff --git a/aws/scripts/Join_Weak_Scaling.ipynb b/aws/scripts/Join_Weak_Scaling.ipynb index b962f6948..3e11bff98 100644 --- a/aws/scripts/Join_Weak_Scaling.ipynb +++ b/aws/scripts/Join_Weak_Scaling.ipynb @@ -16,7 +16,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 19, + "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/", diff --git a/aws/scripts/Join_Weak_Scaling_round2.ipynb b/aws/scripts/Join_Weak_Scaling_round2.ipynb new file mode 100644 index 000000000..64d81e0c1 --- /dev/null +++ b/aws/scripts/Join_Weak_Scaling_round2.ipynb @@ -0,0 +1,473 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "DdPziLudpalX", + "outputId": "3c63ebcd-b960-425e-9733-7e06a43dc28d" + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjkAAAHFCAYAAAAQU+iSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADnkklEQVR4nOydd3xTVf/H3+nepXvQAZQ9yhbKRgURFRQXThAfxZ88ghNlCcpGRXGAqMhQERyIPA4Elb1kyh4iq7RQCt27yfn9cUiaNEln2rTlvHndV+4999xzT5KSfPI936ERQggUCoVCoVAo6hgO9p6AQqFQKBQKRVWgRI5CoVAoFIo6iRI5CoVCoVAo6iRK5CgUCoVCoaiTKJGjUCgUCoWiTqJEjkKhUCgUijqJEjkKhU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asUqnP16tWoW7cuOnTogL59+8Ld3R2ffPKJwm3S0tLC6dOnYWFhgQEDBsDBwQG+vr54+fKlQj07derUQVRUFD777DM4ODhg8+bNiIyMhKOjo8JtYIy9fyRE//uBC8YYq0CXLl3QsmVL0fAKjDH2vuKeHMYYY4zVShzkMMYYY6xW4ttVjDHGGKuVuCeHMcYYY7USBzmMMcYYq5U4yGGMMcZYrcRBDmOMMcZqJQ5yGGOMMVYrcZDDGGOMsVqJgxzGGGOM1Uoc5DDGGGOsVvo/Vf9EDHOsLxUAAAAASUVORK5CYII=" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "# Given data\n", + "world_size = ['4 | 16', '8 | 32', '16 | 64', '32 | 128', '64 | 256']\n", + "ec2_4_26 = [26.80001503, 33.82108727, 34.70261905, 34.40150503, 36.04979236]\n", + "ec2_16_28 = [30.07260311, 36.75810435, 36.8333492, 37.36801396, 38.40536711]\n", + "fargate_4_26 = [33.68554413, 42.44095802, 43.11394629, 46.3293512, 47.92054052]\n", + "fargate_16_28 = [31.50847322, 40.88083729, 40.72470558, 41.43658119, 42.52811459]\n", + "rivanna_8 = [25.98013163, 28.41809341, 30.62765954, 29.37659091, 30.77450389]\n", + "rivanna_16 = [25.26343322, 28.12409517, 27.14304942, 28.98870633, 31.24031554]\n", + "\n", + "ec2_4_26_err = [1.690741089, 0.4297059082, 0.2713161653, 0.621981106, 0.3555366731]\n", + "ec2_16_28_err = [0.1131030894, 0.5180851482, 0.1446106828, 0.2227162348, 0.3716563786]\n", + "fargate_4_26_err = [0.05400982477, 1.46033826, 1.515233265, 1.808315597, 1.200178515]\n", + "fargate_16_28_err = [3.518690911, 0.5573273239, 0.3047347395, 0.2670398924, 0.2849529409]\n", + "rivanna_8_err = [0.6486999821, 0.3616146377, 2.897190918, 1.677787319, 2.216267362]\n", + "rivanna_16_err = [0.1507025937, 0.3740365494, 0.1460753863, 1.080150049, 0.8721500223]\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, ec2_4_26, marker='o', color='b', label='EC2 - 8 CPU/26 GB Memory')\n", + "plt.plot(world_size, ec2_16_28, marker='o', color='g', label='EC2 - 16 CPU/28 GB Memory')\n", + "plt.plot(world_size, fargate_4_26, marker='o', color='r', label='Fargate - 8 CPU/26 GB Memory')\n", + "plt.plot(world_size, fargate_16_28, marker='o', color='orange', label='Fargate - 16 CPU/28 GB Memory')\n", + "plt.plot(world_size, rivanna_8, marker='o', color='black', label='Rivanna - 8 CPU')\n", + "plt.plot(world_size, rivanna_16, marker='o', color='purple', label='Rivanna - 16 CPU')\n", + "\n", + "plt.errorbar(world_size, ec2_4_26, yerr=ec2_4_26_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, ec2_16_28, yerr=ec2_16_28_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "plt.errorbar(world_size, fargate_4_26, yerr=fargate_4_26_err, fmt='x', color='r', ecolor='r', capsize=5)\n", + "plt.errorbar(world_size, fargate_16_28, yerr=fargate_16_28_err, fmt='x', color='orange', ecolor='orange', capsize=5)\n", + "plt.errorbar(world_size, rivanna_8, yerr=rivanna_8_err, fmt='x', color='black', ecolor='black', capsize=5)\n", + "plt.errorbar(world_size, rivanna_16, yerr=rivanna_16_err, fmt='x', color='purple', ecolor='purple', capsize=5)\n", + "\n", + "custom_text = \"9.1m rows (1/2/4/8/16 Nodes)\"\n", + "plt.text(1, 48, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "plt.ylim(5, 50)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Join Operation')\n", + "\n", + "# Add a legend\n", + "plt.legend(loc=\"lower right\")\n", + "\n", + "plt.savefig('join-w-scaling.svg', format='svg')\n", + "\n", + "# Display the chart\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0oAAAJuCAYAAACOkPJ5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACo50lEQVR4nOzdeVxN+f8H8Ndtv61ojzYiS5bIki1r2bOMYcoQxjKW0CAkMghhhmYxluz72MZYYlDZfWkwKMQwMTKELimp7vn9cX8d3dZ7U2rM6/l43Af3LJ/P+5y7dN73sxyJIAgCiIiIiIiISKRR3gEQERERERFVNEyUiIiIiIiI8mCiRERERERElAcTJSIiIiIiojyYKBEREREREeXBRImIiIiIiCgPJkpERERERER5MFEiIiIiIiLKg4kSERERERFRHkyUiAqxfv16SCSSQh/R0dFK22dkZOD7779H69atUblyZejo6KBq1ar49NNPERMTI24XGxuLsWPHon79+jAyMoKlpSU6deqEEydOFBvTrl27IJFIsGPHjnzrGjZsCIlEgiNHjuRbV6NGDTRu3Fj9k6CCkJAQSCQSJCcnl2j/CxcuoE+fPrCzs4Ouri4sLS3h7u6Or776qpQjfSfntb1//764zM/PDw4ODmVWZ0EyMzNhaWmJFi1aFLqNXC6HnZ0dGjRo8AEjK1v3799X+ixpaGjA1NQU3bp1w7lz58olptJ+TxS0r4ODA/z8/EocY2lycHBQeg309PTg5OSEgICAEn+WP4SCXqfyJAgCtm/fjjZt2sDCwgJ6enqoVq0avLy8sGbNGqVtJRIJQkJCyjSe6OjoAv8+vY+c98jChQvzrct5PS5dulRq9eX8TSGqCJgoERVj3bp1OHfuXL5H7sQjOTkZrVq1QkBAAFxcXLB+/XocP34cS5cuhaamJjp27IirV68CALZt24b//e9/GDZsGH755ResWbMGurq66NixIzZu3FhkLO3atYNEIkFUVJTS8ufPn+PatWswMDDIt+7hw4f4888/0b59+1I6I6Xn4MGDaNmyJV6+fImwsDAcPXoUy5cvR6tWrQpMBstScH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HDh1V63crSyJEjERERgS1btmDgwIFq73/x4kUYGBiUSiz379+Ho6MjLl++jEaNGpVKmWWNiRIRERGpLC0tDZlZcvQRDsEcz8u8vqeogr1Z3ZCWlqZyogQAXbp0wbp165SW6erqiv8/cOAA+vXrBy8vL2zZsgU1atTAkydP8PPPPyM4OBg7duxAbGwszM3NsXnzZtja2uLs2bMYOXIkNDU1MW7cuELrPnv2LBISEtC/f39xWUZGBszNzREUFIRvv/22wP3evn2Lzp07w8LCArt27UK1atXw4MEDGBkZqXTMMTExGDt2LJo2bYqsrCwEBQXB09MTcXFx4sXupEmTEBUVhc2bN8PBwQFHjx7FmDFjYGNjA29vbwCAr68vpkyZgvj4eNSpU0eluovy9ddfY8SIEUhNTcX69esxevRoVKpUCQMGDFC7rMzMTGhra793TO/r4sWLyM7OBqB4vfv164dbt27B2NgYAKCjowOpVAqpVFpuMaalpWHHjh2YMmUKIiIiSpQomZubl0Fk/x7sekdERERqM8dzWONJmT9Kmozp6urCyspK6VG5cmUAigvIoUOHolu3bti/fz86deoER0dHNG/eHEuWLMHKlSsBAMOGDUN4eDg8PDxQvXp1DBo0CEOHDsWePXuKrHv79u3w9PSEnp6euMzBwQHLly/H4MGDC0341q5di+fPn2Pfvn1o1aoV7O3t0bp1azRs2FClY46MjISfnx/q1auHhg0bYt26dUhMTFTqRnfu3DkMGTIE7dq1g4ODA0aOHImGDRvi0qVL4jampqZo2bIltm3bplK9xTEyMoKVlRWcnJwwb9481KxZE/v27QMABAYGolatWtDX10f16tURHByMzMxMcd+QkBA0atQIa9euRfXq1aGrqwtBEBAZGYnWrVujUqVKMDU1RY8ePXD37l214jp79izatm0LqVQKW1tb+Pv74/Xr1yrta25uLr6vqlSpAgCwsLBQWpa3613uY7Gzs4OhoSG+/PJLZGdnIywsDFZWVrCwsMD8+fOV6pLJZBg5ciQsLCxgbGyMDh064OrVq8XG+PPPP6Nu3bqYPn06zpw5g/v37yutf/LkCXr27AmpVApHR0ds2bIlXxm5u94V1N0tJS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38udWnn34KAPj777+xfPlybNy4EV999VXpRkpERERERPSBqJQo/e9//1OpsKpVqyIsLOy9AiIiIiIiIipv7z3rXXZ2Nq5cuYIXL16URjxERERERETlTu1EaeLEiYiIiACgSJI8PDzQuHFj2NraIjo6urTjIyIiIiIi+uDUTpR27dqFhg0bAgB+/fVX3Lt3Dzdv3sTEiRMRFBRU6gESERERERF9aGonSsnJybCysgIAHDp0CP3790etWrUwfPhwXLt2rdQDJCIiIiIi+tDUTpQsLS0RFxeH7OxsREZGolOnTgCAtLQ0aGpqlnqAREREREREH5pKs97lNnToUHz66aewtraGRCJB586dAQAXLlxA7dq1Sz1AIiIiIqKPTXJycon209fXh4mJSSlHQwVRO1EKCQmBi4sLHjx4gP79+0NXVxcAoKmpiWnTppV6gEREREREHwtDGEIul2DPnj0l2l9DQxv+/mOZLH0AaidKAPDJJ5/kWzZkyJD3DoaIiIiI6GOmBz1oaAjYvbsPkpPN1drXzOwp+vXbi7S0NCZKH4BKidL27dsxcOBAlQp88OABEhMT0apVq/cKjIiIiIjoY5WcbI6kJOvyDoOKoNJkDitWrEDt2rWxaNEixMfH51svk8lw6NAh+Pj4oEmTJnj+/HmpB0pERERERPShqNSiFBMTgwMHDuC7777DjBkzYGBgAEtLS+jp6eHFixd4/PgxzM3NMXToUFy/fh0WFhZlHTcREREREVGZUXmMUo8ePdCjRw88e/YMp0+fxv3795Geng4zMzO4urrC1dUVGhpqzzZORERERERU4ag9mYOpqSm8vb3LIhYiIiIiIqIKgU1AREREREREeTBRIiIiIiIiyoOJEhERERERUR5MlIiIiIiIiPIocaL09u1b3Lp1C1lZWSWufMWKFWjQoAGMjY1hbGwMd3d3HD58WFwvCAJCQkJgY2MDqVSKdu3a4caNGyWuj4iIiIiISBVqJ0ppaWkYPnw49PX1Ua9ePSQmJgIA/P39sXDhQrXKqlatGhYuXIhLly7h0qVL6NChA7y9vcVkKCwsDN988w2+//57XLx4EVZWVujcuTNevXqlbthEREREREQqU3t68OnTp+Pq1auIjo5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qzA1NRWX9+nTB1988UWpBkdERJTDEIaQyyXYs2dPicvQ0NCGv/9YJktERFQstROl06dP48yZM9DR0VFabm9vj7///rvUAiMiIspND3rQ0BCwe3cfJCebq72/mdlT9Ou3F2lpaUyUiIioWGonSnK5HNnZ2fmWP3z4EEZGRqUSFBERUWGSk82RlGRd3mEQEdFHTu3JHDp37oxly5aJzyUSCVJTUzF79mx069atNGMjIiIiIiIqF2q3KH377bdo37496tatizdv3sDHxwcJCQkwMzPDtm3byiLGj4pMJkNaWlqJ9n2fAcxERERERKQ6tRMlGxsbXLlyBdu2bcPvv/8OuVyO4cOHw9fXF1KptCxi/GjIZDL8EB6OTLm8vEMhIiIiIqIiqJ0oAYBUKsWwYcMwbNiw0o7no5aWloZMuRx9du+GeQlahxKcnBDVsWMZREZERERERLmpnSjt37+/wOUSiQR6enpwcnKCo6Pjewf2MTNPToZ1UpLa+yWbmZVBNERERERElJfaiVLv3r0hkUggCILS8pxlEokErVu3xr59+1C5cuVSC5SIiOj/2rv3oCrrxI/jnwPqEeQIcodEAkPNa6Wm67iKpqht5KUa093SmqmmADVWTUuNTMXcNtnkl41TaxcvOTs/NLeLl9YFNNNV85aZqVHqlhFah5tiwPn90a8z8WjJQc55Dof3a+bM8Fy+53xynkY+fp/vcwAA8BSXn3q3detW9e3bV1u3bpXdbpfdbtfWrVt166236p133lFhYaHOnTun6dOnuyMvAAAAALidyzNKU6dO1YoVKzRgwADnvttuu02tW7fWww8/rCNHjignJ4f1SwAAAACaLJdnlE6ePKm2bdtetr9t27b64osvJElJSUk8yhoAAABAk+VyUerdu7dmzJih7777zrnvu+++08yZM9W3b19J0vHjx9W+ffvGSwkAAAAAHuTyrXevvvqqRo8erfbt2ysuLk4Wi0WnTp1SYmKi3n77bUlSeXm55s6d2+hhAQAAAMATXC5KnTt31tGjR7V582Z9/vnncjgc6tKli4YPHy4/v58mqMaMGdPYOQEAAADAYxr0hbMWi0UjR47UyJEjGzsPAAAAAJiuQUWpoqJCBQUFOnX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pUtXHb93715NmTJF8+fP17Fjx7Rp0yYNGjTosv/u8PBw/ec//1FGRoYeffRR3XPPPRowYIA+/vhjjRgxQvfdd58qKyvrlRkA4HncegcAcJu4uDgtXbpUFotFnTt31uHDh7V06VI99NBDevDBB53nJSYm6sUXX9Stt96q8vJyBQUFOY/Nnz9fw4cPd26HhYWpV69ezu0FCxZo/fr12rhxo9LT06+a6a233pKfn59eeeUVWSwWSdLKlSsVEhKi/Px8paSk/Ob4U6dOqU2bNrrjjjtks9kUHx+vm2++uc45vXr10pw5cyRJs2fP1uLFixUeHq6HHnpIkjRv3jwtX75chw4dUv/+/a+aGQDgecwoAQDcpn///s4yIkm/+93vdPz4cdXU1Gj//v0aPXq04uPjZbPZlJycLEmXzQz16dOnznZFRYVmzpyprl27KiQkREFBQfrss8/qPaO0b98+nThxQjabTUFBQQoKClJoaKguXryokydPXnX88OHDFR8fr8TERN13331avXr1ZTNDPXv2dP7s7++vsLAw9ejRw7kvKipKkurcaggA8C7MKAEAPO7ixYtKSUlRSkqKVq1apYiICJ06dUojRoy47Pa3Nm3a1NmeMWOGNm/erOeff1433HCDAgICdPfdd9frtjlJqq2tVe/evbV69erLjkVERFx1vM1m08cff6z8/Hxt2bJF8+bNU1ZWlvbs2aOQkBBJuuwJeRaLpc6+n8tjbW1tvTIDADyPogQAcJtdu3Zdtp2UlKTPPvtMJSUlWrx4seLi4iT9tPanPrZv367Jkydr7NixkqTy8vLffBCD0S233KJ169YpMjJSbdu2rfe4X2rRooWGDRumYcOG6emnn1ZISIi2bdumcePGNej9AADeh1vvAABuc/r0aWVmZurYsWNau3atli1bpqlTp6pDhw5q1aqVli1bpi+++EIbN27Us88+W6/3vOGGG5SXl6cDBw7o4MGDmjhxokszM3/84x8VHh6u0aNHa/v27SoqKlJBQYGmTp2qM2fOXHX8O++8oxdffFEHDhzQV199pTfeeEO1tbXq3LlzvTMAALwfRQkA4Db333+/Lly4oFtvvVVpaWnKyMjQww8/rIiICL322mv6xz/+oa5du2rx4sV6/vnn6/WeS5cuVbt27TRgwAClpqZqxIgRuuWWW+qdKTAwUIWFherQoYPGjRunG2+8UQ8++KAuXLhQrxmmkJAQ5eXlaejQobrxxhv18ssva+3aterWrVu9MwAAvJ/F8fMXWgAA0IiSk5N10003KScnx+woAAC4jBklAAAAADCgKAEAAACAAbfeAQAAAIABM0oAAAAAYEBRAgAAAAADihIAAAAAGFCUAAAAAMCAogQAAAAABhQlAAAAADCgKAEAAACAAUUJAAAAAAz+D6sXCPuUa7vMAAAAAElFTkSuQmCC" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "\n", + "# Given data\n", + "world_size = ['1', '2', '4', '8', '16']\n", + "ec2_4_26 = [26.80001503, 33.82108727, 34.70261905, 34.40150503, 36.04979236]\n", + "ec2_16_28 = [30.07260311, 36.75810435, 36.8333492, 37.36801396, 38.40536711]\n", + "fargate_4_26 = [33.68554413, 42.44095802, 43.11394629, 46.3293512, 47.92054052]\n", + "fargate_16_28 = [31.50847322, 40.88083729, 40.72470558, 41.43658119, 42.52811459]\n", + "rivanna_8 = [25.98013163, 28.41809341, 30.62765954, 29.37659091, 30.77450389]\n", + "rivanna_16 = [25.26343322, 28.12409517, 27.14304942, 28.98870633, 31.24031554]\n", + "\n", + "ec2_4_26_2 = [26.80001503/3.021825373, 33.82108727/3.021825373, 34.70261905/3.021825373, 34.40150503/3.021825373, 36.04979236/3.021825373]\n", + "ec2_16_28_2 = [30.07260311/2.598218739, 36.75810435/2.598218739, 36.8333492/2.598218739, 37.36801396/2.598218739, 38.40536711/2.598218739]\n", + "fargate_4_26_2 = [33.68554413, 42.44095802, 43.11394629, 46.3293512, 47.92054052]\n", + "fargate_16_28_2 = [31.50847322, 40.88083729, 40.72470558, 41.43658119, 42.52811459]\n", + "rivanna_8_2_2 = [25.98013163, 28.41809341, 30.62765954, 29.37659091, 30.77450389]\n", + "rivanna_16_2 = [25.26343322/2.072015524, 28.12409517/2.072015524, 27.14304942/2.072015524, 28.98870633/2.072015524, 31.24031554/2.072015524]\n", + "\n", + "# set width of bar\n", + "barWidth = 0.1\n", + "\n", + "br1 = np.arange(len(world_size))\n", + "br2 = [x + barWidth for x in br1]\n", + "br3 = [x + barWidth for x in br2]\n", + "br4 = [x + barWidth for x in br3]\n", + "br5 = [x + barWidth for x in br4]\n", + "br6 = [x + barWidth for x in br5]\n", + "\n", + "\n", + "fig = plt.subplots(figsize =(10, 7))\n", + "\n", + "plt.bar(br1, ec2_4_26, color ='r', width = barWidth,\n", + " edgecolor ='grey', label ='EC2 (4_26)')\n", + "plt.bar(br2, ec2_16_28, color ='g', width = barWidth,\n", + " edgecolor ='grey', label ='EC2 (16_28)')\n", + "plt.bar(br3, rivanna_16, color ='b', width = barWidth,\n", + " edgecolor ='grey', label ='Rivanna')\n", + "plt.bar(br4, ec2_4_26_2, width = barWidth,\n", + " edgecolor ='grey', label ='EC2 (16_28) - Parallel Time Adjusted')\n", + "plt.bar(br5, ec2_16_28_2, width = barWidth,\n", + " edgecolor ='grey', label ='EC2 (16_28) - Parallel Time Adjusted')\n", + "plt.bar(br6, rivanna_16_2, width = barWidth,\n", + " edgecolor ='grey', label ='Rivanna - Parallel Time Adjusted')\n", + "\n", + "\n", + "\n", + "# Create a line chart\n", + "#plt.plot(world_size, ec2_4_26, marker='o', color='b', label='EC2 - 8 CPU/26 GB Memory')\n", + "#plt.plot(world_size, ec2_16_28, marker='o', color='g', label='EC2 - 16 CPU/28 GB Memory')\n", + "#plt.plot(world_size, fargate_4_26, marker='o', color='r', label='Fargate - 8 CPU/26 GB Memory')\n", + "#plt.plot(world_size, fargate_16_28, marker='o', color='orange', label='Fargate - 16 CPU/28 GB Memory')\n", + "#plt.plot(world_size, rivanna_8, marker='o', color='black', label='Rivanna - 8 CPU')\n", + "#plt.plot(world_size, rivanna_16, marker='o', color='purple', label='Rivanna - 16 CPU')\n", + "\n", + "\n", + "custom_text = \"9.1m rows (1/2/4/8/16 Nodes)\"\n", + "plt.text(1, 48, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "plt.ylim(5, 50)\n", + "\n", + "#plt.xticks(world_size)\n", + "plt.xticks([r + barWidth for r in range(len(world_size))],\n", + " world_size)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('EC2/Rivanna Weak Scaling Versus Parallelism Based on Single Node')\n", + "\n", + "# Add a legend\n", + "plt.legend()\n", + "\n", + "plt.savefig('join-w-scaling-adjusted.svg', format='svg')\n", + "\n", + "# Display the chart\n", + "plt.show()" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "# Given data\n", + "world_size = ['4 | 16', '8 | 32', '16 | 64', '32 | 128', '64 | 256']\n", + "ec2_4_26 = [26.80001503, 33.82108727, 34.70261905, 34.40150503, 36.04979236]\n", + "ec2_16_28 = [30.07260311, 36.75810435, 36.8333492, 37.36801396, 38.40536711]\n", + "fargate_4_26 = [33.68554413, 42.44095802, 43.11394629, 46.3293512, 47.92054052]\n", + "fargate_16_28 = [31.50847322, 40.88083729, 40.72470558, 41.43658119, 42.52811459]\n", + "rivanna_8 = [25.98013163, 28.41809341, 30.62765954, 29.37659091, 30.77450389]\n", + "rivanna_16 = [25.26343322, 28.12409517, 27.14304942, 28.98870633, 31.24031554]\n", + "\n", + "ec2_4_26_err = [1.690741089, 0.4297059082, 0.2713161653, 0.621981106, 0.3555366731]\n", + "ec2_16_28_err = [0.1131030894, 0.5180851482, 0.1446106828, 0.2227162348, 0.3716563786]\n", + "fargate_4_26_err = [0.05400982477, 1.46033826, 1.515233265, 1.808315597, 1.200178515]\n", + "fargate_16_28_err = [3.518690911, 0.5573273239, 0.3047347395, 0.2670398924, 0.2849529409]\n", + "rivanna_8_err = [0.6486999821, 0.3616146377, 2.897190918, 1.677787319, 2.216267362]\n", + "rivanna_16_err = [0.1507025937, 0.3740365494, 0.1460753863, 1.080150049, 0.8721500223]\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, ec2_4_26, marker='o', color='b', label='EC2 - 8 CPU/26 GB Memory')\n", + "plt.plot(world_size, ec2_16_28, marker='o', color='g', label='EC2 - 16 CPU/28 GB Memory')\n", + "plt.plot(world_size, fargate_4_26, marker='o', color='r', label='Fargate - 8 CPU/26 GB Memory')\n", + "plt.plot(world_size, fargate_16_28, marker='o', color='orange', label='Fargate - 16 CPU/28 GB Memory')\n", + "plt.plot(world_size, rivanna_8, marker='o', color='black', label='Rivanna - 8 CPU')\n", + "plt.plot(world_size, rivanna_16, marker='o', color='purple', label='Rivanna - 16 CPU')\n", + "\n", + "plt.errorbar(world_size, ec2_4_26, yerr=ec2_4_26_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, ec2_16_28, yerr=ec2_16_28_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "plt.errorbar(world_size, fargate_4_26, yerr=fargate_4_26_err, fmt='x', color='r', ecolor='r', capsize=5)\n", + "plt.errorbar(world_size, fargate_16_28, yerr=fargate_16_28_err, fmt='x', color='orange', ecolor='orange', capsize=5)\n", + "plt.errorbar(world_size, rivanna_8, yerr=rivanna_8_err, fmt='x', color='black', ecolor='black', capsize=5)\n", + "plt.errorbar(world_size, rivanna_16, yerr=rivanna_16_err, fmt='x', color='purple', ecolor='purple', capsize=5)\n", + "\n", + "custom_text = \"9.1m rows (1/2/4/8/16 Nodes)\"\n", + "plt.text(1, 48, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "plt.ylim(5, 50)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Join Operation')\n", + "\n", + "# Add a legend\n", + "plt.legend(loc=\"lower right\")\n", + "\n", + "plt.savefig('join-w-scaling.svg', format='svg')\n", + "\n", + "# Display the chart\n", + "plt.show()\n", + "\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "HvgUPka-uMRo", + "outputId": "7fd8d45a-823b-4360-c1f1-593e70d31515" + }, + "execution_count": 2, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjkAAAHFCAYAAAAQU+iSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADnkklEQVR4nOydd3xTVf/H3+nepXvQAZQ9yhbKRgURFRQXThAfxZ88ghNlCcpGRXGAqMhQERyIPA4Elb1kyh4iq7RQCt27yfn9cUiaNEln2rTlvHndV+4999xzT5KSfPI936ERQggUCoVCoVAo6hgO9p6AQqFQKBQKRVWgRI5CoVAoFIo6iRI5CoVCoVAo6iRK5CgUCoVCoaiTKJGjUCgUCoWiTqJEjkKhUCgUijqJEjkKhUKhUCjqJErkKBQKhUKhqJMokaNQKBQKhaJOokSOotbz3XffodFoWLlypdm5tm3botFo+O2338zOxcTE0KFDhyqZ05QpU9BoNCQnJ1fo+l27dnHPPfcQFRWFq6srISEhxMXF8dJLL9l4pkUsWbIEjUbD2bNnDW3Dhw+nQYMGVXZPW/HBBx/QuHFjXFxc0Gg0pKamWuynf4579uwp9z0svT62ICsri1mzZtG+fXu8vLzw9PSkXbt2zJgxg6ysLJveqyqZMWMGq1evNmvfuHEjGo2GjRs3VvucFAolchS1nj59+qDRaNiwYYNJ+7Vr1zh06BCenp5m5+Lj4/n333/p27dvdU61TPz8889069aN9PR05syZw7p165g3bx7du3e3KOSqkkmTJvHDDz9U6z3Ly4EDBxg9ejR9+/blzz//ZMeOHXh7e9v8PnfccQc7duwgLCzMZmNevnyZrl278uabb3Lbbbfxww8/sHr1am6//XamTZtG165duXz5ss3uV5VYEzkdOnRgx44dVfaDQqEoCSd7T0ChqCyBgYG0bt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UZGRgAguj3HGKtZ/OAxY6xK5Obmws3NDW5ubti9ezcMDAzw4MEDuLu7l7llJJVKRfMzZ87EL7/8glWrVsHGxgaampoYOHCgQreaAKC4uBiffvopwsPDy+QZGBhUuLyOjg6uXLmCuLg4HDt2DAsWLEBQUBAuXrwoDOpa+k0siUQiSisJ/IqLixVqM2Os+nGQwxirlN9//73MfOPGjXHz5k08e/YMy5cvh7m5OYBXz7oo4syZMxg1ahT69+8PAMjKyir3oeHSPvnkE+zZsweGhobQ1dVVeLnXqaiooFu3bujWrZswYv3JkycxYMCAN6qPMVbz+HYVY6xSHj58CH9/f9y6dQuRkZFYv349/Pz8YGFhATU1Naxfvx4pKSmIiYnB4sWLFarTxsYGUVFRSEhIQGJiIry8vCrVI+Lt7Y369evD09MTZ86cQWpqKk6dOgU/Pz88evSowuUPHTqEdevWISEhAffv38euXbtQXFwMOzs7hdvAGHv/cJDDGKuUkSNH4uXLl2jbti0mTZqEKVOmYNy4cTAwMMCOHTuwb98+NGnSBMuXL8eqVasUqnP16tWoW7cuOnTogL59+8Ld3R2ffPKJwm3S0tLC6dOnYWFhgQEDBsDBwQG+vr54+fKlQj07derUQVRUFD777DM4ODhg8+bNiIyMhKOjo8JtYIy9fyRE//uBC8YYq0CXLl3QsmVL0fAKjDH2vuKeHMYYY4zVShzkMMYYY6xW4ttVjDHGGKuVuCeHMcYYY7USBzmMMcYYq5U4yGGMMcZYrcRBDmOMMcZqJQ5yGGOMMVYrcZDDGGOMsVqJgxzGGGOM1Uoc5DDGGGOsVvo/Vf9EDHOsLxUAAAAASUVORK5CYII=" + }, + "metadata": {}, + "output_type": "display_data" + } + ] + }, + { + "cell_type": "code", + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "\n", + "# Given data\n", + "infrastructure = ['EC2 Nano', 'EC2 Micro', 'Fargate .25 CPU', 'Fargate .5 CPU', 'Rivanna 1 Node']\n", + "server = [3.021825373, 2.598218739, 10.42936128, 5.220078409, 2.072015524\t\t]\n", + "server_err = [0.07005206974, 0.1331001051, 0.3293929105, 0.1551287397, 0.1036626711\t\t ]\n", + "\n", + "\n", + "fig = plt.subplots(figsize =(10, 7))\n", + "# Create a line chart\n", + "p1 = plt.bar(infrastructure, server_err, color='orange', label ='Error (Standard Deviation)')\n", + "p2 = plt.bar(infrastructure, server,color='blue',\n", + " bottom = server_err, label ='Join')\n", + "#plt.plot(world_size, ec2_16_28, marker='o', color='g', label='EC2 - 16 CPU/28 GB Memory')\n", + "\n", + "\n", + "\n", + "#plt.errorbar(world_size, ec2_4_26, yerr=ec2_4_26_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "#plt.errorbar(world_size, ec2_16_28, yerr=ec2_16_28_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "\n", + "\n", + "custom_text = \"800000 rows\"\n", + "plt.text(1, 50, custom_text, fontsize=10, color='blue', ha='center')\n", + "\n", + "#plt.ylim(10, 625)\n", + "\n", + "#plt.xticks(infrastructure)\n", + "\n", + "# Add labels and title\n", + "plt.xlabel('Infrastructure')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Join Operation')\n", + "\n", + "# Add a legend\n", + "plt.legend()\n", + "\n", + "plt.savefig('join-w-scaling_inf.svg', format='svg')\n", + "\n", + "\n", + "\n", + "# Display the chart\n", + "plt.show()" + ], + "metadata": { + "id": "2vSanYys6E68" + }, + "execution_count": 20, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0oAAAmbCAYAAADJyC4pAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACRjElEQVR4nOzdebye853/8c9JZD9oSIWINbW1QmwlgiQlaGiUtlpVjTKtbhPtMF3MoFLbL6UzyigztVapqSVUW8uQKJ3QMGPsulhKJfYlFJHk+v1xP86J884iNEWb5/PxOA/u6/re1/W975y05+W67u9pa5qmKQAAADp1e7snAAAA8E4jlAAAAIJQAgAACEIJAAAgCCUAAIAglAAAAIJQAgAACEIJAAAgCCUAAIAglAAAAIJQgmXQnDlV//zPVeusU9WnT9W661ZNnFg1b978MU1T9a1vVQ0a1BozalTVXXd1Pc4rr1T9/d9XDRhQ1a9f1bhxVY880nXMM89U7bdf1Yortr7226/q2We7jvnDH6o+9KHWMQYMqJowoWr27K5j7rijauTI1lxWX70136ZZSm8IAEAQSrAM+n//r+q006pOOaXqnnuqJk2q+s53qk4+ef6YSZOqvvvd1pjp06tWXbVqzJiqWbPmj/nKV6ouvbTqxz+uuvHGqhdeqNp996q5c+eP+eQnq267rerKK1tft93WiqUOc+dW7bZb1Ysvto7x4x9XXXxx1SGHzB/z/POtcw8a1JrLySdXnXBCa35vxKuvvrHxAMAyrAGWObvt1jQHHNB12157Nc2nPtX693nzmmbVVZvm+OPn73/55aZZccWmOe201uNnn22aHj2a5sc/nj/mj39smm7dmubKK1uP7767aaqa5qab5o+ZNq217d57W49//vPWc/74x/ljLrigaXr1aprnnms9PvXU1rlffnn+mOOOa5pBg1pzXZgHHmid58ILm2bkyNbxzjyzaebObZqjjmqa1Vdvmp49m2bTTZvmF7/o+j58+cvzHx98cOs4d97Zevzqq03T3j7/Nf7kJ02z8cZN07t306y0UtPsuGPTvPDCwucEAPz1cEUJlkHbbVd17bVVv/lN6/H//V/ras7Ysa3HDzxQNXNm1c47z39Or16tW9/++79bj2+9tXWF5rVjBg2q2njj+WOmTWvdbrf11vPHbLNNa9trx2y8ceu5HXbZpXVb3623zh8zcmRrDq8d8+ijVQ8+uPjX+vWvt27lu+ee1nNOOqnqxBNbV6Ruv721bdy4qt/+tjV+1KiqqVPnP//661u3A15/fevx9OlVL79cNWJE1YwZVfvsU3XAAa3jT51atddebgkEgL8FQgmWQV//eusH/A03rOrRo2qzzVq30e2zT2v/zJmtfw4c2PV5AwfO3zdzZlXPnlX9+y9+zCqrLHj+VVbpOibP079/69iLG9PxuGPMonzlK614WWedVoydcELr9X/iE1UbbNC6DXHYsKp//dfW+I7PYj35ZOvzVXfd1TpGRzxNnVq1xRZV7e2tUJozp3X8tdeuGjq06otfbO0DAP66CSVYBl14YdV551Wdf37V//xP1TnntALinHO6jmtr6/q4aRbclnLMwsYvjTEdV21ebz5bbjn/359/vnUVasSIrmNGjGhdEapqXd1aeeXWFaQbbqjadNPWFaeOK0pTp7aublW19u24YyuQPvaxqv/4j1ZcAQB//YQSLIP+8R+rvvGN1lWVoUNbiyt89atVxx3X2r/qqq1/5tWaxx+ffyVn1VVbK9NlGOSYxx5b8PxPPNF1TJ7nmWdat/Utbszjj7f+mVeaUr9+C25bXAC2tVXtsEMriK6/vnWFaeONW4tO3HFH65bBUaNaY7t3r7rmmqpf/KLqve9tLTKxwQatWxcBgL9uQgmWQX/6U1W3+Nvfvfv85cHXWacVJ9dcM3//7NmtcNh229bjLbZo3bb32jEzZlTdeef8McOHVz33XNWvfz1/zM03t7a9dsydd7ae2+Hqq1ufR9pii/ljfvnLrkuGX31161a6tdde8te9wgqt59x4Y9ft//3fVRttNP9xx+eUpk5t/XtbW9X227euur30UtcrUm1trcdHHVX1v//bumXw0kuXfE4AwDvTcm/3BIC33oc+VHXMMVVrrln1vve1fsD/7ndbixJUtX74/8pXqo49tmq99Vpfxx5b1bdva7nvqtaCDAce2FrGe+WVq1ZaqerQQ1tXqHbaqTVmo42qdt216rOfrTr99Na2z32utYT4Bhu0Hu+8c+tqzH77tZYof/rp1nE++9lW2FS1znnUUVX771912GGthReOPbbqiCNe/9a79I//WHXkkVVDhrQ+m3TWWa0ly3/0o/ljRo2qOvjgquWWawVSx7ZDDqnafPP587r55taiGDvv3Prc1c03t66WvTa6AIC/TkIJlkEnn1x1+OGthQcef7x1leWgg1rh0eFrX2tdPfniF1u3wm29desqzvLLzx/zL//Siom9926N3XHHqrPPbl2d6vCjH7VWnetYHW/cuNbvZurQvXvVz37WOs+IEa1fKPvJT7au3nRYccXWlasvfan1maP+/av+4R9aX2/UhAmtzyodckjrtb/3vVWXX96KwQ4bb9xa6W6tteZH0ciRrdvvOj6fVNXa98tfthaCeP751vgTT6z64Aff+LwAgHeWtqaxkC0AAMBr+YwSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEEoAAABBKAEAAAShBAAAEIQSAABAEErAMuOiiy6qtra2uvDCCxfYt+mmm1ZbW1tdddVVC+wbMmRIbb755n+ROX3rW9+qtra2evLJJ9/U82+++ebac889a80116xevXrVwIEDa/jw4XXIIYcs5ZnOd/bZZ1dbW1s9+OCDndv233//Wnvttf9i51xaTj755HrPe95TPXv2rLa2tnr22WcXOq7jNd5yyy1v+BwLe3+WhhdffLGOP/742myzzaq9vb369etXw4YNq2OPPbZefPHFpXquv6Rjjz22Jk+evMD2qVOnVltbW02dOvUtnxPAwgglYJkxatSoamtrqylTpnTZ/vTTT9cdd9xR/fr1W2DfI488Uvfff3+NHj36rZzqEvnZz35W2267bT3//PM1adKkuvrqq+ukk06qESNGLDQG/5IOP/zwuvTSS9/Sc75Rt912W02YMKFGjx5d1113XU2bNq2WX375pX6e3XbbraZNm1arrbbaUjvmY489Vttss01NnDixdtlll7r00ktr8uTJ9cEPfrCOPvro2mabbeqxxx5bauf7S1pUKG2++eY1bdq0v9h/lAB4o5Z7uycA8FYZMGBAbbzxxgv8F+vrr7++lltuuTrwwAMXCKWOx+/EUJo0aVKts846ddVVV9Vyy83/n/NPfOITNWnSpLd0LkOGDHlLz/dm3HXXXVVV9dnPfrbe//73/8XO8+53v7ve/e53L9VjfvrTn6577723pkyZUtttt13n9jFjxtRuu+1Wo0ePrvHjx9eVV165VM/7eubOnVtz5sypXr16/dnHWmGFFWqbbbZZCrMCWDpcUQKWKaNHj6777ruvZsyY0blt6tSptdVWW9XYsWPr1ltvrVmzZnXZ171799p+++2rqqppmjr11FNr2LBh1adPn+rfv3999KMfrfvvv7/Lea655praY489avDgwdW7d+96z3veUwcddNAS3WJ377331rrrrltbb711Pf7444sc99RTT9WAAQO6RFKHbt0W/J/3888/v4YPH17t7e3V3t5ew4YNqzPOOGOpzHlht961tbXVl7/85frhD39YG220UfXt27c23XTTuuKKKxZ4/mWXXVabbLJJ9erVq9Zdd9066aSTOm9LXBJnnnlmbbrpptW7d+9aaaWVas8996x77rmnc/+oUaPqU5/6VFVVbb311tXW1lb777//Eh37tS6//PIaPnx49e3bt5ZffvkaM2ZMTZs2rcuYhd16N2rUqNp4441r+vTptf3221ffvn1r3XXXreOPP77mzZu32HPecsstdfXVV9eBBx7YJZI6bLfddnXAAQfUVVddVbfeemvn9o73//TTT6/111+/evXqVe9973vrxz/+8QLHmDlzZh100EE1ePDg6tmzZ62zzjp11FFH1Zw5czrHPPjgg9XW1laTJk2qo48+utZZZ53q1atXTZkypV5++eU65JBDatiwYbXiiivWSiutVMOHD6/LLrusy3na2trqxRdfrHPOOafa2tqqra2tRo0aVVWLvvVuSd7zju+Vu+66q/bZZ59accUVa+DAgXXAAQfUc889t9j3F2BRhBKwTOm4MvTaH8amTJlSI0eOrBEjRlRbW1vdcMMNXfZtvvnmteKKK1ZV1UEHHVRf+cpXaqeddqrJkyfXqaeeWnfddVdtu+22XW59+v3vf1/Dhw+v73//+3X11VfXEUccUTfffHNtt9129eqrry5yftdff31tu+22tckmm9SUKVNqlVVWWeTY4cOH180331wTJkyom2++ebHHPeKII2rfffetQYMG1dlnn12XXnppjR8/vh566KE/e86L87Of/axOOeWUmjhxYl188cWdEfPasLzyyitrr732qpVXXrkuvPDCmjRpUl1wwQV1zjnnLNE5jjvuuDrwwAPrfe97X11yySV10kkn1e23317Dhw+v3/72t1VVdeqpp9Y///M/V1XVWWedVdOmTavDDz/8Db2W888/v/bYY49aYYUV6oILLqgzzjijnnnmmRo1alTdeOONr/v8mTNn1r777luf+tSn6vLLL68PfvCD9c1vfrPOO++8xT7vmmuuqaqqD3/4w4sc07GvY2yHyy+/vL73ve/VxIkT66KLLqq11lqr9tlnn7rooou6zOv9739/XXXVVXXEEUfUL37xizrwwAPruOOOq89+9rMLnOt73/teXXfddXXCCSfUL37xi9pwww3rlVdeqaeffroOPfTQmjx5cl1wwQW13Xbb1V577VXnnntu53OnTZtWffr0qbFjx9a0adNq2rRpdeqppy7ydb3R9/wjH/lIrb/++nXxxRfXN77xjTr//PPrq1/96iKPD7BYDcAy5Omnn266devWfO5zn2uapmmefPLJpq2trbnyyiubpmma97///c2hhx7aNE3T/OEPf2iqqvna177WNE3TTJs2ramq5sQTT+xyzIcffrjp06dP57g0b9685tVXX20eeuihpqqayy67rHPfkUce2VRV88QTTzQ//OEPm549ezYTJkxo5s6d+7qv5cknn2y22267pqqaqmp69OjRbLvtts1xxx3XzJo1q3Pc/fff33Tv3r3Zd999l/h9WtyczzrrrKaqmgceeKBz2/jx45u11lqryzGqqhk4cGDz/PPPd26bOXNm061bt+a4447r3LbVVls1a6yxRvPKK690bps1a1az8sorN6/3f1PPPPNM06dPn2bs2LFdtv/hD39oevXq1Xzyk59cYN7Tp09/3defY+fOndsMGjSoGTp0aJc/m1mzZjWrrLJKs+222y7w3Ne+PyNHjmyqqrn55pu7nOe9731vs8suuyx2Lp///OebqmruvffeRY655557mqpqvvCFL3Ruq6qmT58+zcyZMzu3zZkzp9lwww2b97znPZ3bDjrooKa9vb156KGHuhzzhBNOaKqqueuuu5qmaZoHHnigqapmyJAhzezZsxc75zlz5jSvvvpqc+CBBzabbbZZl339+vVrxo8fv8BzpkyZ0lRVM2XKlKZp3th73vH3aNKkSV2O+cUvfrHp3bt3M2/evMXOF2BhXFEClin9+/evTTfdtPOK0vXXX1/du3evESNGVFXVyJEjOz+XlJ9PuuKKK6qtra0+9alP1Zw5czq/Vl111S7HrKp6/PHH6/Of/3ytscYatdxyy1WPHj1qrbXWqqrqcktYh2OOOab233//Ov744+ukk05a6K1zaeWVV64bbrihpk+fXscff3ztscce9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OOOWahxx40aFCXxwtbYOO8886rddZZpy688MIu+1955ZVFvKrX93a+5wBVrigBy6AddtihunfvXhdddFHdddddnatuVVWtuOKKNWzYsDrnnHPqwQcf7LIs+O67715N09Qf//jH2nLLLRf4Gjp0aFXN/0EyY+r0009f5JzWWmutzgDbfvvtOxchWJyF/QBZNf82uY4fcHfeeefq3r17ff/731/ksd7MnJeGfv361ZZbblmTJ0+u2bNnd25/4YUXFro6Xho+fHj16dNngQURHnnkkbruuutqxx13XCrz3GCDDWr11Vev888/v/M2t6rWrYMXX3xx56psfwlbbrll7bzzznXGGWfUr371qwX233jjjXXmmWfWrrvuWltssUWXfddee22XCJ07d25deOGFNWTIkM4rjLvvvnvdeeedNWTIkIV+X2coLUxbW1vnL/HtMHPmzAVWvatasqtoVW/vew5Q5YoSsAxaYYUVavPNN6/JkydXt27dOj+f1GHkyJH1r//6r1XV9fcnjRgxoj73uc/VZz7zmbrllltqhx12qH79+tWMGTPqxhtvrKFDh9YXvvCF2nDDDWvIkCH1jW98o5qmqZVWWql++tOfLrAiWVpttdXq+uuvr1122aV22GGHuuaaa2rjjTde5PhddtmlBg8eXB/60Idqww03rHnz5tVtt91WJ554YrW3t9fBBx9cVVVrr712HXbYYfXtb3+7Xnrppc7lk+++++568skn66ijjnrTc14aJk6cWLvttlvtsssudfDBB9fcuXPrO9/5TrW3t9fTTz+92Oe+613vqsMPP7wOO+yw+vSnP1377LNPPfXUU3XUUUdV796968gjj/yz5tbxg3+3bt1q0qRJte+++9buu+9eBx10UL3yyiv1ne98p5599tk6/vjj/6zzvJ5zzz23dtppp9p5551rwoQJnQF43XXX1UknnVQbbrhhnX322Qs8b8CAAfWBD3ygDj/88OrXr1+deuqpde+993ZZInzixIl1zTXX1LbbblsTJkyoDTbYoF5++eV68MEH6+c//3mddtppi71ts6oVW5dcckl98YtfrI9+9KP18MMP17e//e1abbXVFoj+oUOH1tSpU+unP/1prbbaarX88svXBhtssMAx3+73HMCqd8Ay6Wtf+1pTVc2WW265wL7Jkyc3VdX07NmzefHFFxfYf+aZZzZbb711069fv6ZPnz7NkCFDmk9/+tPNLbfc0jnm7rvvbsaMGdMsv/zyTf/+/ZuPfexjnavoHXnkkZ3jXrvqXYdnn322GTFiRLPSSistdoW2Cy+8sPnkJz/ZrLfeek17e3vTo0ePZs0112z222+/5u67715g/LnnnttstdVWTe/evZv29vZms802a84666w3POc3surdl770pQXmsdZaay2w6tmll17aDB06tOnZs2ez5pprNscff3wzYcKEpn///ot8/a/1gx/8oNlkk02anj17NiuuuGKzxx57dK7WlvNeklXv/u3f/q2pquaOO+7osn3y5MnN1ltv3fTu3bvp169fs+OOOza/+tWvFnqeXPXufe973wLnWdj7tigvvPBCc+yxxzbDhg1r+vbt2/Tt27fZZJNNmqOPPrp54YUXFhjf8f6feuqpzZAhQ5oePXo0G264YfOjH/1ogbFPPPFEM2HChGadddZpevTo0ay00krNFlts0fzTP/1T57E7Vr37zne+s9D5HX/88c3aa6/d9OrVq9loo42a//iP/+j8/n6t2267rRkxYkTTt2/fpqqakSNHNk2z4Kp3HZbkPV/Y36OmWfifBcCSamua11zPBoB3gFdffbWGDRtWq6++el199dVv+fkPPvjgOuWUU+rZZ5/tsmrfX5O2trb60pe+VKeccsrbPRWAv0puvQPgbXfggQfWmDFjarXVVquZM2fWaaedVvfcc0+ddNJJb+k8br311po+fXqdeeaZNW7cuL/aSALgzyeUAHjbzZo1qw499NB64oknqkePHrX55pvXz3/+89ppp53e0nl89KMfreeee67GjRtX3/ve997ScwPwzuLWOwAAgGB5cAAAgCCUAAAAglACAAAIf/OLOcybN68effTRWn755bv8xnAAAGDZ0jRNzZo1qwYNGlTdui3+mtHffCg9+uijtcYaa7zd0wAAAN4hHn744Ro8ePBix/zNh1LH78B4+OGHa4UVVnibZwMAALxdnn/++VpjjTWW6Pfk/c2HUsftdiussIJQAgAAlugjORZzAAAACEIJAAAgCCUAAIDwN/8ZJQCApa1pmpozZ07NnTv37Z4K8Brdu3ev5ZZbbqn8WiChBADwBsyePbtmzJhRf/rTn97uqQAL0bdv31pttdWqZ8+ef9ZxhBIAwBKaN29ePfDAA9W9e/caNGhQ9ezZ0y+0h3eIpmlq9uzZ9cQTT9QDDzxQ66233uv+UtnFEUoAAEto9uzZNW/evFpjjTWqb9++b/d0gNCnT5/q0aNHPfTQQzV79uzq3bv3mz6WxRwAAN6gP+e/UgN/WUvr76e/5QAAAEEoAQAABKEEAAAQLOYAALA0nP8Wr373yeatPd9f2H777VcbbbRRHXbYYW/3VBZq6tSpNXr06HrmmWfqXe9611/Nsd+Mb33rWzV58uS67bbb3hHHea0rrriiDj/88Lr11lv/4p8VdEUJAGAZsP/++1dbW9sCX7vuuuvbPbW6/fbb62c/+1n9/d//fee2+++/v/bZZ58aNGhQ9e7duwYPHlx77LFH/eY3v6mqqgcffLDa2tqW6g/h72Rrr712559Znz59au2116699967rrvuuqV+rkMPPbSuvfbaN/Sctra2mjx58p99nNez++67V1tbW51//vlL9bgLI5QAAJYRu+66a82YMaPL1wUXXLDI8a+++uoSbVsSi3veKaecUh/72Mdq+eWXr6rWMuxjxoyp559/vi655JK677776sILL6yNN964nnvuuTd1/neC2bNn/1nPnzhxYs2YMaPuu+++Ovfcc+td73pX7bTTTnXMMccspRm2tLe318orr/yOOU76zGc+UyeffPJSP24SSgAAy4hevXrVqquu2uWrf//+nfvb2trqtNNOqz322KP69etXRx99dH3rW9+qYcOG1Zlnnlnrrrtu9erVq5qmqT/84Q+1xx57VHt7e62wwgq1995712OPPdZ5rEU9L82bN69+8pOf1Lhx4zq33X333XX//ffXqaeeWttss02ttdZaNWLEiDrmmGNqq622qqqqddZZp6qqNttss2pra6tRo0ZVVdX06dNrzJgxNWDAgFpxxRVr5MiR9T//8z9dztnW1lY/+MEPas8996y+ffvWeuutV5dffnmXMT//+c9r/fXXrz59+tTo0aPrwQcf7LL/qaeeqn322acGDx5cffv2raFDhy4QnaNGjaovf/nL9Q//8A81YMCAGjNmzBIde1GWX375WnXVVWvNNdesHXbYof793/+9Dj/88DriiCPqvvvu6/L+jR07ttrb22vgwIG133771ZNPPllVVaeffnqtvvrqNW/evC7HHjduXI0fP76q5v/ZdXi993Tttdeuqqo999yz2traOh/ncebNm1cTJ06swYMHV69evWrYsGF15ZVXdu7vuEp4ySWX1OjRo6tv37616aab1rRp0xaY669//eu6//77l+h9e7OEEgAAnY488sjaY4896o477qgDDjigqqp+97vf1X/+53/WxRdf3Hmr24c//OF6+umn6/rrr69rrrmmfv/739fHP/7xLsda2PPS7bffXs8++2xtueWWndve/e53V7du3eqiiy6quXPnLvR5v/71r6uq6r/+679qxowZdckll1RV1axZs2r8+PF1ww031E033VTrrbdejR07tmbNmtXl+UcddVTtvffedfvtt9fYsWNr3333raeffrqqqh5++OHaa6+9auzYsXXbbbfV3/3d39U3vvGNLs9/+eWXa4sttqgrrrii7rzzzvrc5z5X++23X918881dxp1zzjm13HLL1a9+9as6/fTTl+jYb8TBBx9cTdPUZZddVlVVM2bMqJEjR9awYcPqlltuqSuvvLIee+yx2nvvvauq6mMf+1g9+eSTNWXKlM5jPPPMM3XVVVfVvvvuu9BzvN57On369KqqOuuss2rGjBmdj9NJJ51UJ554Yp1wwgl1++231y677FLjxo2r3/72t13G/dM//VMdeuihddttt9X6669f++yzT82ZM6dz/1prrVWrrLJK3XDDDW/yXVtCzd+45557rqmq5rnnnnu7pwIA/JV76aWXmrvvvrt56aWXFtz5o3prv96g8ePHN927d2/69evX5WvixImdY6r+f3v3HR5llb9//J6E9EYLgSwhQXqXpgIqstLExSB+lQWkCCsiroBIEQUBpShrgbWggAIiILoIIjaKEKQXCSAEEYgGKRsQTAiRQJLz+8NfZpknhQxMMmF4v65rritznvaZyZnM3DnPc0Zm6NChDtuNGzfO+Pj4mOTkZHvbypUrjbe3t0lKSrK37du3z0gy27Zty3e7vCxdutR4e3ub7Oxsh/Y333zTBAYGmpCQENOmTRvzwgsvmMOHD9uXJyYmGklm165dBe4/MzPThISEmM8//9zhcY4ZM8Z+Py0tzdhsNvPVV18ZY4wZP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C3nnnnaKoEwAAAACKjdMjSkOGDFGzZs109uxZBQQE2Nvvv/9+rVmzxqXFAQAAAIA7OD2itGHDBm3cuFG+vr4O7dHR0Tp27JjLCgMAAAAAd3F6RCk7O1tZWVm52n/99VeFhIS4pCgAAAAAcCeng1K7du00bdo0+32bzaa0tDSNGzdOnTp1cmVtAAAAAOAWNmOMcWaD48ePq02bNvL29tZPP/2kZs2a6aefflL58uW1fv16VahQoahqvSqpqakKCwtTSkqKQkND3V0OAJQ4Npu7K4CrOffODgA3DmeygdPXKEVGRio+Pl6LFi3S999/r+zsbPXv3189e/Z0mNwBAAAAAK5XTo8oXW8YUQKAgjGi5Hk8+50dAK5ekY4oLV++PM92m80mf39/Va9eXVWrVnV2twAAAABQYjgdlLp06SKbzSbrQFROm81m0+23365ly5apTJkyLisUAACUbIxOeh5GJ3Ejc3rWu1WrVql58+ZatWqVUlJSlJKSolWrVumWW27RihUrtH79ev32228aPnx4UdQLAAAAAEXO6RGlIUOGaObMmWrZsqW97e6775a/v78GDBigffv2adq0aerXr59LCwUAAACA4uL0iNLhw4fzvPApNDRUR44ckSTVqFFDp0+fvvbqAAAAAMANnA5KTZs21YgRI3Tq1Cl726lTpzRy5Eg1b95ckvTTTz+pcuXKrqsSAAAAAIqR06fevffee4qNjVXlypUVFRUlm82mpKQk3XTTTfrss88kSWlpaRo7dqzLiwUAAACA4nBV36NkjNE333yjgwcPyhij2rVrq127dvLycnqAqsjxPUoAUDBmKvM87pqpjL7keZj1Dp7GmWzAF84CwA2OD7eeh6AEV/HsT4m4ERXpF85K0vnz5xUXF6ekpCRdvHjRYdngwYOvZpcAAAAAUGI4HZR27dqlTp06KT09XefPn1fZsmV1+vRpBQYGqkKFCgQlAAAAANc9py8qeuqpp9S5c2edOXNGAQEB2rJli3755Rc1bdpUr7zySlHUCAAAAADFyumgFB8fr6efflre3t7y9vZWRkaGoqKiNHXqVD377LNFUSMAAAAAFCung5KPj49s//9qzYiICCUlJUmSwsLC7D8DAAAAwPXM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QGqU6eOpk+ffsXjx8TEyGazacuWLQ7tQ4cO1V133eWyx4miVVL60UcffZRrWb169WSz2TR37lx724kTJ3TPPfdc24NGvr/3Q4cOubWuuXPnFtkXiM+aNUt33HGHypQpozJlyqht27batm2bwzrjx4/P9ZxUrFjxivu+ePGipk6dqkaNGikwMFDly5dXq1atNGfOHF26dEmS43Pu4+Ojm266ScOHD9f58+clSevWrZPNZtPvv/+ea/8333yzxo8ff83PQXG4EfvW3Llz83zMFy5cKHA7Y4xmzpypW2+9VcHBwSpdurSaNWumadOmKT09XZJjn/T29lZUVJT+8Y9/6NSpU5Kkn3/+WTabTfHx8bn236VLF/Xt29fVD7fIXN53SpUqpSpVqujxxx/X2bNnHdbzpPeB9evXq3PnzoqMjCx0AMzpb9b36d9//102m03r1q0rmmI9FEHJg3Xs2FEnTpxwuC1atMi+fMWKFbrtttuUkZGhBQsWKCEhQfPnz1dYWJjGjh0rSdq5c6fCw8P14Ycfat++fXruuec0evRovfnmm1c8vr+/v0aNGlVkjw/Fw939KCoqSnPmzHFo27Jli06ePKmgoCCH9ooVK171NKs5H1jxp7x+71WrVnV6P1lZWcrOzi6CCl1r3bp16t69u9auXavNmzerSpUqat++vY4dO+awXr169Ryek7179xa434sXL6pDhw566aWXNGDAAG3atEnbtm3TE088oTfeeEP79u2zr5vznB85ckQTJ07U22+/reHDhxfJ43WnG61vSVJoaGiux+zv71/gNr169dLQoUMVGxurtWvXKj4+XmPHjtVnn32mlStX2tfL6ZNJSUmaMWOGPv/8c/Xu3buoH5Jb5PSdn3/+WbNnz9bnn3+uQYMGOaxzLe8DJc358+fVqFGjQr1XXq5UqVJas2aN1q5dW0SV3UAMPFKfPn1MbGxsvsvPnz9vypcvb7p06ZLn8rNnz+a77aBBg0ybNm0KPH50dLQZMmSI8fX1NV988YW9fciQIaZ169b2+9u2bTNt27Y15cqVM6GhoebOO+80O3fudNiXJDNr1izTpUsXExAQYKpXr24+++wzh3XWrVtnmjdvbnx9fU3FihXNqFGjzKV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lpX//+9/64YcfNG/ePH377be5fv/p6emaMmWKZs+erX379qlChQrq3bu3jh8/rnXr1mnJkiWaOXOmkpOTC73vli1batq0aQ7/mc8ZbXnkkUe0ceNGffTRR9qzZ48efPBBdezYUT/99NNVP8709HRdunQpVx/96aefFBkZqapVq+rvf/+7jhw5UuB+FixYoLZt26px48a5lvn4+OQaFb1cQEDADTXS6cl9Ky0tTdHR0apcubL+9re/adeuXQWuv2DBAtWqVUuxsbG5ltlsNoWFheW7bUBAgLKzs5WZmelUjdebI0eO6Ouvv5aPj0++6/Ts2VOLFi2SuewrQxcvXqyIiAi1bt1a0p+jvi+++KJ2796tZcuWKTExMc9TEp977jm9+uqr2rFjh0qVKpXrPejw4cNatmyZVqxYoRUrViguLk4vvfSSffn58+c1bNgwbd++XWvWrJGXl5fuv//+IhsVHT9+vPbu3av//Oc/eS5PT09Xx44dVaZMGW3fvl2ffPKJVq9erX/+85/2dV599VW9//77eu+997RhwwadOXNGS5cuddjPmDFjNGfOHM2YMUP79u3TU089pYcfflhxcXFF8riKnbuTGopGnz59jLe3twkKCnK4vfDCC8aYP//LKcmcOXPGqf1u2rTJ+Pj4mJUrVxa4Xs5/85KTk01ISIj54IMPjDG5R5Sscv6L+/nnn9vbJJkxY8bY76elpRmbzWa++uorY4wxzz77rKlVq5bJzs62r/PWW2+Z4OBgk5WV5dTjg6OS0o+WLVtmqlWrZrKzs828efNM48aNjTGmwBGld99914SEhJjffvstz32PGzfO+Pj4mOTkZHvbypUrjbe3t8Po1b59+4wks23bNqce4/Usr9/7//3f/+W57scff2zKlStnvz9nzhwjycTHx9vbEhISjCSzfft2e9tPP/1kJDn8178w+7b+Z/7QoUPGZrOZY8eOObTffffdZvTo0YV5uHkaNGiQqVatmvnjjz/sbV9++aX5z3/+Y/bs2WNWrVplWrdubSIiIszp06fz3U9AQIAZPHjwFY9n/W/51q1bTbly5cxDDz1kjPGsEaUbrW9t3rzZzJ8/38THx5v169ebBx54wAQEBJiDBw/mu02dOnXMfff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nTp06JBCQkIUHBys4OBglS1bVhcuXNDhw4eLpAYAQMEISgCAa2KdGMFmsyk7O/uK2wUFBTnc//jjj/XUU0+pX79+WrlypeLj4/XII484nHo2Z84cbd68WS1bttTixYtVs2ZNbdmyxeljeXl5yRjj0Hbp0iWH+wEBAVfcr1Vh9ptXPdnZ2WratKni4+MdbgcPHlSPHj2crgMAcO049Q4AUCJ89913atmypQYNGmRvy2s0pXHjxmrcuLFGjx6tFi1aaOHChbrtttvk6+urrKysQh0rPDxc586d0/nz5+2hJT4+3mGdhg0bas2aNXrkkUfy3EdexwsPD9fJkydljLGfQmfdb16aNGmixYsXq0KFCgoNDS3UYwAAFC1GlAAAJUL16tW1Y8cOffPNNzp48KDGjh2r7du325cnJiZq9OjR2rx5s3755RetXLlSBw8etF+nFBMTo8TERMXHx+v06dPKyMjI91i33nqrAgMD9eyzz+rQoUNauHChfZa8HOPGjdOiRYs0btw4JSQkaO/evZo6dap9eUxMjNavX69jx47p9OnTkv6cDe/UqVOaOnWqDh8+rLfeektfffXVFR97z549Vb58ecXGxuq7775TYmKi4uLiNGTIEP3666/OPI0AABchKAEASoSBAweqa9eu6tatm2699Vb99ttvDqNLgYGBOnDggB544AHVrFlTAwYM0D//+U899thjkqQHHnhAHTt2VJs2bRQeHq5Fixble6yyZcvqww8/1JdffqkGDRpo0aJFDtOaS3+Gnk8++UTLly/XzTffrL/+9a/aunWrffkLL7ygn3/+WdWqVVN4eLikPyeXePvtt/XWW2+pUaNG2rZtm4YPH37Fxx4YGKj169erSpUq6tq1q+rUqaN+/frpjz/+YIQJANzEZqwnUwMAAADADY4RJQAAAACwICgBAAAAgAVBCQAAAAAsCEoAAAAAYEFQAgAAAAALghIAAAAAWBCUAAAAAMCCoAQAAAAAFgQlAAAAALAgKAEAAACABUEJAAAAACz+H16bEj/nEy1YAAAAAElFTkSuQmCC" + }, + "metadata": {}, + "output_type": "display_data" + } + ] + }, + { + "cell_type": "code", + "source": [ + "from IPython.core.display import SVG\n", + "from matplotlib import markers\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data loading\n", + "\n", + "world_size = ['4|148', '6|222', '8|296', '10|370', '12|444', '14|518']\n", + "baremetal_cylon = [18.93717813, 19.75821758, 19.84387813, 20.68476873, 21.04591821, 21.59903709]\n", + "rp_cylon = [19.27405391, 20.4443211, 20.7198427, 21.2812939, 21.50566909, 21.78800784]\n", + "\n", + "rp_cylon_err = [0.2107801437, 0.3222160003, 1.022121528, 0.349553999, 0.3169727816, 1.534950139]\n", + "bm_cylon_err = [0.6005659103, 1.614059141, 0.8212216271, 0.2230492727, 0.1857792821, 2.082797966]\n", + "\n", + "plt.plot(world_size, baremetal_cylon, marker='o', color='b', label='BM-Cylon')\n", + "plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "\n", + "plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "\n", + "custom_text = \"35m rows\"\n", + "plt.text(4, 24, custom_text, fontsize=10, color='orange', ha='center')\n", + "\n", + "plt.ylim(15, 25)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "plt.xlabel('nodes | parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Weak Scaling of Sort Operation')\n", + "\n", + "plt.legend()\n", + "\n", + "#save the figure\n", + "plt.savefig('sort-w-scaling.svg', format='svg')\n", + "\n", + "#display the graph\n", + "\n", + "plt.show()\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "eg1zeZcSLRAI", + "outputId": "3ab2569d-7c8c-4317-8a24-ea9de8c62b34" + }, + "execution_count": 17, + "outputs": [ + { + "ename": "ValueError", + "evalue": "'x' and 'y' must have the same size", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mValueError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[17], line 20\u001B[0m\n\u001B[1;32m 18\u001B[0m plt\u001B[38;5;241m.\u001B[39merrorbar(world_size, baremetal_cylon, yerr\u001B[38;5;241m=\u001B[39mbm_cylon_err, fmt\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mx\u001B[39m\u001B[38;5;124m'\u001B[39m, color\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mb\u001B[39m\u001B[38;5;124m'\u001B[39m, ecolor\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mb\u001B[39m\u001B[38;5;124m'\u001B[39m, capsize\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m5\u001B[39m)\n\u001B[1;32m 19\u001B[0m plt\u001B[38;5;241m.\u001B[39merrorbar(world_size, rp_cylon, yerr\u001B[38;5;241m=\u001B[39mrp_cylon_err, fmt\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mo\u001B[39m\u001B[38;5;124m'\u001B[39m, color\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mg\u001B[39m\u001B[38;5;124m'\u001B[39m, ecolor\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mg\u001B[39m\u001B[38;5;124m'\u001B[39m, capsize\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m5\u001B[39m)\n\u001B[0;32m---> 20\u001B[0m \u001B[43mplt\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43merrorbar\u001B[49m\u001B[43m(\u001B[49m\u001B[43mworld_size\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mfargate_4_26\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43myerr\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mfargate_4_26_err\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mfmt\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mx\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcolor\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mr\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mecolor\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mr\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcapsize\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;241;43m5\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[1;32m 22\u001B[0m custom_text \u001B[38;5;241m=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m35m rows\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 23\u001B[0m plt\u001B[38;5;241m.\u001B[39mtext(\u001B[38;5;241m4\u001B[39m, \u001B[38;5;241m24\u001B[39m, custom_text, fontsize\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m10\u001B[39m, color\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124morange\u001B[39m\u001B[38;5;124m'\u001B[39m, ha\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mcenter\u001B[39m\u001B[38;5;124m'\u001B[39m)\n", + "File \u001B[0;32m~/Documents/phd/code/cylon_experiments/venv/lib/python3.9/site-packages/matplotlib/pyplot.py:3030\u001B[0m, in \u001B[0;36merrorbar\u001B[0;34m(x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, data, **kwargs)\u001B[0m\n\u001B[1;32m 3009\u001B[0m \u001B[38;5;129m@_copy_docstring_and_deprecators\u001B[39m(Axes\u001B[38;5;241m.\u001B[39merrorbar)\n\u001B[1;32m 3010\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21merrorbar\u001B[39m(\n\u001B[1;32m 3011\u001B[0m x: \u001B[38;5;28mfloat\u001B[39m \u001B[38;5;241m|\u001B[39m ArrayLike,\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 3028\u001B[0m \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs,\n\u001B[1;32m 3029\u001B[0m ) \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m>\u001B[39m ErrorbarContainer:\n\u001B[0;32m-> 3030\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mgca\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43merrorbar\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 3031\u001B[0m \u001B[43m \u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3032\u001B[0m \u001B[43m \u001B[49m\u001B[43my\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3033\u001B[0m \u001B[43m \u001B[49m\u001B[43myerr\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43myerr\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3034\u001B[0m \u001B[43m \u001B[49m\u001B[43mxerr\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mxerr\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3035\u001B[0m \u001B[43m \u001B[49m\u001B[43mfmt\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mfmt\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3036\u001B[0m \u001B[43m \u001B[49m\u001B[43mecolor\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mecolor\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3037\u001B[0m \u001B[43m \u001B[49m\u001B[43melinewidth\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43melinewidth\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3038\u001B[0m \u001B[43m \u001B[49m\u001B[43mcapsize\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mcapsize\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3039\u001B[0m \u001B[43m \u001B[49m\u001B[43mbarsabove\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mbarsabove\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3040\u001B[0m \u001B[43m \u001B[49m\u001B[43mlolims\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mlolims\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3041\u001B[0m \u001B[43m \u001B[49m\u001B[43muplims\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43muplims\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3042\u001B[0m \u001B[43m \u001B[49m\u001B[43mxlolims\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mxlolims\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3043\u001B[0m \u001B[43m \u001B[49m\u001B[43mxuplims\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mxuplims\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3044\u001B[0m \u001B[43m \u001B[49m\u001B[43merrorevery\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43merrorevery\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3045\u001B[0m \u001B[43m \u001B[49m\u001B[43mcapthick\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mcapthick\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3046\u001B[0m \u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43m{\u001B[49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mdata\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m:\u001B[49m\u001B[43m \u001B[49m\u001B[43mdata\u001B[49m\u001B[43m}\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mif\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mdata\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01mis\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[38;5;129;43;01mnot\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[38;5;28;43;01melse\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43m{\u001B[49m\u001B[43m}\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3047\u001B[0m \u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3048\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n", + "File \u001B[0;32m~/Documents/phd/code/cylon_experiments/venv/lib/python3.9/site-packages/matplotlib/__init__.py:1465\u001B[0m, in \u001B[0;36m_preprocess_data..inner\u001B[0;34m(ax, data, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1462\u001B[0m \u001B[38;5;129m@functools\u001B[39m\u001B[38;5;241m.\u001B[39mwraps(func)\n\u001B[1;32m 1463\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21minner\u001B[39m(ax, \u001B[38;5;241m*\u001B[39margs, data\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mNone\u001B[39;00m, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs):\n\u001B[1;32m 1464\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m data \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m-> 1465\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mfunc\u001B[49m\u001B[43m(\u001B[49m\u001B[43max\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;28;43mmap\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43msanitize_sequence\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43margs\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 1467\u001B[0m bound \u001B[38;5;241m=\u001B[39m new_sig\u001B[38;5;241m.\u001B[39mbind(ax, \u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs)\n\u001B[1;32m 1468\u001B[0m auto_label \u001B[38;5;241m=\u001B[39m (bound\u001B[38;5;241m.\u001B[39marguments\u001B[38;5;241m.\u001B[39mget(label_namer)\n\u001B[1;32m 1469\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m bound\u001B[38;5;241m.\u001B[39mkwargs\u001B[38;5;241m.\u001B[39mget(label_namer))\n", + "File \u001B[0;32m~/Documents/phd/code/cylon_experiments/venv/lib/python3.9/site-packages/matplotlib/axes/_axes.py:3569\u001B[0m, in \u001B[0;36mAxes.errorbar\u001B[0;34m(self, x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, **kwargs)\u001B[0m\n\u001B[1;32m 3567\u001B[0m x, y \u001B[38;5;241m=\u001B[39m np\u001B[38;5;241m.\u001B[39matleast_1d(x, y) \u001B[38;5;66;03m# Make sure all the args are iterable.\u001B[39;00m\n\u001B[1;32m 3568\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mlen\u001B[39m(x) \u001B[38;5;241m!=\u001B[39m \u001B[38;5;28mlen\u001B[39m(y):\n\u001B[0;32m-> 3569\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mx\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m and \u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124my\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m must have the same size\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m 3571\u001B[0m everymask \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_errorevery_to_mask(x, errorevery)\n\u001B[1;32m 3573\u001B[0m label \u001B[38;5;241m=\u001B[39m kwargs\u001B[38;5;241m.\u001B[39mpop(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mlabel\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;28;01mNone\u001B[39;00m)\n", + "\u001B[0;31mValueError\u001B[0m: 'x' and 'y' must have the same size" + ] + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiEAAAGdCAYAAADE96MUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9t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174+7du3JXw+5FRERwt+I6wM9ZPkOGDLGbvXSsGT/numHtn7PdjAkhIiIi28LuGCIiIpIFQwgRERHJgiGEiIiIZMEQQkRERLJgCCEiIiJZMIQQERGRLBhCiIiISBb/D0nKEjJKJbsyAAAAAElFTkSuQmCC" + }, + "metadata": {}, + "output_type": "display_data" + } + ] + }, + { + "cell_type": "code", + "source": [ + "from IPython.core.display import SVG\n", + "from matplotlib import markers\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data loading\n", + "\n", + "world_size = ['4|148', '6|222', '8|296', '10|370', '12|444', '14|518']\n", + "baremetal_cylon = [12.48204808, 8.280943102, 6.334967629, 5.099316477, 4.445687452, 3.851617681]\n", + "rp_cylon = [12.55294192, 8.420808574, 6.376633428, 5.131316051, 4.446267159, 3.95247161]\n", + "\n", + "rp_cylon_err = [0.6438074455, 0.6394383387, 0.8082996274, 1.177945473, 1.520513786, 1.981052724]\n", + "bm_cylon_err = [0.5287349256, 0.5657937827, 0.3046811328, 1.282029453, 1.70061018, 1.693347512]\n", + "\n", + "# Create a line chart\n", + "plt.plot(world_size, baremetal_cylon, marker='o', color='b', label='BM-Cylon')\n", + "plt.plot(world_size, rp_cylon, marker='o', color='g', label='RP-Cylon')\n", + "\n", + "plt.errorbar(world_size, baremetal_cylon, yerr=bm_cylon_err, fmt='x', color='b', ecolor='b', capsize=5)\n", + "plt.errorbar(world_size, rp_cylon, yerr=rp_cylon_err, fmt='o', color='g', ecolor='g', capsize=5)\n", + "\n", + "custom_text = \"3.5B rows\"\n", + "plt.text(0.3, 14, custom_text, fontsize=10, color='orange', ha='center')\n", + "\n", + "plt.ylim(1, 15)\n", + "\n", + "plt.xticks(world_size)\n", + "\n", + "plt.xlabel('nodes | parallelism')\n", + "plt.ylabel('average time (s)')\n", + "plt.title('Strong Scaling of Sort Operation')\n", + "\n", + "plt.legend()\n", + "\n", + "#save the figure\n", + "plt.savefig('sort-s-scaling.svg', format='svg')\n", + "\n", + "#display the graph\n", + "\n", + "plt.show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 473 + }, + "id": "dFHyhBGqR8cL", + "outputId": "2f2f0768-20ff-4b13-baee-fd61c2c97c8a" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAHICAYAAABZM3D8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACIeklEQVR4nOzdd1gUVxfA4d/SOwiCgCBYsWKPsfcYNXZjNEaxJDGxl8SSxIAaSzS2xBJb1NhjN5YYe++KsYu9YUd63/n+2M/VFdBFgWXhvM8zye6dO3fODCt7uHPnjkpRFAUhhBBCCCNmYugAhBBCCCHelSQ0QgghhDB6ktAIIYQQwuhJQiOEEEIIoycJjRBCCCGMniQ0QgghhDB6ktAIIYQQwuhJQiOEEEIIoycJjRBCCCGMniQ0QogU6tSpQ506dbTvb9y4gUqlYsGCBQaLSR8PHjygbdu2uLi4oFKpmDJliqFDEmkICgpCpVIZOgyRg0hCI4zOmTNnaNu2LT4+PlhZWZE/f34aNmzIb7/9plNvzJgxrFu3zjBBZqD9+/fTuHFj8ufPj5WVFQUKFKBZs2YsXbrU0KFlOwMGDGDr1q0MGzaMRYsW8eGHH6ZZNyoqisDAQEqXLo2trS0uLi6UK1eOfv36ce/evQyNa/PmzQQFBaVrG0VRWLRoEbVq1cLJyQkbGxvKlCnDyJEjiY6OztD4MktMTAxBQUHs3r3b0KGIXEAlz3ISxuTgwYPUrVuXAgUKEBAQgLu7O7dv3+bw4cNcvXqVK1euaOva2dnRtm3bbN+r8DorV67kk08+oVy5crRv3548efJw/fp19u7di7m5Obt27cqU/T7vnXn+RaQoCvHx8Zibm2Nqapop+8wI7u7uNGjQgMWLF7+2XmJiIlWqVOHixYsEB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ff/wxRYsWZcyYMdpLAZ9//jkLFy6kbdu2DBo0iCNHjjB27FguXLjA2rVrdba/cuUKbdu2pXv37gQEBPDHH3/QpUsXKlasSKlSpQC4e/cudevWRaVSMWzYMGxtbZk7dy6WlpZ6H++OHTu4c+cOXl5er63bvXt3FixYQOPGjfn8889JSkpi3759HD58mEqVKgEwc+ZMSpUqRfPmzTEzM+Pvv/+mZ8+eqNVqevXqpVdML0tOTqZRo0ZUqVKFX375he3btzNx4kQKFy7M119/DYBaraZZs2YcPXqUr7/+muLFi7N+/XoCAgL02seDBw+oVq0aMTEx9O3bFxcXFxYuXEjz5s1ZtWoVrVq1olatWixatIhOnTrRsGFDOnfu/No2fXx8APjzzz/54YcfXjs4dfv27TRu3JhChQoRFBREbGwsv/32G9WrV+fkyZP4+vrq1H/1c1W+fHnu3bvHtm3bWLRo0RuPd//+/YSFhdGvX780ezA6d+7M/Pnz2bhxI++//762PCQkhE8++YSvvvqKgIAA5s+fz8cff8w///xDw4YNAc24ltq1a3P37l169OhBgQIFOHjwIMOGDSM0NDTFQOr58+cTFxfHl19+iaWlJc7OzkRERDB37lw6dOjAF198QWRkJPPmzaNRo0YcPXqUcuXK4erqysyZM/n6669p1aoVrVu3BsDf3z/NY8/of38ilzF0RiVEevz777+KqampYmpqqlStWlUZPHiwsnXrViUhISFFXVtbW22vzMue/2XYoUMHnfLnPQaff/65Tvk333yjADp/ffr4+CiAsnfvXm3Zw4cPFUtLS2XQoEHasj59+igqlUo5deqUtuzJkyeKs7OzXj008+bNUwDFwsJCqVu3rjJ8+HBl3759On9JK4qi7Ny5UwGUvn37pmhDrVZrX8fExKRY36hRI6VQoUI6Zfr20ADKyJEjdbYtX768UrFiRe371atXK4AyZcoUbVlycrJSr149vXpo+vfvrwDKvn37tGWRkZFKwYIFFV9fX51zASi9evV6bXuKojkPfn5+CqD4+PgoXbp0UebNm6c8ePAgRd1y5copbm5uypMnT7Rlp0+fVkxMTJTOnTtry9L6XCmKovTq1eu1vTIvmzJlig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sLCqF69OnXr1mXLli24uroSEhJCnjx50tzmxIkTuLm5sXjxYry9vTl48CBffvklpqam9O7dG9D842jYsCFjxozBycmJ+fPn06xZM44cOUL58uUB2LNnD7169aJy5cokJSXx3Xff8cEHH3D+/HlsbW2z5Pizytt8rvQ5zzNnzmTYsGHMmTOHypUrc/ToUb744gvy5MlDs2bNAEhISKBhw4a4ubmxatUq8ufPz82bN3Fycsqqw8800dHRlC1blm7dutG6desU68ePH8+vv/7KwoULKViwIMOHD6dRo0acP38eKyurVNu0tbWld+/e+Pv7Y2try/79++nRowe2trZ8+eWXgOb3UnJysnabs2fP0rBhQz7++GNt2YABA9i0aRMrV67E0dGR3r1707p1aw4cOJDBZyHzve48x8TEcPLkSYYPH07ZsmUJCwujX79+NG/e/LV/GD33ut/Hz+nzPTBlypQMfXSOobzpM/3c2rVrOXz4MJ6ennq3fenSJZ2Zgt3c3NK134EDB7Jz504WL16Mr68v//77Lz179sTT05PmzZvrF4SSS0VGRipFixZVtm3bptSuXVvp16+fdl1gYKASEBCQ6nYBAQFKixYt0mz3k08+UX744QclMDBQKVu2rM66pk2bKt26ddMpa926tdKxY8e3PIrsbciQIUqNGjVeW2f+/PlK7dq1X1unZ8+eSt26dV9bp2TJksqIESPSXP/w4UMFUPbs2fPadoyRPp+rtznPVatWVb755hudOgMHDlSqV6+ufT9z5kylUKFCSkJCwjscQfYHKGvXrtW+V6vViru7uzJhwgRt2bNnzxRLS0tl2bJl2rKAgAAlMDDwtW23atVK+eyzz9Jc369fP6Vw4cKKWq3W7sfc3FxZuXKlts6FCxcUQDl06FA6jyx7efU8p+bo0aMKoNy8eVNbltZ5ft3vY0V5/ffAc6dOnVLy58+vhIaG6hWfsUjrWO7cuaPkz59fOXv2rOLj46NMnjxZZ/2r53rXrl0KoISFhb3TfkuVKqWMHDlSp6xChQrK999/r1e7iqIoufaSU69evWjatCkNGjTIsDbnz5/PtWvXCAwMTHV9tWrV2LFjB5cvXwY03f779++ncePGGRZDdrJhwwYqVar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DY0NTXBYrHg7u4O6enpX67/4OAAz8/PSExMFOtKTk5GdnY2bm9vcXx8jJmZGVRUVAAAdnZ24hp3d3cX9fX1aGlpAfDXXqOTkxPxN/lMSUkJrq+vkZCQ8OW9QjKZDEajEUajEaOjo8jJycHS0hJcLteXxiP6v2OgIfrBzGYzDAYD7HY7fD4f3t7e0N3djcrKSnEZpq+vDw6HA6WlpTAajZibm8Ph4SFyc3PFccbGxuB0OpGamgqLxYJYLIb9/X3c39/D5XLB6/VCq9WiuLgYgiBgYWEBGo0mrrcVH3l9fUV7eztGRkZwfn4Ot9uNnp4eCIIAlUqFjIwMTE9PQ6vV4uLiAkNDQ3GNq9frsbi4iGAwCJVKBa/Xi5ubm7gDjdlsRnl5OaxWKzweD/Ly8nB1dYXV1VU0NDS8W+L6p1AohM3NTdTU1CAzMxOhUAiRSAQFBQVxzU9E7zHQEP1gMpkMKysr6O3thclkgiAIsFgs8Pv9YhubzYazszMMDg7i5eUFjY2N6Orqwtramtimo6MDCoUC4+PjGBgYQFJSEgwGg3iSbkpKCjweD05PTyGXy1FWVoZAIPC3PSBfUV1dDb1eD5PJhFgshubmZvGzdEEQMD8/D6fTiaKiIuTn52NqagpVVVWfjjsyMoJwOIza2looFAp0dnbCarXi4eEhrrpkMhkCgQCGh4fR1taGSCQCjUYDk8kEtVr9aX+lUont7W34fD48Pj4iJycHExMTqKuri2t+InpP9usXj64kou91fn4OnU734cm5DocD0WgUy8vL31cYEUkWv3IiIiIiyWOgISIiIsnjHhoi+nZpaWlwu90ftpmdnf2eYojoR+AeGiIiIpI8LjkRERGR5DHQEBERkeQx0BAREZHkMdAQERGR5DHQEBERkeQx0BAREZHkMdAQERGR5DHQEBERkeT9Bok5eWGxVJtBAAAAAElFTkSuQmCC\n" + }, + "metadata": {} + } + ] + } + ] +} diff --git a/aws/scripts/cylon_scaling.py b/aws/scripts/cylon_scaling.py index 34ba2015b..402eee730 100644 --- a/aws/scripts/cylon_scaling.py +++ b/aws/scripts/cylon_scaling.py @@ -84,6 +84,8 @@ def cylon_join(data=None): df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + timing = {'scaling': [], 'world': [], 'rows': [], 'max_value': [], 'rank': [], 'avg_t':[], 'tot_l':[]} + for i in range(data['it']): env.barrier() StopWatch.start(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") @@ -100,7 +102,13 @@ def cylon_join(data=None): if env.rank == 0: avg_t = sum_t / env.world_size print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) - print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, file=open(data['output_summary_filename'], 'a')) + timing['scaling'].append(data['scaling']) + timing['world'].append(env.world_size) + timing['rows'].append(num_rows) + timing['max_value'].append(max_val) + timing['rank'].append(i) + timing['avg_t'].append(avg_t) + timing['tot_l'].append(tot_l) StopWatch.stop(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") StopWatch.stop(f"join_total_{data['host']}_{data['rows']}_{data['it']}") @@ -108,6 +116,14 @@ def cylon_join(data=None): if env.rank == 0: StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], object_name=data['s3_stopwatch_object_name']) + + + if os.path.exists(data['output_summary_filename']): + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='a', index=False, header=False) + else: + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='w', index=False, header=True) + + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], object_name=data['s3_summary_object_name']) @@ -151,6 +167,8 @@ def cylon_sort(data=None): if env.rank == 0: print("Task# ", data['task']) + timing = {'scaling': [], 'world': [], 'rows': [], 'max_value': [], 'rank': [], 'avg_t': [], 'tot_l': []} + for i in range(data['it']): env.barrier() StopWatch.start(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") @@ -166,8 +184,15 @@ def cylon_sort(data=None): if env.rank == 0: avg_t = sum_t / env.world_size print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) - print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, - file=open(data['output_summary_filename'], 'a')) + timing['scaling'].append(data['scaling']) + timing['world'].append(env.world_size) + timing['rows'].append(num_rows) + timing['max_value'].append(max_val) + timing['rank'].append(i) + timing['avg_t'].append(avg_t) + timing['tot_l'].append(tot_l) + #print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + # file=open(data['output_summary_filename'], 'a')) StopWatch.stop(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") @@ -178,9 +203,14 @@ def cylon_sort(data=None): StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], object_name=data['s3_stopwatch_object_name']) + + if os.path.exists(data['output_summary_filename']): + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='a', index=False, header=False) + else: + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='w', index=False, header=True) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], object_name=data['s3_summary_object_name']) - redis_context.clearDB() def cylon_slice(data=None): @@ -222,6 +252,7 @@ def cylon_slice(data=None): if env.rank == 0: print("Task# ", data['task']) + timing = {'scaling': [], 'world': [], 'rows': [], 'max_value': [], 'rank': [], 'avg_t': [], 'tot_l': []} for i in range(data['it']): env.barrier() StopWatch.start(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") @@ -239,8 +270,15 @@ def cylon_slice(data=None): if env.rank == 0: avg_t = sum_t / env.world_size print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) - print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, - file=open(data['output_summary_filename'], 'a')) + #print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + # file=open(data['output_summary_filename'], 'a')) + timing['scaling'].append(data['scaling']) + timing['world'].append(env.world_size) + timing['rows'].append(num_rows) + timing['max_value'].append(max_val) + timing['rank'].append(i) + timing['avg_t'].append(avg_t) + timing['tot_l'].append(tot_l) StopWatch.stop(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") StopWatch.stop(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") @@ -249,6 +287,12 @@ def cylon_slice(data=None): StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], object_name=data['s3_stopwatch_object_name']) + + if os.path.exists(data['output_summary_filename']): + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='a', index=False, header=False) + else: + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='w', index=False, header=True) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], object_name=data['s3_summary_object_name']) @@ -257,28 +301,43 @@ def cylon_slice(data=None): if __name__ == "__main__": parser = argparse.ArgumentParser(description="cylon scaling") + parser.add_argument('-n', dest='rows', type=int, **environ_or_required('ROWS')) + parser.add_argument('-i', dest='it', type=int, **environ_or_required('PARTITIONS')) #10 + parser.add_argument('-u', dest='unique', type=float, **environ_or_required('UNIQUENESS'), help="unique factor") #0.9 + parser.add_argument('-s', dest='scaling', type=str, **environ_or_required('SCALING'), choices=['s', 'w'], help="s=strong w=weak") #w + parser.add_argument('-o', dest='operation', type=str, **environ_or_required('CYLON_OPERATION'), choices=['join', 'sort', 'slice'], help="s=strong w=weak") # w + parser.add_argument('-w', dest='world_size', type=int, help="world size", **environ_or_required('WORLD_SIZE')) + parser.add_argument("-r", dest='redis_host', type=str, help="redis address, default to 127.0.0.1", **environ_or_required('REDIS_HOST')) #127.0.0.1 + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", **environ_or_required('REDIS_PORT')) #6379 + parser.add_argument('-f1', dest='output_scaling_filename', type=str, help="Output filename for scaling results", **environ_or_required('OUTPUT_SCALING_FILENAME')) + parser.add_argument('-f2', dest='output_summary_filename', type=str, help="Output filename for scaling summary results", **environ_or_required('OUTPUT_SUMMARY_FILENAME')) + parser.add_argument('-b', dest='s3_bucket', type=str, help="S3 Bucket Name", **environ_or_required('S3_BUCKET')) + parser.add_argument('-o1', dest='s3_stopwatch_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_STOPWATCH_OBJECT_NAME')) + parser.add_argument('-o2', dest='s3_summary_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_SUMMARY_OBJECT_NAME')) args = vars(parser.parse_args()) + args['host'] = "aws" + if args['operation'] == 'join': print("executing cylon join operation") cylon_join(args) diff --git a/aws/scripts/cylon_scaling_fargate.py b/aws/scripts/cylon_scaling_fargate.py new file mode 100644 index 000000000..df50262da --- /dev/null +++ b/aws/scripts/cylon_scaling_fargate.py @@ -0,0 +1,380 @@ +import time +import argparse + +import pandas as pd +from numpy.random import default_rng +from pycylon.frame import CylonEnv, DataFrame +from cloudmesh.common.StopWatch import StopWatch +from cloudmesh.common.dotdict import dotdict +from cloudmesh.common.Shell import Shell +from cloudmesh.common.util import writefile +from pycylon.net.ucc_config import UCCConfig +from pycylon.net.redis_ucc_oob_context import UCCRedisOOBContext +from pycylon.net.reduce_op import ReduceOp +import boto3 +from botocore.exceptions import ClientError +import os +import requests +import json + +import logging + +def environ_or_required(key): + return ( + {'default': os.environ.get(key)} if os.environ.get(key) + else {'required': True} + ) +def upload_file(file_name, bucket, object_name=None): + """Upload a file to an S3 bucket + + :param file_name: File to upload + :param bucket: Bucket to upload to + :param object_name: S3 object name. If not specified then file_name is used + :return: True if file was uploaded, else False + """ + + # If S3 object_name was not specified, use file_name + if object_name is None: + object_name = os.path.basename(file_name) + + # Upload the file + s3_client = boto3.client('s3') + try: + response = s3_client.upload_file(file_name, bucket, object_name) + except ClientError as e: + logging.error(e) + return False + return True + + +def cylon_join(data=None, ipAddress = None): + global ucc_config + StopWatch.start(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + if ipAddress is not None: + print("setting UCX_TCP_REMOTE_ADDRESS_OVERRIDE", ipAddress) + os.environ['UCX_TCP_REMOTE_ADDRESS_OVERRIDE'] = ipAddress + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + timing = {'scaling': [], 'world': [], 'rows': [], 'max_value': [], 'rank': [], 'avg_t': [], 'tot_l': []} + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) * 1000 + # sum_t = comm.reduce(t) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + timing['scaling'].append(data['scaling']) + timing['world'].append(env.world_size) + timing['rows'].append(num_rows) + timing['max_value'].append(max_val) + timing['rank'].append(i) + timing['avg_t'].append(avg_t) + timing['tot_l'].append(tot_l) + #print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + + if os.path.exists(data['output_summary_filename']): + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='a', index=False, header=False) + else: + pd.DataFrame(timing).to_csv(data['output_summary_filename'], mode='w', index=False, header=True) + + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + + +def cylon_sort(data=None): + StopWatch.start(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.sort_values(by=[0], env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + + + StopWatch.stop(f"sort_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"sort_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + redis_context.clearDB() + + +def cylon_slice(data=None): + StopWatch.start(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + u = data['unique'] + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1[0:20000000, env] # distributed slice + # print(df3) + # df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + sum_t = communicator.allreduce(t, ReduceOp.SUM) + # tot_l = comm.reduce(len(df3)) + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l, + file=open(data['output_summary_filename'], 'a')) + StopWatch.stop(f"slice_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"slice_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data), filename=data['output_scaling_filename']) + upload_file(file_name=data['output_scaling_filename'], bucket=data['s3_bucket'], + object_name=data['s3_stopwatch_object_name']) + upload_file(file_name=data['output_summary_filename'], bucket=data['s3_bucket'], + object_name=data['s3_summary_object_name']) + + env.finalize() + +def get_service_ips(cluster, tasks): + client = boto3.client("ecs", region_name="us-east-1") + + tasks_detail = client.describe_tasks( + cluster=cluster, + tasks=tasks + ) + + # first get the ENIs + enis = [] + for task in tasks_detail.get("tasks", []): + for attachment in task.get("attachments", []): + for detail in attachment.get("details", []): + if detail.get("name") == "networkInterfaceId": + enis.append(detail.get("value")) + + # now the ips + + print("eni: ", enis) + ips = [] + for eni in enis: + eni_resource = boto3.resource("ec2").NetworkInterface(eni) + print("eni_resource", eni_resource) + ips.append(eni_resource.private_ip_address) + + return ips + +def get_ecs_task_arn_cluster(host): + path = "/task" + url = host + path + headers = {"Content-Type": "application/json"} + r = requests.get(url, headers=headers) + print(f"r: {r}") + d_r = json.loads(r.text) + print(d_r) + cluster = d_r["TaskARN"] + taskArn = d_r["Cluster"] + dict = { + "TaskARN": cluster, + "Cluster": taskArn + } + return dict + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="cylon scaling") + + parser.add_argument('-n', dest='rows', type=int, **environ_or_required('ROWS')) + + parser.add_argument('-i', dest='it', type=int, **environ_or_required('PARTITIONS')) #10 + + parser.add_argument('-u', dest='unique', type=float, **environ_or_required('UNIQUENESS'), help="unique factor") #0.9 + + parser.add_argument('-s', dest='scaling', type=str, **environ_or_required('SCALING'), choices=['s', 'w'], + help="s=strong w=weak") #w + + parser.add_argument('-o', dest='operation', type=str, **environ_or_required('CYLON_OPERATION'), choices=['join', 'sort', 'slice'], + help="s=strong w=weak") # w + + parser.add_argument('-w', dest='world_size', type=int, help="world size", **environ_or_required('WORLD_SIZE')) + + parser.add_argument("-r", dest='redis_host', type=str, help="redis address, default to 127.0.0.1", + **environ_or_required('REDIS_HOST')) #127.0.0.1 + + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", **environ_or_required('REDIS_PORT')) #6379 + + parser.add_argument('-f1', dest='output_scaling_filename', type=str, help="Output filename for scaling results", + **environ_or_required('OUTPUT_SCALING_FILENAME')) + + parser.add_argument('-f2', dest='output_summary_filename', type=str, help="Output filename for scaling summary results", + **environ_or_required('OUTPUT_SUMMARY_FILENAME')) + + parser.add_argument('-b', dest='s3_bucket', type=str, help="S3 Bucket Name", **environ_or_required('S3_BUCKET')) + + parser.add_argument('-o1', dest='s3_stopwatch_object_name', type=str, help="S3 Object Name", **environ_or_required('S3_STOPWATCH_OBJECT_NAME')) + + parser.add_argument('-o2', dest='s3_summary_object_name', type=str, help="S3 Object Name", + **environ_or_required('S3_SUMMARY_OBJECT_NAME')) + + args = vars(parser.parse_args()) + + args['host'] = "aws" + + host = os.environ["ECS_CONTAINER_METADATA_URI_V4"] + data = get_ecs_task_arn_cluster(host) + # This print statement passes the string back to the bash wrapper, don't remove + print("taskARN/Cluster: ", data) + + ips = get_service_ips(data['Cluster'], [data["TaskARN"]]) + + if args['operation'] == 'join': + print("executing cylon join operation") + cylon_join(args, ips[0]) + elif args['operation'] == 'sort': + print("executing cylon sort operation") + cylon_sort(args) + else: + print ("executing cylon slice operation") + cylon_slice(args) + + + # os.system(f"{git} branch | fgrep '*' ") + # os.system(f"{git} rev-parse HEAD") diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt deleted file mode 100644 index 0aa62291c..000000000 --- a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_16node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-17 20:26:30.358977 | -| frequency | scpufreq(current=3409.9529375, min=0.0, max=0.0) | -| mem.active | 1.4 GiB | -| mem.available | 28.5 GiB | -| mem.free | 23.6 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 6.4 % | -| mem.total | 30.4 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-84-64.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------| -| join_total_aws_145000000_10 | ok | 117.427 | 117.427 | 2023-08-17 20:24:32 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_145000000_10 | ok | 4.032 | 4.032 | 2023-08-17 20:25:50 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_145000000_10 | ok | 3.958 | 3.958 | 2023-08-17 20:25:54 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_145000000_10 | ok | 4.009 | 4.009 | 2023-08-17 20:25:58 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_145000000_10 | ok | 4.168 | 4.168 | 2023-08-17 20:26:02 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_145000000_10 | ok | 3.938 | 3.938 | 2023-08-17 20:26:06 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_145000000_10 | ok | 3.96 | 3.96 | 2023-08-17 20:26:10 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_145000000_10 | ok | 3.95 | 3.95 | 2023-08-17 20:26:14 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_145000000_10 | ok | 3.934 | 3.934 | 2023-08-17 20:26:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_145000000_10 | ok | 4.016 | 4.016 | 2023-08-17 20:26:22 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_145000000_10 | ok | 3.966 | 3.966 | 2023-08-17 20:26:26 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'} | | ip-172-31-84-64.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_145000000_10,ok,117.427,117.427,2023-08-17 20:24:32,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_145000000_10,ok,4.032,4.032,2023-08-17 20:25:50,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_145000000_10,ok,3.958,3.958,2023-08-17 20:25:54,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_145000000_10,ok,4.009,4.009,2023-08-17 20:25:58,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_145000000_10,ok,4.168,4.168,2023-08-17 20:26:02,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_145000000_10,ok,3.938,3.938,2023-08-17 20:26:06,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_145000000_10,ok,3.96,3.96,2023-08-17 20:26:10,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_145000000_10,ok,3.95,3.95,2023-08-17 20:26:14,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_145000000_10,ok,3.934,3.934,2023-08-17 20:26:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_145000000_10,ok,4.016,4.016,2023-08-17 20:26:22,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_145000000_10,ok,3.966,3.966,2023-08-17 20:26:26,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_1450000000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_16node.txt', 'host': 'aws'},None,ip-172-31-84-64.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt deleted file mode 100644 index 735e9b9ec..000000000 --- a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_1node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-17 19:51:44.964867 | -| frequency | scpufreq(current=3407.9141250000002, min=0.0, max=0.0) | -| mem.active | 14.0 GiB | -| mem.available | 15.8 GiB | -| mem.free | 10.9 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 48.1 % | -| mem.total | 30.4 GiB | -| mem.used | 14.2 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-85-157.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_145000000_10 | ok | 570.749 | 570.749 | 2023-08-17 19:42:13 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_145000000_10 | ok | 56.413 | 56.413 | 2023-08-17 19:42:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_145000000_10 | ok | 56.52 | 56.52 | 2023-08-17 19:43:14 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_145000000_10 | ok | 56.702 | 56.702 | 2023-08-17 19:44:11 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_145000000_10 | ok | 56.717 | 56.717 | 2023-08-17 19:45:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_145000000_10 | ok | 56.617 | 56.617 | 2023-08-17 19:46:04 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_145000000_10 | ok | 56.766 | 56.766 | 2023-08-17 19:47:01 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_145000000_10 | ok | 56.604 | 56.604 | 2023-08-17 19:47:58 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_145000000_10 | ok | 56.641 | 56.641 | 2023-08-17 19:48:54 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_145000000_10 | ok | 56.554 | 56.554 | 2023-08-17 19:49:51 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_145000000_10 | ok | 56.589 | 56.589 | 2023-08-17 19:50:48 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'} | | ip-172-31-85-157.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_145000000_10,ok,570.749,570.749,2023-08-17 19:42:13,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_145000000_10,ok,56.413,56.413,2023-08-17 19:42:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_145000000_10,ok,56.52,56.52,2023-08-17 19:43:14,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_145000000_10,ok,56.702,56.702,2023-08-17 19:44:11,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_145000000_10,ok,56.717,56.717,2023-08-17 19:45:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_145000000_10,ok,56.617,56.617,2023-08-17 19:46:04,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_145000000_10,ok,56.766,56.766,2023-08-17 19:47:01,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_145000000_10,ok,56.604,56.604,2023-08-17 19:47:58,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_145000000_10,ok,56.641,56.641,2023-08-17 19:48:54,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_145000000_10,ok,56.554,56.554,2023-08-17 19:49:51,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_145000000_10,ok,56.589,56.589,2023-08-17 19:50:48,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_1node.txt', 'host': 'aws'},None,ip-172-31-85-157.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt deleted file mode 100644 index 48316cd02..000000000 --- a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_2node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-17 20:00:57.494629 | -| frequency | scpufreq(current=3412.046875, min=0.0, max=0.0) | -| mem.active | 7.3 GiB | -| mem.available | 22.5 GiB | -| mem.free | 17.7 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 25.9 % | -| mem.total | 30.4 GiB | -| mem.used | 7.4 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-80-245.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_145000000_10 | ok | 408.51 | 408.51 | 2023-08-17 19:54:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_145000000_10 | ok | 33.83 | 33.83 | 2023-08-17 19:55:18 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_145000000_10 | ok | 33.802 | 33.802 | 2023-08-17 19:55:52 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_145000000_10 | ok | 34.12 | 34.12 | 2023-08-17 19:56:26 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_145000000_10 | ok | 33.824 | 33.824 | 2023-08-17 19:57:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_145000000_10 | ok | 33.869 | 33.869 | 2023-08-17 19:57:34 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_145000000_10 | ok | 33.84 | 33.84 | 2023-08-17 19:58:07 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_145000000_10 | ok | 33.806 | 33.806 | 2023-08-17 19:58:41 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_145000000_10 | ok | 33.812 | 33.812 | 2023-08-17 19:59:15 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_145000000_10 | ok | 33.872 | 33.872 | 2023-08-17 19:59:49 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_145000000_10 | ok | 34.1 | 34.1 | 2023-08-17 20:00:23 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'} | | ip-172-31-80-245.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+-----------------------------+----------+---------+---------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_145000000_10,ok,408.51,408.51,2023-08-17 19:54:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_145000000_10,ok,33.83,33.83,2023-08-17 19:55:18,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_145000000_10,ok,33.802,33.802,2023-08-17 19:55:52,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_145000000_10,ok,34.12,34.12,2023-08-17 19:56:26,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_145000000_10,ok,33.824,33.824,2023-08-17 19:57:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_145000000_10,ok,33.869,33.869,2023-08-17 19:57:34,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_145000000_10,ok,33.84,33.84,2023-08-17 19:58:07,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_145000000_10,ok,33.806,33.806,2023-08-17 19:58:41,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_145000000_10,ok,33.812,33.812,2023-08-17 19:59:15,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_145000000_10,ok,33.872,33.872,2023-08-17 19:59:49,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_145000000_10,ok,34.1,34.1,2023-08-17 20:00:23,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strong_145000000_2node.txt', 'host': 'aws'},None,ip-172-31-80-245.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt deleted file mode 100644 index 80ebe27db..000000000 --- a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_4node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-17 20:13:37.510078 | -| frequency | scpufreq(current=3408.3013124999998, min=0.0, max=0.0) | -| mem.active | 3.9 GiB | -| mem.available | 25.9 GiB | -| mem.free | 21.1 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 14.7 % | -| mem.total | 30.4 GiB | -| mem.used | 4.0 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-81-123.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_145000000_10 | ok | 226.103 | 226.103 | 2023-08-17 20:09:51 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_145000000_10 | ok | 16.183 | 16.183 | 2023-08-17 20:10:55 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_145000000_10 | ok | 16.174 | 16.174 | 2023-08-17 20:11:11 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_145000000_10 | ok | 16.17 | 16.17 | 2023-08-17 20:11:28 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_145000000_10 | ok | 16.14 | 16.14 | 2023-08-17 20:11:44 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_145000000_10 | ok | 16.133 | 16.133 | 2023-08-17 20:12:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_145000000_10 | ok | 16.126 | 16.126 | 2023-08-17 20:12:16 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_145000000_10 | ok | 16.107 | 16.107 | 2023-08-17 20:12:32 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_145000000_10 | ok | 16.143 | 16.143 | 2023-08-17 20:12:48 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_145000000_10 | ok | 16.114 | 16.114 | 2023-08-17 20:13:04 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_145000000_10 | ok | 16.132 | 16.132 | 2023-08-17 20:13:21 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'} | | ip-172-31-81-123.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_145000000_10,ok,226.103,226.103,2023-08-17 20:09:51,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_145000000_10,ok,16.183,16.183,2023-08-17 20:10:55,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_145000000_10,ok,16.174,16.174,2023-08-17 20:11:11,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_145000000_10,ok,16.17,16.17,2023-08-17 20:11:28,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_145000000_10,ok,16.14,16.14,2023-08-17 20:11:44,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_145000000_10,ok,16.133,16.133,2023-08-17 20:12:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_145000000_10,ok,16.126,16.126,2023-08-17 20:12:16,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_145000000_10,ok,16.107,16.107,2023-08-17 20:12:32,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_145000000_10,ok,16.143,16.143,2023-08-17 20:12:48,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_145000000_10,ok,16.114,16.114,2023-08-17 20:13:04,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_145000000_10,ok,16.132,16.132,2023-08-17 20:13:21,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt', 'host': 'aws'},None,ip-172-31-81-123.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt b/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt deleted file mode 100644 index 9bfa3ace4..000000000 --- a/aws/scripts/results-145000000/cylon_scaling_ec2_strong_145000000_8node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-17 20:18:16.286547 | -| frequency | scpufreq(current=3613.2064375, min=0.0, max=0.0) | -| mem.active | 2.2 GiB | -| mem.available | 27.8 GiB | -| mem.free | 23.0 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 9.1 % | -| mem.total | 30.6 GiB | -| mem.used | 2.3 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-83-169.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_145000000_10 | ok | 142.303 | 142.303 | 2023-08-17 20:15:53 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_145000000_10 | ok | 7.954 | 7.954 | 2023-08-17 20:16:56 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_145000000_10 | ok | 8.154 | 8.154 | 2023-08-17 20:17:03 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_145000000_10 | ok | 7.971 | 7.971 | 2023-08-17 20:17:12 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_145000000_10 | ok | 7.972 | 7.972 | 2023-08-17 20:17:20 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_145000000_10 | ok | 8.02 | 8.02 | 2023-08-17 20:17:28 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_145000000_10 | ok | 7.99 | 7.99 | 2023-08-17 20:17:36 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_145000000_10 | ok | 8 | 8 | 2023-08-17 20:17:44 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_145000000_10 | ok | 8.073 | 8.073 | 2023-08-17 20:17:52 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_145000000_10 | ok | 7.917 | 7.917 | 2023-08-17 20:18:00 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_145000000_10 | ok | 8.08 | 8.08 | 2023-08-17 20:18:08 | {'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'} | | ip-172-31-83-169.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+-----------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_145000000_10,ok,142.303,142.303,2023-08-17 20:15:53,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_145000000_10,ok,7.954,7.954,2023-08-17 20:16:56,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_145000000_10,ok,8.154,8.154,2023-08-17 20:17:03,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_145000000_10,ok,7.971,7.971,2023-08-17 20:17:12,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_145000000_10,ok,7.972,7.972,2023-08-17 20:17:20,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_145000000_10,ok,8.02,8.02,2023-08-17 20:17:28,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_145000000_10,ok,7.99,7.99,2023-08-17 20:17:36,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_145000000_10,ok,8.0,8.0,2023-08-17 20:17:44,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_145000000_10,ok,8.073,8.073,2023-08-17 20:17:52,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_145000000_10,ok,7.917,7.917,2023-08-17 20:18:00,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_145000000_10,ok,8.08,8.08,2023-08-17 20:18:08,{'rows': 145000000, 'it': 10, 'unique': 0.9, 'scaling': 's', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_strong_145000000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_strong_145000000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_scaling_ec2_strong_145000000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/strong/145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt', 'host': 'aws'},None,ip-172-31-83-169.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt deleted file mode 100644 index c3063187b..000000000 --- a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_16node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### s 16 9062500 145000000 0 4029.546871781349 161101524 -### s 16 9062500 145000000 1 3956.2147110700607 161101524 -### s 16 9062500 145000000 2 4006.7496597766876 161101524 -### s 16 9062500 145000000 3 4166.1305874586105 161101524 -### s 16 9062500 145000000 4 3935.5630427598953 161101524 -### s 16 9062500 145000000 5 3957.828611135483 161101524 -### s 16 9062500 145000000 6 3947.746455669403 161101524 -### s 16 9062500 145000000 7 3931.699424982071 161101524 -### s 16 9062500 145000000 8 4014.2249763011932 161101524 -### s 16 9062500 145000000 9 3963.857814669609 161101524 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt deleted file mode 100644 index ded10b15b..000000000 --- a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_1node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### s 1 145000000 145000000 0 56412.89281845093 161109857 -### s 1 145000000 145000000 1 56519.5152759552 161109857 -### s 1 145000000 145000000 2 56701.70569419861 161109857 -### s 1 145000000 145000000 3 56716.846227645874 161109857 -### s 1 145000000 145000000 4 56616.804361343384 161109857 -### s 1 145000000 145000000 5 56765.65957069397 161109857 -### s 1 145000000 145000000 6 56603.74593734741 161109857 -### s 1 145000000 145000000 7 56640.29383659363 161109857 -### s 1 145000000 145000000 8 56553.63416671753 161109857 -### s 1 145000000 145000000 9 56588.97686004639 161109857 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt deleted file mode 100644 index 0369d4a15..000000000 --- a/aws/scripts/results-145000000/cylon_summary_test_ec2_strong_145000000_2node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### s 2 72500000 145000000 0 33829.18119430542 161098554 -### s 2 72500000 145000000 1 33800.89461803436 161098554 -### s 2 72500000 145000000 2 34119.54045295715 161098554 -### s 2 72500000 145000000 3 33823.59731197357 161098554 -### s 2 72500000 145000000 4 33868.10278892517 161098554 -### s 2 72500000 145000000 5 33839.05518054962 161098554 -### s 2 72500000 145000000 6 33805.309772491455 161098554 -### s 2 72500000 145000000 7 33811.1287355423 161098554 -### s 2 72500000 145000000 8 33870.83053588867 161098554 -### s 2 72500000 145000000 9 34099.069356918335 161098554 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt deleted file mode 100644 index 9e1f02f59..000000000 --- a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_4node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### s 4 36250000 145000000 0 16181.42455816269 161112331 -### s 4 36250000 145000000 1 16173.18880558014 161112331 -### s 4 36250000 145000000 2 16169.183850288391 161112331 -### s 4 36250000 145000000 3 16138.943433761597 161112331 -### s 4 36250000 145000000 4 16131.615221500397 161112331 -### s 4 36250000 145000000 5 16124.849140644073 161112331 -### s 4 36250000 145000000 6 16106.135249137878 161112331 -### s 4 36250000 145000000 7 16141.386568546295 161112331 -### s 4 36250000 145000000 8 16113.233029842377 161112331 -### s 4 36250000 145000000 9 16130.472183227539 161112331 diff --git a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt b/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt deleted file mode 100644 index 4056d6925..000000000 --- a/aws/scripts/results-145000000/cylon_summary_test_ec2_strongt_145000000_8node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### s 8 18125000 145000000 0 7952.463746070862 161104569 -### s 8 18125000 145000000 1 8151.8765687942505 161104569 -### s 8 18125000 145000000 2 7969.114989042282 161104569 -### s 8 18125000 145000000 3 7970.205038785934 161104569 -### s 8 18125000 145000000 4 8018.117159605026 161104569 -### s 8 18125000 145000000 5 7988.0905747413635 161104569 -### s 8 18125000 145000000 6 7998.181223869324 161104569 -### s 8 18125000 145000000 7 8070.7429349422455 161104569 -### s 8 18125000 145000000 8 7915.852248668671 161104569 -### s 8 18125000 145000000 9 8078.289061784744 161104569 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt deleted file mode 100644 index c38ee3162..000000000 --- a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_16node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-15 21:07:32.993134 | -| frequency | scpufreq(current=3410.8410625, min=0.0, max=0.0) | -| mem.active | 1.4 GiB | -| mem.available | 28.5 GiB | -| mem.free | 23.6 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 6.4 % | -| mem.total | 30.4 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-89-59.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------| -| join_total_aws_9100000_10 | ok | 118.549 | 118.549 | 2023-08-15 21:05:34 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_9100000_10 | ok | 3.957 | 3.957 | 2023-08-15 21:06:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_9100000_10 | ok | 3.955 | 3.955 | 2023-08-15 21:06:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_9100000_10 | ok | 3.966 | 3.966 | 2023-08-15 21:07:00 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_9100000_10 | ok | 4.084 | 4.084 | 2023-08-15 21:07:04 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_9100000_10 | ok | 4.091 | 4.091 | 2023-08-15 21:07:08 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_9100000_10 | ok | 3.971 | 3.971 | 2023-08-15 21:07:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_9100000_10 | ok | 3.99 | 3.99 | 2023-08-15 21:07:16 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_9100000_10 | ok | 4.294 | 4.294 | 2023-08-15 21:07:20 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_9100000_10 | ok | 4.027 | 4.027 | 2023-08-15 21:07:24 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_9100000_10 | ok | 3.93 | 3.93 | 2023-08-15 21:07:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'} | | ip-172-31-89-59.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+---------------------------+----------+---------+---------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_9100000_10,ok,118.549,118.549,2023-08-15 21:05:34,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_9100000_10,ok,3.957,3.957,2023-08-15 21:06:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_9100000_10,ok,3.955,3.955,2023-08-15 21:06:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_9100000_10,ok,3.966,3.966,2023-08-15 21:07:00,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_9100000_10,ok,4.084,4.084,2023-08-15 21:07:04,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_9100000_10,ok,4.091,4.091,2023-08-15 21:07:08,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_9100000_10,ok,3.971,3.971,2023-08-15 21:07:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_9100000_10,ok,3.99,3.99,2023-08-15 21:07:16,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_9100000_10,ok,4.294,4.294,2023-08-15 21:07:20,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_9100000_10,ok,4.027,4.027,2023-08-15 21:07:24,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_9100000_10,ok,3.93,3.93,2023-08-15 21:07:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 16, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_9100000_16node', 'output_summary_filename': 'cylon_summary_test_ec2_9100000_16node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_9100000_16node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_9100000_16node.txt', 'host': 'aws'},None,ip-172-31-89-59.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt deleted file mode 100644 index ccbc22c56..000000000 --- a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_1node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-15 16:57:19.199896 | -| frequency | scpufreq(current=3404.932875, min=0.0, max=0.0) | -| mem.active | 1.4 GiB | -| mem.available | 28.5 GiB | -| mem.free | 23.7 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 6.3 % | -| mem.total | 30.4 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-84-135.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_9100000_10 | ok | 32.554 | 32.554 | 2023-08-15 16:56:46 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_9100000_10 | ok | 3.21 | 3.21 | 2023-08-15 16:56:46 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_9100000_10 | ok | 3.22 | 3.22 | 2023-08-15 16:56:49 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_9100000_10 | ok | 3.221 | 3.221 | 2023-08-15 16:56:53 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_9100000_10 | ok | 3.223 | 3.223 | 2023-08-15 16:56:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_9100000_10 | ok | 3.216 | 3.216 | 2023-08-15 16:56:59 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_9100000_10 | ok | 3.22 | 3.22 | 2023-08-15 16:57:02 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_9100000_10 | ok | 3.225 | 3.225 | 2023-08-15 16:57:05 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_9100000_10 | ok | 3.245 | 3.245 | 2023-08-15 16:57:09 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_9100000_10 | ok | 3.218 | 3.218 | 2023-08-15 16:57:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_9100000_10 | ok | 3.224 | 3.224 | 2023-08-15 16:57:15 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'} | | ip-172-31-84-135.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_9100000_10,ok,32.554,32.554,2023-08-15 16:56:46,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_9100000_10,ok,3.21,3.21,2023-08-15 16:56:46,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_9100000_10,ok,3.22,3.22,2023-08-15 16:56:49,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_9100000_10,ok,3.221,3.221,2023-08-15 16:56:53,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_9100000_10,ok,3.223,3.223,2023-08-15 16:56:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_9100000_10,ok,3.216,3.216,2023-08-15 16:56:59,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_9100000_10,ok,3.22,3.22,2023-08-15 16:57:02,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_9100000_10,ok,3.225,3.225,2023-08-15 16:57:05,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_9100000_10,ok,3.245,3.245,2023-08-15 16:57:09,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_9100000_10,ok,3.218,3.218,2023-08-15 16:57:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_9100000_10,ok,3.224,3.224,2023-08-15 16:57:15,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 1, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_1node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_1node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_1node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_1node.txt', 'host': 'aws'},None,ip-172-31-84-135.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt deleted file mode 100644 index 0a2f26f30..000000000 --- a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_2node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-15 20:50:34.410137 | -| frequency | scpufreq(current=3610.8821875000003, min=0.0, max=0.0) | -| mem.active | 1.3 GiB | -| mem.available | 28.7 GiB | -| mem.free | 23.9 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 6.3 % | -| mem.total | 30.6 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-92-255.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_9100000_10 | ok | 39.566 | 39.566 | 2023-08-15 20:49:54 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_9100000_10 | ok | 3.887 | 3.887 | 2023-08-15 20:49:54 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_9100000_10 | ok | 3.888 | 3.888 | 2023-08-15 20:49:58 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_9100000_10 | ok | 3.897 | 3.897 | 2023-08-15 20:50:02 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_9100000_10 | ok | 3.902 | 3.902 | 2023-08-15 20:50:06 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_9100000_10 | ok | 3.903 | 3.903 | 2023-08-15 20:50:10 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_9100000_10 | ok | 3.903 | 3.903 | 2023-08-15 20:50:14 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_9100000_10 | ok | 3.978 | 3.978 | 2023-08-15 20:50:18 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_9100000_10 | ok | 3.917 | 3.917 | 2023-08-15 20:50:22 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_9100000_10 | ok | 3.906 | 3.906 | 2023-08-15 20:50:26 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_9100000_10 | ok | 3.902 | 3.902 | 2023-08-15 20:50:30 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'} | | ip-172-31-92-255.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_9100000_10,ok,39.566,39.566,2023-08-15 20:49:54,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_9100000_10,ok,3.887,3.887,2023-08-15 20:49:54,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_9100000_10,ok,3.888,3.888,2023-08-15 20:49:58,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_9100000_10,ok,3.897,3.897,2023-08-15 20:50:02,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_9100000_10,ok,3.902,3.902,2023-08-15 20:50:06,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_9100000_10,ok,3.903,3.903,2023-08-15 20:50:10,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_9100000_10,ok,3.903,3.903,2023-08-15 20:50:14,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_9100000_10,ok,3.978,3.978,2023-08-15 20:50:18,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_9100000_10,ok,3.917,3.917,2023-08-15 20:50:22,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_9100000_10,ok,3.906,3.906,2023-08-15 20:50:26,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_9100000_10,ok,3.902,3.902,2023-08-15 20:50:30,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 2, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_2node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_2node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_2node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_2node.txt', 'host': 'aws'},None,ip-172-31-92-255.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt deleted file mode 100644 index bbd7f2bef..000000000 --- a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_4node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-15 20:56:08.292875 | -| frequency | scpufreq(current=3406.7418124999995, min=0.0, max=0.0) | -| mem.active | 1.4 GiB | -| mem.available | 28.5 GiB | -| mem.free | 23.7 GiB | -| mem.inactive | 4.7 GiB | -| mem.percent | 6.3 % | -| mem.total | 30.4 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-80-213.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_9100000_10 | ok | 99.147 | 99.147 | 2023-08-15 20:54:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_9100000_10 | ok | 3.916 | 3.916 | 2023-08-15 20:55:29 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_9100000_10 | ok | 3.918 | 3.918 | 2023-08-15 20:55:33 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_9100000_10 | ok | 3.907 | 3.907 | 2023-08-15 20:55:36 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_9100000_10 | ok | 3.92 | 3.92 | 2023-08-15 20:55:40 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_9100000_10 | ok | 3.905 | 3.905 | 2023-08-15 20:55:44 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_9100000_10 | ok | 3.867 | 3.867 | 2023-08-15 20:55:48 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_9100000_10 | ok | 3.847 | 3.847 | 2023-08-15 20:55:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_9100000_10 | ok | 3.845 | 3.845 | 2023-08-15 20:55:56 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_9100000_10 | ok | 3.865 | 3.865 | 2023-08-15 20:56:00 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_9100000_10 | ok | 3.883 | 3.883 | 2023-08-15 20:56:04 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+---------------------------+----------+--------+--------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_9100000_10,ok,99.147,99.147,2023-08-15 20:54:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_9100000_10,ok,3.916,3.916,2023-08-15 20:55:29,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_9100000_10,ok,3.918,3.918,2023-08-15 20:55:33,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_9100000_10,ok,3.907,3.907,2023-08-15 20:55:36,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_9100000_10,ok,3.92,3.92,2023-08-15 20:55:40,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_9100000_10,ok,3.905,3.905,2023-08-15 20:55:44,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_9100000_10,ok,3.867,3.867,2023-08-15 20:55:48,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_9100000_10,ok,3.847,3.847,2023-08-15 20:55:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_9100000_10,ok,3.845,3.845,2023-08-15 20:55:56,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_9100000_10,ok,3.865,3.865,2023-08-15 20:56:00,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_9100000_10,ok,3.883,3.883,2023-08-15 20:56:04,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 4, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_4node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_4node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_4node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_4node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt b/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt deleted file mode 100644 index c1120355f..000000000 --- a/aws/scripts/results-9100000/cylon_scaling_ec2_weak_9100000_8node.txt +++ /dev/null @@ -1,75 +0,0 @@ - -+---------------------+-------------------------------------------------------------------+ -| Attribute | Value | -|---------------------+-------------------------------------------------------------------| -| BUG_REPORT_URL | "https://bugs.launchpad.net/ubuntu/" | -| DISTRIB_CODENAME | jammy | -| DISTRIB_DESCRIPTION | "Ubuntu 22.04.2 LTS" | -| DISTRIB_ID | Ubuntu | -| DISTRIB_RELEASE | 22.04 | -| HOME_URL | "https://www.ubuntu.com/" | -| ID | ubuntu | -| ID_LIKE | debian | -| NAME | "Ubuntu" | -| PRETTY_NAME | "Ubuntu 22.04.2 LTS" | -| PRIVACY_POLICY_URL | "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" | -| SUPPORT_URL | "https://help.ubuntu.com/" | -| UBUNTU_CODENAME | jammy | -| VERSION | "22.04.2 LTS (Jammy Jellyfish)" | -| VERSION_CODENAME | jammy | -| VERSION_ID | "22.04" | -| cpu | Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz | -| cpu_cores | 8 | -| cpu_count | 16 | -| cpu_threads | 16 | -| date | 2023-08-15 20:59:59.876528 | -| frequency | scpufreq(current=3407.778312499999, min=0.0, max=0.0) | -| mem.active | 1.4 GiB | -| mem.available | 28.5 GiB | -| mem.free | 23.6 GiB | -| mem.inactive | 4.6 GiB | -| mem.percent | 6.3 % | -| mem.total | 30.4 GiB | -| mem.used | 1.5 GiB | -| platform.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| python | 3.9.17 | packaged by conda-forge | (main, Aug 10 2023, 07:02:31) | -| | [GCC 12.3.0] | -| python.pip | 23.2.1 | -| python.version | 3.9.17 | -| sys.platform | linux | -| uname.machine | x86_64 | -| uname.node | ip-172-31-80-213.ec2.internal | -| uname.processor | x86_64 | -| uname.release | 4.14.318-241.531.amzn2.x86_64 | -| uname.system | Linux | -| uname.version | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| user | root | -+---------------------+-------------------------------------------------------------------+ - -+---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -| Name | Status | Time | Sum | Start | tag | msg | Node | User | OS | Version | -|---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------| -| join_total_aws_9100000_10 | ok | 107.328 | 107.328 | 2023-08-15 20:58:12 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_0_aws_9100000_10 | ok | 3.878 | 3.878 | 2023-08-15 20:59:20 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_1_aws_9100000_10 | ok | 3.874 | 3.874 | 2023-08-15 20:59:24 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_2_aws_9100000_10 | ok | 3.862 | 3.862 | 2023-08-15 20:59:28 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_3_aws_9100000_10 | ok | 3.898 | 3.898 | 2023-08-15 20:59:32 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_4_aws_9100000_10 | ok | 3.884 | 3.884 | 2023-08-15 20:59:36 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_5_aws_9100000_10 | ok | 3.884 | 3.884 | 2023-08-15 20:59:40 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_6_aws_9100000_10 | ok | 3.978 | 3.978 | 2023-08-15 20:59:44 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_7_aws_9100000_10 | ok | 3.876 | 3.876 | 2023-08-15 20:59:48 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_8_aws_9100000_10 | ok | 3.858 | 3.858 | 2023-08-15 20:59:52 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -| join_9_aws_9100000_10 | ok | 3.878 | 3.878 | 2023-08-15 20:59:55 | {'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'} | | ip-172-31-80-213.ec2.internal | root | Linux | #1 SMP Tue Jun 27 21:49:00 UTC 2023 | -+---------------------------+----------+---------+---------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+-------------------------------+--------+-------+-------------------------------------+ -# csv,timer,status,time,sum,start,tag,msg,uname.node,user,uname.system,platform.version -# csv,join_total_aws_9100000_10,ok,107.328,107.328,2023-08-15 20:58:12,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_0_aws_9100000_10,ok,3.878,3.878,2023-08-15 20:59:20,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_1_aws_9100000_10,ok,3.874,3.874,2023-08-15 20:59:24,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_2_aws_9100000_10,ok,3.862,3.862,2023-08-15 20:59:28,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_3_aws_9100000_10,ok,3.898,3.898,2023-08-15 20:59:32,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_4_aws_9100000_10,ok,3.884,3.884,2023-08-15 20:59:36,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_5_aws_9100000_10,ok,3.884,3.884,2023-08-15 20:59:40,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_6_aws_9100000_10,ok,3.978,3.978,2023-08-15 20:59:44,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_7_aws_9100000_10,ok,3.876,3.876,2023-08-15 20:59:48,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_8_aws_9100000_10,ok,3.858,3.858,2023-08-15 20:59:52,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 -# csv,join_9_aws_9100000_10,ok,3.878,3.878,2023-08-15 20:59:55,{'rows': 9100000, 'it': 10, 'unique': 0.9, 'scaling': 'w', 'operation': 'join', 'world_size': 8, 'redis_host': 'cylon-redis.mveu6e.0001.use1.cache.amazonaws.com', 'redis_port': 6379, 'output_scaling_filename': 'cylon_scaling_test_ec2_weak_9100000_8node', 'output_summary_filename': 'cylon_summary_test_ec2_weak_9100000_8node', 's3_bucket': 'staylor.dev2', 's3_stopwatch_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_scaling_ec2_weak_9100000_8node.txt', 's3_summary_object_name': 'cylon/scaling/ec2/weak/9100000/cylon_summary_test_ec2_weak_9100000_8node.txt', 'host': 'aws'},None,ip-172-31-80-213.ec2.internal,root,Linux,#1 SMP Tue Jun 27 21:49:00 UTC 2023 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt deleted file mode 100644 index 55c4ae2bd..000000000 --- a/aws/scripts/results-9100000/cylon_summary_test_ec2_9100000_16node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### w 16 9100000 145600000 0 3955.1253616809845 161774191 -### w 16 9100000 145600000 1 3952.8827369213104 161774191 -### w 16 9100000 145600000 2 3963.8237208127975 161774191 -### w 16 9100000 145600000 3 4081.855833530426 161774191 -### w 16 9100000 145600000 4 4089.3873125314713 161774191 -### w 16 9100000 145600000 5 3968.8504487276077 161774191 -### w 16 9100000 145600000 6 3987.659439444542 161774191 -### w 16 9100000 145600000 7 4291.653141379356 161774191 -### w 16 9100000 145600000 8 4025.2812802791595 161774191 -### w 16 9100000 145600000 9 3927.98613011837 161774191 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt deleted file mode 100644 index baaf6cf47..000000000 --- a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_1node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### w 1 9100000 9100000 0 3209.0532779693604 10111764 -### w 1 9100000 9100000 1 3219.9573516845703 10111764 -### w 1 9100000 9100000 2 3220.4110622406006 10111764 -### w 1 9100000 9100000 3 3222.269296646118 10111764 -### w 1 9100000 9100000 4 3215.7342433929443 10111764 -### w 1 9100000 9100000 5 3219.4266319274902 10111764 -### w 1 9100000 9100000 6 3224.6077060699463 10111764 -### w 1 9100000 9100000 7 3244.480609893799 10111764 -### w 1 9100000 9100000 8 3217.606782913208 10111764 -### w 1 9100000 9100000 9 3223.5209941864014 10111764 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt deleted file mode 100644 index 476f70d4c..000000000 --- a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_2node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### w 2 9100000 18200000 0 3885.681986808777 20222454 -### w 2 9100000 18200000 1 3887.1185779571533 20222454 -### w 2 9100000 18200000 2 3895.438075065613 20222454 -### w 2 9100000 18200000 3 3900.550603866577 20222454 -### w 2 9100000 18200000 4 3901.926279067993 20222454 -### w 2 9100000 18200000 5 3901.6456604003906 20222454 -### w 2 9100000 18200000 6 3976.7285585403442 20222454 -### w 2 9100000 18200000 7 3916.15629196167 20222454 -### w 2 9100000 18200000 8 3904.7634601593018 20222454 -### w 2 9100000 18200000 9 3901.23450756073 20222454 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt deleted file mode 100644 index 1b8301f1b..000000000 --- a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_4node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### w 4 9100000 36400000 0 3914.8510694503784 40437898 -### w 4 9100000 36400000 1 3916.4035320281982 40437898 -### w 4 9100000 36400000 2 3906.2851667404175 40437898 -### w 4 9100000 36400000 3 3919.1325306892395 40437898 -### w 4 9100000 36400000 4 3903.8299918174744 40437898 -### w 4 9100000 36400000 5 3865.3509616851807 40437898 -### w 4 9100000 36400000 6 3845.4021215438843 40437898 -### w 4 9100000 36400000 7 3843.4287309646606 40437898 -### w 4 9100000 36400000 8 3863.954722881317 40437898 -### w 4 9100000 36400000 9 3882.117211818695 40437898 diff --git a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt b/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt deleted file mode 100644 index 197c45745..000000000 --- a/aws/scripts/results-9100000/cylon_summary_test_ec2_weak_9100000_8node.txt +++ /dev/null @@ -1,10 +0,0 @@ -### w 8 9100000 72800000 0 3875.7028579711914 80888085 -### w 8 9100000 72800000 1 3871.913105249405 80888085 -### w 8 9100000 72800000 2 3860.0634932518005 80888085 -### w 8 9100000 72800000 3 3897.0689177513123 80888085 -### w 8 9100000 72800000 4 3882.505089044571 80888085 -### w 8 9100000 72800000 5 3882.448524236679 80888085 -### w 8 9100000 72800000 6 3976.4296114444733 80888085 -### w 8 9100000 72800000 7 3874.1161227226257 80888085 -### w 8 9100000 72800000 8 3856.1716079711914 80888085 -### w 8 9100000 72800000 9 3875.669479370117 80888085 diff --git a/build.py b/build.py index 0e32ecea6..163cc0fed 100644 --- a/build.py +++ b/build.py @@ -220,7 +220,6 @@ def build_cpp(): cmake_command = f"cmake -DPYCYLON_BUILD={on_off(BUILD_PYTHON)} {win_cmake_args} " \ f"-DCMAKE_BUILD_TYPE={CPP_BUILD_MODE} " \ f"-DCYLON_WITH_TEST={on_off(RUN_CPP_TESTS)} " \ - f"-DARROW_BUILD_TYPE=SYSTEM " \ f"{CPPLINT_COMMAND} " \ f"-DCMAKE_INSTALL_PREFIX={INSTALL_DIR} " \ f"{verb} {CMAKE_FLAGS} {CPP_SOURCE_DIR}" diff --git a/build.sh b/build.sh index c9f6b0a21..a77e51ee8 100755 --- a/build.sh +++ b/build.sh @@ -50,6 +50,25 @@ while [[ $# -gt 0 ]]; do shift # past argument shift # past value ;; + -ucxpath | --ucx_build_path) + UCX_INSTALL_PREFIX="$2" + UCX_LOCAL_INSTALL="ON" + CYLON_UCX="ON" + shift # past argument + shift # past value + ;; + -uccpath | --ucc_build_path) + UCC_PREFIX="$2" + CYLON_UCC="ON" + shift # past argument + shift # past value + ;; + -redispath | --redis_build_path) + REDIS_PREFIX="$2" + CYLON_REDIS="ON" + shift # past argument + shift # past value + ;; -ipath | --install_path) INSTALL_PATH="$2" shift # past argument @@ -414,7 +433,7 @@ build_python() { pushd python/pycylon || exit 1 pip3 uninstall -y pycylon make clean - CYLON_PREFIX=${CYLON_PREFIX} ARROW_PREFIX=${BUILD_PATH}/arrow/install python3 setup.py install || exit 1 + CYLON_PREFIX=${CYLON_PREFIX} ARROW_PREFIX=${BUILD_PATH}/arrow/install CYLON_UCX=${CYLON_UCX} CYLON_UCC=${CYLON_UCC} CYLON_REDIS=${CYLON_REDIS} UCX_LOCAL_INSTALL=${UCX_LOCAL_INSTALL} UCC_PREFIX=${UCC_PREFIX} REDIS_PREFIX=${REDIS_PREFIX} UCX_INSTALL_PREFIX=${UCX_INSTALL_PREFIX} python3 setup.py install || exit 1 popd || exit 1 print_line } diff --git a/docker/aws/Dockerfile b/docker/aws/Dockerfile index e95a35899..1dc52d989 100644 --- a/docker/aws/Dockerfile +++ b/docker/aws/Dockerfile @@ -63,13 +63,13 @@ RUN cd $UCX_HOME && \ ./autogen.sh && \ ./configure --prefix=$UCX_HOME/install && \ make install + #UCC install RUN git clone --single-branch -b master https://github.com/openucx/ucc.git $UCC_HOME RUN cd $UCC_HOME && \ ./autogen.sh && \ ./configure --prefix=$UCC_HOME/install --with-ucx=$UCX_HOME/install && \ - make install #REDIS install diff --git a/python/pycylon/setup.py b/python/pycylon/setup.py index 5de60abd7..3c1fb3c79 100644 --- a/python/pycylon/setup.py +++ b/python/pycylon/setup.py @@ -195,6 +195,8 @@ macros.append(('BUILD_CYLON_REDIS', '1')) compile_time_env['CYTHON_REDIS'] = True library_dirs.append(os.path.join(REDIS_PREFIX, 'lib')) + library_dirs.append(os.path.join(REDIS_PREFIX, 'lib64')) + include_dirs.append(os.path.join(REDIS_PREFIX, 'include')) include_dirs.append(os.path.join(REDIS_PREFIX, 'include', 'sw')) include_dirs.append(os.path.join(REDIS_PREFIX, 'include', 'hiredis')) else: diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh new file mode 100644 index 000000000..c2f8b321a --- /dev/null +++ b/target/rivanna/installUCCUCX.sh @@ -0,0 +1,35 @@ +#! /bin/sh + + +PWD=`pwd` +BUILD_PATH=$PWD/build + +module load gcc/9.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 + +python -m venv $PWD/CYLON-ENV + +source $PWD/CYLON-ENV/bin/activate + +# pip install -r $PWD/requirements.txt +pip install pip -U +pip install pytest +pip install -U pytest-mpi +pip install numpy +pip install cloudmesh-openstack + +# pip install pyarrow==9.0.0 + +export CC=`which gcc` +export CXX=`which g++` +CC=gcc MPICC=mpicc pip install --no-binary mpi4py install mpi4py +UCC_INSTALL=/scratch/qad5gv/ucc/install +UCX_INSTALL=/scratch/qad5gv/ucx/install +REDIS_INSTALL=/scratch/qad5gv/redis_install +pip install urllib3==1.26.6 + + +rm -rf build + +export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH + +time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" diff --git a/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup.py b/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup.py new file mode 100644 index 000000000..83152aae5 --- /dev/null +++ b/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup.py @@ -0,0 +1,142 @@ +import os +import sys +import argparse +from textwrap import dedent +from cloudmesh.common.util import writefile +from cloudmesh.common.util import readfile +from cloudmesh.common.util import banner +from cloudmesh.common.console import Console +import argparse + +counter = 0 + + +debug = False + +partition="bii-gpu" + +partition="parallel" + +parser = argparse.ArgumentParser(description="cylon rivanna scaling test") +parser.add_argument('-n', dest='rows', type=int, required=True) + +parser.add_argument('-s', dest='scaling', type=str, default='w', choices=['s', 'w'], + help="s=strong w=weak") + + +parser.add_argument('-w', dest='world_size', type=int, help="world size", required=True) + + +parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", + default=6379) # 6379 + +args = vars(parser.parse_args()) + + +# (nodes, threads, cpus, rows, partition, "exclusive") +combination = [\ + # (1,4, 5000, "parallel", "exclusive"), # always pending + ("dev-cylon-redis1.aws-cylondata.com", 2,4, 1, args['rows'], "standard", ""), + #("54.227.18.138", 4,8, 16, args['rows'], "parallel", ""), + #("44.213.71.107", 4,8, 16, args['rows'], "parallel", ""), + #("52.90.116.44", 4,8, 16, args['rows'], "parallel", ""), + #(2,37, 1000000, "parallel", ""), + #(4,37, 35000000, "parallel", ""), + #(6,37, 35000000, "parallel", ""), + #(8,37, 35000000, "parallel", ""), + #(10,37, 35000000, "parallel", ""), + #(12,37, 35000000, "parallel", ""), + #(14,37, 35000000, "parallel", ""), +] + +''' +combination = [] +for nodes in range(0,50): + for threads in range(0,37): + combination.append((nodes+1, threads+1, "parallel", "")) +''' + +total = len(combination) +jobid="-%j" +# jobid="" + +f = open("../../../../rivanna/scripts/submit.log", "w") +for redis, nodes, threads, cpus, rows, partition, exclusive in combination: + counter = counter + 1 + + if exclusive == "exclusive": + exclusive = "#SBATCH --exclusive" + e = "e1" + else: + exclusive = "" + e = "e0" + + usable_threads = nodes * threads + + ''' + cores_per_node = nodes * threads - 2 + + print (cores_per_node) + + config = readfile("raptor.in.cfg") + + config = config.replace("CORES_PER_NODE", str(cores_per_node)) + config = config.replace("NO_OF_ROWS", str(rows)) + + + print (config) + + cfg_filename = f"raptor-{nodes}-{threads}.cfg" + + writefile(cfg_filename, config) + ''' + banner(f"SLURM {nodes} {threads} {counter}/{total}") + script=dedent(f""" + #!/bin/bash + #SBATCH --job-name=h-n={nodes:02d}-t={threads:02d}-e={e} + #SBATCH --nodes={nodes} + #SBATCH --ntasks={threads} + #SBATCH --cpus-per-task={cpus} + #SBATCH --time=15:00 + #SBATCH --output=out-{nodes:02d}-{threads:02d}{jobid}.log + #SBATCH --error=out-{nodes:02d}-{threads:02d}{jobid}.err + #SBATCH --partition=parallel + #SBATCH -A bii_dsc_community + {exclusive} + echo "..............................................................." + module load gcc/9.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 + echo "..............................................................." + source /scratch/qad5gv/cylon/CYLON-ENV/bin/activate + echo "..............................................................." + BUILD_PATH=/scratch/qad5gv/cylon/build + UCC_INSTALL=/scratch/qad5gv/ucc/install + UCX_INSTALL=/scratch/qad5gv/ucx/install + REDIS_INSTALL=/scratch/qad5gv/redis_install + echo "..............................................................." + export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH + echo "..............................................................." + which python gcc g++ + echo "..............................................................." + lscpu + echo "..............................................................." + time srun --exact --nodes {nodes} python cylon_scaling.py -n {rows} -s {args["scaling"]} -w {args["world_size"]} -r {redis} -p1 {args["redis_port"]} + echo "..............................................................." + """).strip() + + print (script) + filename = f"script-{nodes:02d}-{threads:02d}.slurm" + writefile(filename, script) + + + if not debug: + + r = os.system(f"sbatch {filename}") + total = nodes * threads + if r == 0: + msg = f"{counter} submitted: nodes={nodes:02d} threads={threads:02d} total={total}" + Console.ok(msg) + else: + msg = f"{counter} failed: nodes={nodes:02d} threads={threads:02d} total={total}" + Console.error(msg) + f.writelines([msg, "\n"]) +f.close() diff --git a/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup2.py b/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup2.py new file mode 100644 index 000000000..7be190aa6 --- /dev/null +++ b/target/rivanna/scripts/ucc-ucx-redis/cylon-experiment-setup2.py @@ -0,0 +1,143 @@ +import os +import sys +import argparse +from textwrap import dedent +from cloudmesh.common.util import writefile +from cloudmesh.common.util import readfile +from cloudmesh.common.util import banner +from cloudmesh.common.console import Console +import argparse + +counter = 0 + + +debug = False + +partition="bii-gpu" + +partition="parallel" + +parser = argparse.ArgumentParser(description="cylon rivanna scaling test") +parser.add_argument('-n', dest='rows', type=int, required=True) + +parser.add_argument('-s', dest='scaling', type=str, default='w', choices=['s', 'w'], + help="s=strong w=weak") + + +parser.add_argument('-w', dest='world_size', type=int, help="world size", required=True) + + +parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", + default=6379) # 6379 + +args = vars(parser.parse_args()) + + +# (nodes, threads, cpus, rows, partition, "exclusive") +combination = [\ + # (1,4, 5000, "parallel", "exclusive"), # always pending + ("dev-cylon-redis4.aws-cylondata.com", 1,1, 1, args['rows'], "standard", ""), + #("54.227.18.138", 4,8, 16, args['rows'], "parallel", ""), + #("44.213.71.107", 4,8, 16, args['rows'], "parallel", ""), + #("52.90.116.44", 4,8, 16, args['rows'], "parallel", ""), + #(2,37, 1000000, "parallel", ""), + #(4,37, 35000000, "parallel", ""), + #(6,37, 35000000, "parallel", ""), + #(8,37, 35000000, "parallel", ""), + #(10,37, 35000000, "parallel", ""), + #(12,37, 35000000, "parallel", ""), + #(14,37, 35000000, "parallel", ""), +] + +''' +combination = [] +for nodes in range(0,50): + for threads in range(0,37): + combination.append((nodes+1, threads+1, "parallel", "")) +''' + +total = len(combination) +jobid="-%j" +# jobid="" + +f = open("../../../../rivanna/scripts/submit.log", "w") +for redis, nodes, threads, cpus, rows, partition, exclusive in combination: + counter = counter + 1 + + if exclusive == "exclusive": + exclusive = "#SBATCH --exclusive" + e = "e1" + else: + exclusive = "" + e = "e0" + + usable_threads = nodes * threads + + ''' + cores_per_node = nodes * threads - 2 + + print (cores_per_node) + + config = readfile("raptor.in.cfg") + + config = config.replace("CORES_PER_NODE", str(cores_per_node)) + config = config.replace("NO_OF_ROWS", str(rows)) + + + print (config) + + cfg_filename = f"raptor-{nodes}-{threads}.cfg" + + writefile(cfg_filename, config) + ''' + banner(f"SLURM {nodes} {threads} {counter}/{total}") + script=dedent(f""" + #!/bin/bash + #SBATCH --job-name=h-n={nodes:02d}-t={threads:02d}-e={e} + #SBATCH --nodes={nodes} + #SBATCH --ntasks={threads} + #SBATCH --ntasks-per-core={nodes} + #SBATCH --cpus-per-task={cpus} + #SBATCH --time=15:00 + #SBATCH --output=out-{nodes:02d}-{threads:02d}{jobid}.log + #SBATCH --error=out-{nodes:02d}-{threads:02d}{jobid}.err + #SBATCH --partition={partition} + #SBATCH -A bii_dsc_community + {exclusive} + echo "..............................................................." + module load gcc/9.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 + echo "..............................................................." + source /scratch/qad5gv/cylon/CYLON-ENV/bin/activate + echo "..............................................................." + BUILD_PATH=/scratch/qad5gv/cylon/build + UCC_INSTALL=/scratch/qad5gv/ucc/install + UCX_INSTALL=/scratch/qad5gv/ucx/install + REDIS_INSTALL=/scratch/qad5gv/redis_install + echo "..............................................................." + export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH + echo "..............................................................." + which python gcc g++ + echo "..............................................................." + lscpu + echo "..............................................................." + time python cylon_scaling.py -n {rows} -s {args["scaling"]} -w {args["world_size"]} -r {redis} -p1 {args["redis_port"]} + echo "..............................................................." + """).strip() + + print (script) + filename = f"script-{nodes:02d}-{threads:02d}.slurm" + writefile(filename, script) + + + if not debug: + + r = os.system(f"sbatch {filename}") + total = nodes * threads + if r == 0: + msg = f"{counter} submitted: nodes={nodes:02d} threads={threads:02d} total={total}" + Console.ok(msg) + else: + msg = f"{counter} failed: nodes={nodes:02d} threads={threads:02d} total={total}" + Console.error(msg) + f.writelines([msg, "\n"]) +f.close() diff --git a/target/rivanna/scripts/ucc-ucx-redis/cylon_scaling.py b/target/rivanna/scripts/ucc-ucx-redis/cylon_scaling.py new file mode 100644 index 000000000..012433db4 --- /dev/null +++ b/target/rivanna/scripts/ucc-ucx-redis/cylon_scaling.py @@ -0,0 +1,108 @@ +import time +import argparse + +import pandas as pd +from mpi4py import MPI +from numpy.random import default_rng +from pycylon.frame import CylonEnv, DataFrame +from pycylon.net import MPIConfig +from cloudmesh.common.StopWatch import StopWatch +from cloudmesh.common.dotdict import dotdict +from cloudmesh.common.Shell import Shell +from pycylon.net.ucc_config import UCCConfig +from pycylon.net.redis_ucc_oob_context import UCCRedisOOBContext +from pycylon.net.reduce_op import ReduceOp + + +def cylon_join(data=None): + global ucc_config + StopWatch.start(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + redis_context = UCCRedisOOBContext(data['world_size'], f"tcp://{data['redis_host']}:{data['redis_port']}") + + if redis_context is not None: + ucc_config = UCCConfig(redis_context) + + if ucc_config is None: + print("unable to initialize uccconfig") + + env = CylonEnv(config=ucc_config, distributed=True) + + u = data['unique'] + + context = env.context + + if context is None: + print("unable to retrieve cylon context") + + communicator = context.get_communicator() + + if data['scaling'] == 'w': # weak + num_rows = data['rows'] + max_val = num_rows * env.world_size + else: # 's' strong + max_val = data['rows'] + num_rows = int(data['rows'] / env.world_size) + + rng = default_rng(seed=env.rank) + data1 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + data2 = rng.integers(0, int(max_val * u), size=(num_rows, 2)) + + df1 = DataFrame(pd.DataFrame(data1).add_prefix("col")) + df2 = DataFrame(pd.DataFrame(data2).add_prefix("col")) + + if env.rank == 0: + print("Task# ", data['task']) + + for i in range(data['it']): + env.barrier() + StopWatch.start(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + t1 = time.time() + df3 = df1.merge(df2, on=[0], algorithm='sort', env=env) + env.barrier() + t2 = time.time() + t = (t2 - t1) + + sum_t = communicator.allreduce(t, ReduceOp.SUM) + + tot_l = communicator.allreduce(len(df3), ReduceOp.SUM) + + if env.rank == 0: + avg_t = sum_t / env.world_size + print("### ", data['scaling'], env.world_size, num_rows, max_val, i, avg_t, tot_l) + StopWatch.stop(f"join_{i}_{data['host']}_{data['rows']}_{data['it']}") + + StopWatch.stop(f"join_total_{data['host']}_{data['rows']}_{data['it']}") + + if env.rank == 0: + StopWatch.benchmark(tag=str(data)) + + env.finalize() + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="weak scaling") + parser.add_argument('-n', dest='rows', type=int, required=True) + parser.add_argument('-i', dest='it', type=int, default=10) + parser.add_argument('-u', dest='unique', type=float, default=0.9, help="unique factor") + parser.add_argument('-s', dest='scaling', type=str, default='w', choices=['s', 'w'], + help="s=strong w=weak") + parser.add_argument('-w', dest='world_size', type=int, help="world size", required=True) + + parser.add_argument("-r", dest='redis_host', type=str, help="redis address", + required=True) + + parser.add_argument("-p1", dest='redis_port', type=int, help="name of redis port", + default=6379) # 6379 + + args = vars(parser.parse_args()) + args['host'] = "rivanna" + for i in range(1): + args['task'] = i + # cylon_slice(args) + cylon_join(args) + #cylon_sort(args) + + # os.system(f"{git} branch | fgrep '*' ") + # os.system(f"{git} rev-parse HEAD") From 44b16872a2cde732e3cc87105a924193c3457d75 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:14:01 -0500 Subject: [PATCH 12/19] partial - merge with rivanna-ucc-ucx-redis --- target/rivanna/installUCCUCX.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh index c2f8b321a..72bf3e512 100644 --- a/target/rivanna/installUCCUCX.sh +++ b/target/rivanna/installUCCUCX.sh @@ -4,7 +4,7 @@ PWD=`pwd` BUILD_PATH=$PWD/build -module load gcc/9.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 +module load gcc/11.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 python -m venv $PWD/CYLON-ENV From e0a5acc87d5766499623a88b6490e0b142dae064 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:16:09 -0500 Subject: [PATCH 13/19] partial - merge with rivanna-ucc-ucx-redis --- target/rivanna/installUCCUCX.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh index 72bf3e512..38580ad64 100644 --- a/target/rivanna/installUCCUCX.sh +++ b/target/rivanna/installUCCUCX.sh @@ -4,7 +4,7 @@ PWD=`pwd` BUILD_PATH=$PWD/build -module load gcc/11.2.0 openmpi/3.1.6 python/3.7.7 cmake/3.23.3 +module load gcc/11.2.0 openmpi/3.1.6 python/3.8.8 cmake/3.23.3 python -m venv $PWD/CYLON-ENV From ec3f6975095948c1812f27083ad1962f1b7b2657 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:24:56 -0500 Subject: [PATCH 14/19] partial - merge with rivanna-ucc-ucx-redis --- target/rivanna/installUCCUCX.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh index 38580ad64..c8a2d02a4 100644 --- a/target/rivanna/installUCCUCX.sh +++ b/target/rivanna/installUCCUCX.sh @@ -11,25 +11,25 @@ python -m venv $PWD/CYLON-ENV source $PWD/CYLON-ENV/bin/activate # pip install -r $PWD/requirements.txt -pip install pip -U -pip install pytest -pip install -U pytest-mpi -pip install numpy -pip install cloudmesh-openstack +#pip install pip -U +#pip install pytest +#pip install -U pytest-mpi +#pip install numpy +#pip install cloudmesh-openstack # pip install pyarrow==9.0.0 -export CC=`which gcc` -export CXX=`which g++` -CC=gcc MPICC=mpicc pip install --no-binary mpi4py install mpi4py -UCC_INSTALL=/scratch/qad5gv/ucc/install -UCX_INSTALL=/scratch/qad5gv/ucx/install -REDIS_INSTALL=/scratch/qad5gv/redis_install -pip install urllib3==1.26.6 +#export CC=`which gcc` +#export CXX=`which g++` +#CC=gcc MPICC=mpicc pip install --no-binary mpi4py install mpi4py +#UCC_INSTALL=/scratch/qad5gv/ucc/install +#UCX_INSTALL=/scratch/qad5gv/ucx/install +#REDIS_INSTALL=/scratch/qad5gv/redis_install +#pip install urllib3==1.26.6 -rm -rf build +#rm -rf build -export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH +#export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" From bfe75da425ba4b0fdc4cdbe67417c318fff45c49 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:27:59 -0500 Subject: [PATCH 15/19] partial - merge with rivanna-ucc-ucx-redis --- target/rivanna/installUCCUCX.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh index c8a2d02a4..ea80e742f 100644 --- a/target/rivanna/installUCCUCX.sh +++ b/target/rivanna/installUCCUCX.sh @@ -10,7 +10,7 @@ python -m venv $PWD/CYLON-ENV source $PWD/CYLON-ENV/bin/activate -# pip install -r $PWD/requirements.txt +#pip install -r $PWD/requirements.txt #pip install pip -U #pip install pytest #pip install -U pytest-mpi @@ -32,4 +32,4 @@ source $PWD/CYLON-ENV/bin/activate #export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH -time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" +#time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" From 12277239ba6be0784877f55488a2fc9653fdd494 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Mon, 13 Nov 2023 12:34:54 -0500 Subject: [PATCH 16/19] partial - merge with rivanna-ucc-ucx-redis --- target/rivanna/installUCCUCX.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/rivanna/installUCCUCX.sh b/target/rivanna/installUCCUCX.sh index ea80e742f..38580ad64 100644 --- a/target/rivanna/installUCCUCX.sh +++ b/target/rivanna/installUCCUCX.sh @@ -10,26 +10,26 @@ python -m venv $PWD/CYLON-ENV source $PWD/CYLON-ENV/bin/activate -#pip install -r $PWD/requirements.txt -#pip install pip -U -#pip install pytest -#pip install -U pytest-mpi -#pip install numpy -#pip install cloudmesh-openstack +# pip install -r $PWD/requirements.txt +pip install pip -U +pip install pytest +pip install -U pytest-mpi +pip install numpy +pip install cloudmesh-openstack # pip install pyarrow==9.0.0 -#export CC=`which gcc` -#export CXX=`which g++` -#CC=gcc MPICC=mpicc pip install --no-binary mpi4py install mpi4py -#UCC_INSTALL=/scratch/qad5gv/ucc/install -#UCX_INSTALL=/scratch/qad5gv/ucx/install -#REDIS_INSTALL=/scratch/qad5gv/redis_install -#pip install urllib3==1.26.6 +export CC=`which gcc` +export CXX=`which g++` +CC=gcc MPICC=mpicc pip install --no-binary mpi4py install mpi4py +UCC_INSTALL=/scratch/qad5gv/ucc/install +UCX_INSTALL=/scratch/qad5gv/ucx/install +REDIS_INSTALL=/scratch/qad5gv/redis_install +pip install urllib3==1.26.6 -#rm -rf build +rm -rf build -#export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$BUILD_PATH/install/lib:$UCX_INSTALL/lib:$UCC_INSTALL/lib:$REDIS_INSTALL/lib:$REDIS_INSTALL/lib64:$LD_LIBRARY_PATH -#time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" +time ./build.sh -j$(nproc) -pyenv $PWD/CYLON-ENV -bpath $PWD/build -ucxpath $UCX_INSTALL -uccpath $UCC_INSTALL -redispath $REDIS_INSTALL --cpp --python --cython --pytest --cmake-flags "-DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCYLON_UCX=1 -DUCX_INSTALL_PREFIX=$UCX_INSTALL -DCYLON_UCC=1 -DUCC_INSTALL_PREFIX=$UCC_INSTALL -DCYLON_USE_REDIS=1 -DREDIS_INSTALL_PREFIX=$REDIS_INSTALL" From f9b67aa2293019a445a4b29a2f365d6397732fb4 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Thu, 16 Nov 2023 14:37:53 -0500 Subject: [PATCH 17/19] partial - removes macos workflow --- .github/workflows/macos.yml | 44 ------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 3ad7f8b8b..000000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: MacOS C++/Python - Clang,OpenMPI - -on: - push: - branches: - - main - - 0.** - pull_request: - branches: - - main - - 0.** - -jobs: - build: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - strategy: - fail-fast: false - matrix: - include: - - os: macos-11 - - steps: - - uses: actions/checkout@v2 - - name: Remove link for preventing an error - run: rm -f /usr/local/bin/2to3 - - name: Install dependencies - run: brew install re2 automake boost brotli c-ares ccache flatbuffers grpc llvm lz4 minio ninja openssl@1.1 protobuf rapidjson snappy thrift wget zstd - - - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: cylon_dev - environment-file: conda/environments/cylon_MacOS.yml - - - name: activate conda - run: conda activate cylon_dev - - - name: Build cylon, pycylon and run cpp test - run: python build.py --cpp --python --test - - - name: Run pytest - run: python build.py --pytest From 7989a39c4a8d16551b91aa17c3245454f41dc071 Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Sun, 19 Nov 2023 18:52:21 -0500 Subject: [PATCH 18/19] partial - adds aws lambda dockerfile --- .github/workflows/macos.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..3ad7f8b8b --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,44 @@ +name: MacOS C++/Python - Clang,OpenMPI + +on: + push: + branches: + - main + - 0.** + pull_request: + branches: + - main + - 0.** + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -l {0} + strategy: + fail-fast: false + matrix: + include: + - os: macos-11 + + steps: + - uses: actions/checkout@v2 + - name: Remove link for preventing an error + run: rm -f /usr/local/bin/2to3 + - name: Install dependencies + run: brew install re2 automake boost brotli c-ares ccache flatbuffers grpc llvm lz4 minio ninja openssl@1.1 protobuf rapidjson snappy thrift wget zstd + + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: cylon_dev + environment-file: conda/environments/cylon_MacOS.yml + + - name: activate conda + run: conda activate cylon_dev + + - name: Build cylon, pycylon and run cpp test + run: python build.py --cpp --python --test + + - name: Run pytest + run: python build.py --pytest From cdf192f1da202aab6318e8557a522fa2921874ae Mon Sep 17 00:00:00 2001 From: APKAI5AM767AKRTSIELQ Date: Tue, 21 Nov 2023 17:49:23 -0500 Subject: [PATCH 19/19] partial - updates macos action --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3ad7f8b8b..15cbb3d38 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: include: - - os: macos-11 + - os: macos-latest steps: - uses: actions/checkout@v2