From 082229a2faba4a8bf9e7367f8ab03b3689448b7b Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 04:08:13 +0000 Subject: [PATCH 1/6] Add a temporary workflow that generates the SWIG wrappers for 51degrees-cxx 4.5.102 --- .github/workflows/tmp-regen-swig.yml | 220 +++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 .github/workflows/tmp-regen-swig.yml diff --git a/.github/workflows/tmp-regen-swig.yml b/.github/workflows/tmp-regen-swig.yml new file mode 100644 index 00000000..d8c8b1a8 --- /dev/null +++ b/.github/workflows/tmp-regen-swig.yml @@ -0,0 +1,220 @@ +name: Temporary SWIG wrapper generation + +# Temporary. Generates both SWIG wrappers for the move of cxx to 4.5.102, +# commits them to this branch, and is then deleted from the branch. + +on: + push: + branches: + - 'feature/cxx-4.5.102' + +permissions: + contents: write + +env: + SWIG_TAG: v4.4.1 + SWIG_COMMIT: c7b01379fa00ff152bc22d4dd0e0d5bb862282d9 + CXX_OLD: 4110d6813e167a803a06489318b33b83a230fa32 + CXX_NEW: 1bec7b570575e2e180b52435599bef9b03e35ad8 + DD: device-detection/fiftyone_devicedetection_onpremise + IPI: ip-intelligence/fiftyone_ipintelligence_onpremise + +defaults: + run: + shell: bash + +jobs: + Generate: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Check out with submodules + uses: actions/checkout@v4 + with: + submodules: true + + - name: Check the starting point + run: | + set -euo pipefail + git log -1 --format='%H %s' + test "$(git -C cxx rev-parse HEAD)" = "$CXX_OLD" + + - name: Build SWIG from its tag + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y autoconf automake bison libpcre2-dev + git clone --depth 1 --branch "$SWIG_TAG" \ + https://github.com/swig/swig.git "$RUNNER_TEMP/swig-src" + test "$(git -C "$RUNNER_TEMP/swig-src" rev-parse HEAD)" = "$SWIG_COMMIT" + cd "$RUNNER_TEMP/swig-src" + ./autogen.sh + ./configure --prefix="$RUNNER_TEMP/swig" + make -j"$(nproc)" + make install + echo "SWIG_BIN=$RUNNER_TEMP/swig/bin/swig" >> "$GITHUB_ENV" + mkdir -p "$RUNNER_TEMP/artifact" + "$RUNNER_TEMP/swig/bin/swig" -version \ + | tee "$RUNNER_TEMP/artifact/swig-version.txt" + + - name: Write the generation script + run: | + set -euo pipefail + # generate + # Stages common and the product's folder of cxx/src beside the + # interface, as setup.py does, runs SWIG there and copies the + # wrapper and the Python module to . + cat > "$RUNNER_TEMP/generate.sh" <<'SCRIPT' + set -euo pipefail + src="$1/src/$(basename "$1")" + interface=$2 + wrapper=$3 + product=$4 + out=$5 + work="$RUNNER_TEMP/work-$(basename "$1")" + rm -rf "$work" + cp -R "$GITHUB_WORKSPACE/$src" "$work" + rm -rf "$work/cxx" + mkdir -p "$work/cxx/src" + cp -R "$GITHUB_WORKSPACE/cxx/src/common" "$work/cxx/src/common" + cp -R "$GITHUB_WORKSPACE/cxx/src/$product" "$work/cxx/src/$product" + module=$(grep -h '^%module' "$work/cxx/src/$product"/*.i \ + "$work/cxx/src/$product"/*/*.i 2>/dev/null | head -1 \ + | sed 's/%module *"\{0,1\}\([A-Za-z]*\).*/\1/') + cd "$work" + set -x + "$SWIG_BIN" -c++ -python -outdir . -o "$wrapper" "$interface" + set +x + mkdir -p "$out" + cp "$wrapper" "$module.py" "$out/" + echo "$module" > "$out/module.txt" + SCRIPT + chmod +x "$RUNNER_TEMP/generate.sh" + + - name: Generate at 4110d681 and compare with the committed files + id: old + run: | + set -euo pipefail + identical=true + for spec in "$DD hash_python.i hash_python_wrap.cxx dd" \ + "$IPI ipi_python.i ipi_python_wrap.cxx ipi"; do + set -- $spec + out="$RUNNER_TEMP/artifact/old-$(basename "$1")" + bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$out" + module=$(cat "$out/module.txt") + src="$1/src/$(basename "$1")" + for f in "$3" "$module.py"; do + if cmp "$src/$f" "$out/$f"; then + echo "$f at 4110d681 is byte for byte the committed file." + else + identical=false + diff "$src/$f" "$out/$f" > "$out/$f.diff" || true + echo "$f at 4110d681 differs from the committed file:" + head -60 "$out/$f.diff" + fi + done + done + echo "identical=$identical" >> "$GITHUB_OUTPUT" + + - name: Move cxx to 1bec7b57 and generate in place + if: steps.old.outputs.identical == 'true' + run: | + set -euo pipefail + git -C cxx fetch --depth 1 origin "$CXX_NEW" + git -C cxx checkout --detach "$CXX_NEW" + test "$(git -C cxx rev-parse HEAD)" = "$CXX_NEW" + for spec in "$DD hash_python.i hash_python_wrap.cxx dd" \ + "$IPI ipi_python.i ipi_python_wrap.cxx ipi"; do + set -- $spec + out="$RUNNER_TEMP/artifact/new-$(basename "$1")" + bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$out" + module=$(cat "$out/module.txt") + cp "$out/$3" "$out/$module.py" "$1/src/$(basename "$1")/" + done + git status --porcelain --untracked-files=all \ + | tee "$RUNNER_TEMP/artifact/status-new.txt" + git diff --stat + + - name: Upload the outputs and the diffs + if: always() + uses: actions/upload-artifact@v4 + with: + name: swig-wrappers + path: ${{ runner.temp }}/artifact + if-no-files-found: warn + + - name: Stop unless the 4110d681 outputs are the committed files + if: steps.old.outputs.identical != 'true' + run: | + echo "The command does not reproduce the committed wrappers." + echo "Nothing is committed." + exit 1 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Build both packages against 1bec7b57 and load the modules + run: | + set -euo pipefail + python -m pip install --upgrade pip + for pkg in "$DD" "$IPI"; do + python -m pip wheel --no-deps -w "$RUNNER_TEMP/dist" "./$pkg" + done + python -m pip install --no-deps "$RUNNER_TEMP"/dist/*.whl + cd "$RUNNER_TEMP" + python - <<'PY' + import importlib + for name, cls in ( + ('fiftyone_devicedetection_onpremise.DeviceDetectionHashEngineModule', + 'EngineHashSwig'), + ('fiftyone_ipintelligence_onpremise.IpIntelligenceEngineModule', + 'EngineIpiSwig')): + module = importlib.import_module(name) + assert hasattr(getattr(module, cls), 'process'), (name, cls) + print(name, 'loads, and', cls, 'has process') + PY + # The build stages cxx/src inside each package, which git ignores. + git -C "$GITHUB_WORKSPACE" status --porcelain --untracked-files=all + + - name: Commit the pointer and the wrappers, and push + env: + GIT_AUTHOR_NAME: James Rosewell + GIT_AUTHOR_EMAIL: james@51degrees.com + GIT_COMMITTER_NAME: James Rosewell + GIT_COMMITTER_EMAIL: james@51degrees.com + run: | + set -euo pipefail + git add cxx "$DD/src" "$IPI/src" + left="$(git status --porcelain --untracked-files=all \ + | grep -v -E '^M cxx$' \ + | grep -v -E '^M (device-detection|ip-intelligence)/[^ ]+_onpremise/src/[^ ]+_onpremise/[A-Za-z_]+(\.py|_wrap\.cxx)$' \ + || true)" + if [ -n "$left" ]; then + echo "Changes other than the pointer and the wrappers:" + echo "$left" + exit 1 + fi + git diff --cached --stat + cat > "$RUNNER_TEMP/message.txt" <<'MSG' + Generate both SWIG wrappers again for 51degrees-cxx 4.5.102 + + Between 4.5.100 and 4.5.102, 51degrees-cxx removed the two + EngineHash process overloads and the three EngineIpi process + overloads that take required property indexes. The committed + wrappers still called them, so neither on-premise package compiled + against 4.5.102, which the nightly submodule update brings in #26. + + This moves the cxx submodule from 4110d681, the 4.5.100 release, to + 1bec7b57, the 4.5.102 release, and generates hash_python_wrap.cxx, + DeviceDetectionHashEngineModule.py, ipi_python_wrap.cxx and + IpIntelligenceEngineModule.py again with SWIG 4.4.1 built from its + v4.4.1 tag. Run against 4110d681, the same command gives files byte + for byte the same as the ones committed before, so every difference + here comes from cxx. Both engines call only process(evidence), which + cxx keeps. + MSG + git commit -F "$RUNNER_TEMP/message.txt" + git log -1 --format='commit %H%nauthor %an <%ae>%n%n%B' + git push origin "HEAD:refs/heads/$GITHUB_REF_NAME" From c583f61a9aef48a22b77a97f170266688ed9c659 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 04:12:35 +0000 Subject: [PATCH 2/6] Name the SWIG modules in the temporary workflow instead of reading them --- .github/workflows/tmp-regen-swig.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tmp-regen-swig.yml b/.github/workflows/tmp-regen-swig.yml index d8c8b1a8..f399bcaa 100644 --- a/.github/workflows/tmp-regen-swig.yml +++ b/.github/workflows/tmp-regen-swig.yml @@ -18,6 +18,9 @@ env: CXX_NEW: 1bec7b570575e2e180b52435599bef9b03e35ad8 DD: device-detection/fiftyone_devicedetection_onpremise IPI: ip-intelligence/fiftyone_ipintelligence_onpremise + # The %module names in cxx's hash.i and ipi.i. + DD_MODULE: DeviceDetectionHashEngineModule + IPI_MODULE: IpIntelligenceEngineModule defaults: run: @@ -60,7 +63,8 @@ jobs: - name: Write the generation script run: | set -euo pipefail - # generate + # generate + # # Stages common and the product's folder of cxx/src beside the # interface, as setup.py does, runs SWIG there and copies the # wrapper and the Python module to . @@ -70,7 +74,8 @@ jobs: interface=$2 wrapper=$3 product=$4 - out=$5 + module=$5 + out=$6 work="$RUNNER_TEMP/work-$(basename "$1")" rm -rf "$work" cp -R "$GITHUB_WORKSPACE/$src" "$work" @@ -78,9 +83,6 @@ jobs: mkdir -p "$work/cxx/src" cp -R "$GITHUB_WORKSPACE/cxx/src/common" "$work/cxx/src/common" cp -R "$GITHUB_WORKSPACE/cxx/src/$product" "$work/cxx/src/$product" - module=$(grep -h '^%module' "$work/cxx/src/$product"/*.i \ - "$work/cxx/src/$product"/*/*.i 2>/dev/null | head -1 \ - | sed 's/%module *"\{0,1\}\([A-Za-z]*\).*/\1/') cd "$work" set -x "$SWIG_BIN" -c++ -python -outdir . -o "$wrapper" "$interface" @@ -96,11 +98,11 @@ jobs: run: | set -euo pipefail identical=true - for spec in "$DD hash_python.i hash_python_wrap.cxx dd" \ - "$IPI ipi_python.i ipi_python_wrap.cxx ipi"; do + for spec in "$DD hash_python.i hash_python_wrap.cxx dd $DD_MODULE" \ + "$IPI ipi_python.i ipi_python_wrap.cxx ipi $IPI_MODULE"; do set -- $spec out="$RUNNER_TEMP/artifact/old-$(basename "$1")" - bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$out" + bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$5" "$out" module=$(cat "$out/module.txt") src="$1/src/$(basename "$1")" for f in "$3" "$module.py"; do @@ -123,11 +125,11 @@ jobs: git -C cxx fetch --depth 1 origin "$CXX_NEW" git -C cxx checkout --detach "$CXX_NEW" test "$(git -C cxx rev-parse HEAD)" = "$CXX_NEW" - for spec in "$DD hash_python.i hash_python_wrap.cxx dd" \ - "$IPI ipi_python.i ipi_python_wrap.cxx ipi"; do + for spec in "$DD hash_python.i hash_python_wrap.cxx dd $DD_MODULE" \ + "$IPI ipi_python.i ipi_python_wrap.cxx ipi $IPI_MODULE"; do set -- $spec out="$RUNNER_TEMP/artifact/new-$(basename "$1")" - bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$out" + bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$5" "$out" module=$(cat "$out/module.txt") cp "$out/$3" "$out/$module.py" "$1/src/$(basename "$1")/" done From 5f539c0fd5b8d5305b97a66669e873907ffff381 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 04:14:42 +0000 Subject: [PATCH 3/6] Generate both SWIG wrappers again for 51degrees-cxx 4.5.102 Between 4.5.100 and 4.5.102, 51degrees-cxx removed the two EngineHash process overloads and the three EngineIpi process overloads that take required property indexes. The committed wrappers still called them, so neither on-premise package compiled against 4.5.102, which the nightly submodule update brings in #26. This moves the cxx submodule from 4110d681, the 4.5.100 release, to 1bec7b57, the 4.5.102 release, and generates hash_python_wrap.cxx, DeviceDetectionHashEngineModule.py, ipi_python_wrap.cxx and IpIntelligenceEngineModule.py again with SWIG 4.4.1 built from its v4.4.1 tag. Run against 4110d681, the same command gives files byte for byte the same as the ones committed before, so every difference here comes from cxx. Both engines call only process(evidence), which cxx keeps. --- cxx | 2 +- .../DeviceDetectionHashEngineModule.py | 120 + .../hash_python_wrap.cxx | 4022 ++++++++++++++++- .../ipi_python_wrap.cxx | 345 +- 4 files changed, 3895 insertions(+), 594 deletions(-) diff --git a/cxx b/cxx index 4110d681..1bec7b57 160000 --- a/cxx +++ b/cxx @@ -1 +1 @@ -Subproject commit 4110d6813e167a803a06489318b33b83a230fa32 +Subproject commit 1bec7b570575e2e180b52435599bef9b03e35ad8 diff --git a/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/DeviceDetectionHashEngineModule.py b/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/DeviceDetectionHashEngineModule.py index 1d25c57e..d199e300 100644 --- a/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/DeviceDetectionHashEngineModule.py +++ b/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/DeviceDetectionHashEngineModule.py @@ -1138,6 +1138,12 @@ def setUsePredictiveGraph(self, use): def setTraceRoute(self, trace): return _DeviceDetectionHashEngineModule.ConfigHashSwig_setTraceRoute(self, trace) + def setPropertyValueIndex(self, index): + return _DeviceDetectionHashEngineModule.ConfigHashSwig_setPropertyValueIndex(self, index) + + def setIndexedProperties(self, names): + return _DeviceDetectionHashEngineModule.ConfigHashSwig_setIndexedProperties(self, names) + def getStrings(self): return _DeviceDetectionHashEngineModule.ConfigHashSwig_getStrings(self) @@ -1173,10 +1179,121 @@ def getConcurrency(self): def getTraceRoute(self): return _DeviceDetectionHashEngineModule.ConfigHashSwig_getTraceRoute(self) + + def getPropertyValueIndex(self): + return _DeviceDetectionHashEngineModule.ConfigHashSwig_getPropertyValueIndex(self) + + def getIndexedProperties(self): + return _DeviceDetectionHashEngineModule.ConfigHashSwig_getIndexedProperties(self) __swig_destroy__ = _DeviceDetectionHashEngineModule.delete_ConfigHashSwig # Register ConfigHashSwig in _DeviceDetectionHashEngineModule: _DeviceDetectionHashEngineModule.ConfigHashSwig_swigregister(ConfigHashSwig) +class VectorUInt32Swig(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___nonzero__(self) + + def __bool__(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___bool__(self) + + def __len__(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___len__(self) + + def __getslice__(self, i, j): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___getslice__(self, i, j) + + def __setslice__(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___setslice__(self, *args) + + def __delslice__(self, i, j): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___delslice__(self, i, j) + + def __delitem__(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___delitem__(self, *args) + + def __getitem__(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___getitem__(self, *args) + + def __setitem__(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig___setitem__(self, *args) + + def pop(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_pop(self) + + def append(self, x): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_append(self, x) + + def empty(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_empty(self) + + def size(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_size(self) + + def swap(self, v): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_swap(self, v) + + def begin(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_begin(self) + + def end(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_end(self) + + def rbegin(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_rbegin(self) + + def rend(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_rend(self) + + def clear(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_clear(self) + + def get_allocator(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_get_allocator(self) + + def pop_back(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_pop_back(self) + + def erase(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_erase(self, *args) + + def __init__(self, *args): + _DeviceDetectionHashEngineModule.VectorUInt32Swig_swiginit(self, _DeviceDetectionHashEngineModule.new_VectorUInt32Swig(*args)) + + def push_back(self, x): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_push_back(self, x) + + def front(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_front(self) + + def back(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_back(self) + + def assign(self, n, x): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_assign(self, n, x) + + def resize(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_resize(self, *args) + + def insert(self, *args): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_insert(self, *args) + + def reserve(self, n): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_reserve(self, n) + + def capacity(self): + return _DeviceDetectionHashEngineModule.VectorUInt32Swig_capacity(self) + __swig_destroy__ = _DeviceDetectionHashEngineModule.delete_VectorUInt32Swig + +# Register VectorUInt32Swig in _DeviceDetectionHashEngineModule: +_DeviceDetectionHashEngineModule.VectorUInt32Swig_swigregister(VectorUInt32Swig) class EngineHashSwig(EngineDeviceDetectionSwig): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -1208,6 +1325,9 @@ def refreshDataFromMemory(self, data): def process(self, *args): return _DeviceDetectionHashEngineModule.EngineHashSwig_process(self, *args) + def getProfileIdsForPropertyValue(self, propertyName, valueName): + return _DeviceDetectionHashEngineModule.EngineHashSwig_getProfileIdsForPropertyValue(self, propertyName, valueName) + def processBase(self, evidence): return _DeviceDetectionHashEngineModule.EngineHashSwig_processBase(self, evidence) diff --git a/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/hash_python_wrap.cxx b/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/hash_python_wrap.cxx index 20fe7cba..e973fa1e 100644 --- a/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/hash_python_wrap.cxx +++ b/device-detection/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/hash_python_wrap.cxx @@ -3486,19 +3486,21 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_std__string_t_t swig_types[43] #define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[44] #define SWIGTYPE_p_std__allocatorT_unsigned_char_t swig_types[45] -#define SWIGTYPE_p_std__invalid_argument swig_types[46] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[47] -#define SWIGTYPE_p_std__mapT_std__string_std__string_t swig_types[48] -#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[49] -#define SWIGTYPE_p_std__vectorT_uint8_t_t swig_types[50] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[51] -#define SWIGTYPE_p_unsigned_char swig_types[52] -#define SWIGTYPE_p_unsigned_int swig_types[53] -#define SWIGTYPE_p_unsigned_long_long swig_types[54] -#define SWIGTYPE_p_unsigned_short swig_types[55] -#define SWIGTYPE_p_value_type swig_types[56] -static swig_type_info *swig_types[58]; -static swig_module_info swig_module = {swig_types, 57, 0, 0, 0, 0}; +#define SWIGTYPE_p_std__allocatorT_unsigned_int_t swig_types[46] +#define SWIGTYPE_p_std__invalid_argument swig_types[47] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[48] +#define SWIGTYPE_p_std__mapT_std__string_std__string_t swig_types[49] +#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[50] +#define SWIGTYPE_p_std__vectorT_uint32_t_t swig_types[51] +#define SWIGTYPE_p_std__vectorT_uint8_t_t swig_types[52] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[53] +#define SWIGTYPE_p_unsigned_char swig_types[54] +#define SWIGTYPE_p_unsigned_int swig_types[55] +#define SWIGTYPE_p_unsigned_long_long swig_types[56] +#define SWIGTYPE_p_unsigned_short swig_types[57] +#define SWIGTYPE_p_value_type swig_types[58] +static swig_type_info *swig_types[60]; +static swig_module_info swig_module = {swig_types, 59, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -5961,6 +5963,9 @@ SWIGINTERN std::vector< std::string >::iterator std_vector_Sl_std_string_Sg__era SWIGINTERN std::vector< std::string >::iterator std_vector_Sl_std_string_Sg__insert__SWIG_0(std::vector< std::string > *self,std::vector< std::string >::iterator pos,std::vector< std::string >::value_type const &x){ return self->insert(pos, x); } SWIGINTERN void std_vector_Sl_std_string_Sg__insert__SWIG_1(std::vector< std::string > *self,std::vector< std::string >::iterator pos,std::vector< std::string >::size_type n,std::vector< std::string >::value_type const &x){ self->insert(pos, n, x); } +#include // Use the C99 official header + + @@ -6004,9 +6009,6 @@ SWIGINTERNINLINE PyObject* } -#include // Use the C99 official header - - SWIGINTERN int SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) { @@ -6218,6 +6220,127 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) return res; } + +namespace swig { + template <> struct traits< unsigned int > { + typedef value_category category; + static const char* type_name() { return"unsigned int"; } + }; + template <> struct traits_asval< unsigned int > { + typedef unsigned int value_type; + static int asval(PyObject *obj, value_type *val) { + return SWIG_AsVal_unsigned_SS_int (obj, val); + } + }; + template <> struct traits_from< unsigned int > { + typedef unsigned int value_type; + static PyObject *from(const value_type& val) { + return SWIG_From_unsigned_SS_int (val); + } + }; +} + + + namespace swig { + template <> struct traits > > { + typedef pointer_category category; + static const char* type_name() { + return "std::vector<" "unsigned int" "," "std::allocator< unsigned int >" " >"; + } + }; + } + +SWIGINTERN swig::SwigPyIterator *std_vector_Sl_uint32_t_Sg__iterator(std::vector< uint32_t > *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_uint32_t_Sg____nonzero__(std::vector< uint32_t > const *self){ + return !(self->empty()); + } +SWIGINTERN bool std_vector_Sl_uint32_t_Sg____bool__(std::vector< uint32_t > const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector< unsigned int >::size_type std_vector_Sl_uint32_t_Sg____len__(std::vector< uint32_t > const *self){ + return self->size(); + } +SWIGINTERN std::vector< unsigned int,std::allocator< unsigned int > > *std_vector_Sl_uint32_t_Sg____getslice__(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i,std::vector< unsigned int >::difference_type j){ + return swig::getslice(self, i, j, 1); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____setslice____SWIG_0(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i,std::vector< unsigned int >::difference_type j){ + swig::setslice(self, i, j, 1, std::vector< unsigned int,std::allocator< unsigned int > >()); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____setslice____SWIG_1(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i,std::vector< unsigned int >::difference_type j,std::vector< unsigned int,std::allocator< unsigned int > > const &v){ + swig::setslice(self, i, j, 1, v); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____delslice__(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i,std::vector< unsigned int >::difference_type j){ + swig::delslice(self, i, j, 1); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____delitem____SWIG_0(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i){ + swig::erase(self, swig::getpos(self, i)); + } +SWIGINTERN std::vector< unsigned int,std::allocator< unsigned int > > *std_vector_Sl_uint32_t_Sg____getitem____SWIG_0(std::vector< uint32_t > *self,SWIGPY_SLICEOBJECT *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return NULL; + } + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type id = i; + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type jd = j; + return swig::getslice(self, id, jd, step); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____setitem____SWIG_0(std::vector< uint32_t > *self,SWIGPY_SLICEOBJECT *slice,std::vector< unsigned int,std::allocator< unsigned int > > const &v){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type id = i; + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type jd = j; + swig::setslice(self, id, jd, step, v); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____setitem____SWIG_1(std::vector< uint32_t > *self,SWIGPY_SLICEOBJECT *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type id = i; + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type jd = j; + swig::delslice(self, id, jd, step); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____delitem____SWIG_1(std::vector< uint32_t > *self,SWIGPY_SLICEOBJECT *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type id = i; + std::vector< unsigned int,std::allocator< unsigned int > >::difference_type jd = j; + swig::delslice(self, id, jd, step); + } +SWIGINTERN std::vector< unsigned int >::value_type const &std_vector_Sl_uint32_t_Sg____getitem____SWIG_1(std::vector< uint32_t > const *self,std::vector< unsigned int >::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg____setitem____SWIG_2(std::vector< uint32_t > *self,std::vector< unsigned int >::difference_type i,std::vector< unsigned int >::value_type const &x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN std::vector< unsigned int >::value_type std_vector_Sl_uint32_t_Sg__pop(std::vector< uint32_t > *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector< unsigned int,std::allocator< unsigned int > >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN void std_vector_Sl_uint32_t_Sg__append(std::vector< uint32_t > *self,std::vector< unsigned int >::value_type const &x){ + self->push_back(x); + } +SWIGINTERN std::vector< unsigned int >::iterator std_vector_Sl_uint32_t_Sg__erase__SWIG_0(std::vector< uint32_t > *self,std::vector< unsigned int >::iterator pos){ return self->erase(pos); } +SWIGINTERN std::vector< unsigned int >::iterator std_vector_Sl_uint32_t_Sg__erase__SWIG_1(std::vector< uint32_t > *self,std::vector< unsigned int >::iterator first,std::vector< unsigned int >::iterator last){ return self->erase(first, last); } +SWIGINTERN std::vector< unsigned int >::iterator std_vector_Sl_uint32_t_Sg__insert__SWIG_0(std::vector< uint32_t > *self,std::vector< unsigned int >::iterator pos,std::vector< unsigned int >::value_type const &x){ return self->insert(pos, x); } +SWIGINTERN void std_vector_Sl_uint32_t_Sg__insert__SWIG_1(std::vector< uint32_t > *self,std::vector< unsigned int >::iterator pos,std::vector< unsigned int >::size_type n,std::vector< unsigned int >::value_type const &x){ self->insert(pos, n, x); } #ifdef __cplusplus extern "C" { #endif @@ -25527,6 +25650,130 @@ SWIGINTERN PyObject *_wrap_ConfigHashSwig_setTraceRoute(PyObject *self, PyObject } +SWIGINTERN PyObject *_wrap_ConfigHashSwig_setPropertyValueIndex(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ConfigHash *arg1 = 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "ConfigHashSwig_setPropertyValueIndex", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConfigHashSwig_setPropertyValueIndex" "', argument " "1"" of type '" "ConfigHash *""'"); + } + arg1 = reinterpret_cast< ConfigHash * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConfigHashSwig_setPropertyValueIndex" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + { + try { + (arg1)->setPropertyValueIndex(arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ConfigHashSwig_setIndexedProperties(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ConfigHash *arg1 = 0 ; + std::vector< std::string,std::allocator< std::string > > arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "ConfigHashSwig_setIndexedProperties", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConfigHashSwig_setIndexedProperties" "', argument " "1"" of type '" "ConfigHash *""'"); + } + arg1 = reinterpret_cast< ConfigHash * >(argp1); + { + std::vector< std::string,std::allocator< std::string > > *ptr = (std::vector< std::string,std::allocator< std::string > > *)0; + int res = swig::asptr(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "ConfigHashSwig_setIndexedProperties" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + try { + (arg1)->setIndexedProperties(SWIG_STD_MOVE(arg2));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_ConfigHashSwig_getStrings(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ConfigHash *arg1 = 0 ; @@ -26187,24 +26434,25 @@ SWIGINTERN PyObject *_wrap_ConfigHashSwig_getTraceRoute(PyObject *self, PyObject } -SWIGINTERN PyObject *_wrap_delete_ConfigHashSwig(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ConfigHashSwig_getPropertyValueIndex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ConfigHash *arg1 = 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + bool result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ConfigHashSwig" "', argument " "1"" of type '" "ConfigHash *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConfigHashSwig_getPropertyValueIndex" "', argument " "1"" of type '" "ConfigHash *""'"); } arg1 = reinterpret_cast< ConfigHash * >(argp1); { try { - delete arg1;; + result = (bool)(arg1)->getPropertyValueIndex();; } catch(FatalException& e) { SWIG_exception(SWIG_RuntimeError, e.what()); @@ -26234,53 +26482,3401 @@ SWIGINTERN PyObject *_wrap_delete_ConfigHashSwig(PyObject *self, PyObject *args) SWIG_exception(SWIG_ValueError, e.what()); } } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *ConfigHashSwig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj = NULL; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ConfigHash, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *ConfigHashSwig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_new_EngineHashSwig__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_ConfigHashSwig_getIndexedProperties(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - std::string *arg1 = 0 ; - ConfigHash *arg2 = 0 ; - RequiredPropertiesConfig *arg3 = 0 ; - int res1 = SWIG_OLDOBJ ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - EngineHash *result = 0 ; + ConfigHash *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< std::string,std::allocator< std::string > > result; (void)self; - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConfigHashSwig_getIndexedProperties" "', argument " "1"" of type '" "ConfigHash *""'"); + } + arg1 = reinterpret_cast< ConfigHash * >(argp1); { - std::string *ptr = (std::string *)0; - res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EngineHashSwig" "', argument " "1"" of type '" "std::string const &""'"); + try { + result = (arg1)->getIndexedProperties();; } - if (!ptr) { - SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "new_EngineHashSwig" "', argument " "1"" of type '" "std::string const &""'"); + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); } - arg1 = ptr; - } - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ConfigHash, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_EngineHashSwig" "', argument " "2"" of type '" "ConfigHash *""'"); - } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = swig::from(static_cast< std::vector< std::string,std::allocator< std::string > > >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_ConfigHashSwig(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ConfigHash *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ConfigHash, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ConfigHashSwig" "', argument " "1"" of type '" "ConfigHash *""'"); + } + arg1 = reinterpret_cast< ConfigHash * >(argp1); + { + try { + delete arg1;; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *ConfigHashSwig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj = NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ConfigHash, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *ConfigHashSwig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_iterator(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + PyObject **arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + swig::SwigPyIterator *result = 0 ; + + arg2 = &swig_obj[0]; + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_iterator" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (swig::SwigPyIterator *)std_vector_Sl_uint32_t_Sg__iterator(arg1,arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + if (!result) SWIG_fail; + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___nonzero__(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___nonzero__" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (bool)std_vector_Sl_uint32_t_Sg____nonzero__((std::vector< unsigned int > const *)arg1);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___bool__(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___bool__" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (bool)std_vector_Sl_uint32_t_Sg____bool__((std::vector< unsigned int > const *)arg1);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___len__(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::size_type result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___len__" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = std_vector_Sl_uint32_t_Sg____len__((std::vector< unsigned int > const *)arg1);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___getslice__(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + std::vector< unsigned int >::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + std::vector< unsigned int,std::allocator< unsigned int > > *result = 0 ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___getslice__", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___getslice__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___getslice__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig___getslice__" "', argument " "3"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg3 = static_cast< std::vector< unsigned int >::difference_type >(val3); + { + try { + try { + result = (std::vector< unsigned int,std::allocator< unsigned int > > *)std_vector_Sl_uint32_t_Sg____getslice__(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setslice____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + std::vector< unsigned int >::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___setslice__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___setslice__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig___setslice__" "', argument " "3"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg3 = static_cast< std::vector< unsigned int >::difference_type >(val3); + { + try { + try { + std_vector_Sl_uint32_t_Sg____setslice____SWIG_0(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setslice____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + std::vector< unsigned int >::difference_type arg3 ; + std::vector< unsigned int,std::allocator< unsigned int > > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + + (void)self; + if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___setslice__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___setslice__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig___setslice__" "', argument " "3"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg3 = static_cast< std::vector< unsigned int >::difference_type >(val3); + { + std::vector< unsigned int,std::allocator< unsigned int > > *ptr = (std::vector< unsigned int,std::allocator< unsigned int > > *)0; + res4 = swig::asptr(swig_obj[3], &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorUInt32Swig___setslice__" "', argument " "4"" of type '" "std::vector< unsigned int,std::allocator< unsigned int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "VectorUInt32Swig___setslice__" "', argument " "4"" of type '" "std::vector< unsigned int,std::allocator< unsigned int > > const &""'"); + } + arg4 = ptr; + } + { + try { + try { + std_vector_Sl_uint32_t_Sg____setslice____SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(std::vector< unsigned int,std::allocator< unsigned int > > const &)*arg4); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setslice__(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[5] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___setslice__", 0, 4, argv))) SWIG_fail; + --argc; + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig___setslice____SWIG_0(self, argc, argv); + } + } + } + } + if (argc == 4) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + int res = swig::asptr(argv[3], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorUInt32Swig___setslice____SWIG_1(self, argc, argv); + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig___setslice__'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::__setslice__(std::vector< unsigned int >::difference_type,std::vector< unsigned int >::difference_type)\n" + " std::vector< uint32_t >::__setslice__(std::vector< unsigned int >::difference_type,std::vector< unsigned int >::difference_type,std::vector< unsigned int,std::allocator< unsigned int > > const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___delslice__(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + std::vector< unsigned int >::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___delslice__", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___delslice__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___delslice__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig___delslice__" "', argument " "3"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg3 = static_cast< std::vector< unsigned int >::difference_type >(val3); + { + try { + try { + std_vector_Sl_uint32_t_Sg____delslice__(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___delitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___delitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___delitem__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + { + try { + try { + std_vector_Sl_uint32_t_Sg____delitem____SWIG_0(arg1,SWIG_STD_MOVE(arg2)); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___getitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SWIGPY_SLICEOBJECT *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector< unsigned int,std::allocator< unsigned int > > *result = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___getitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + if (!PySlice_Check(swig_obj[1])) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig___getitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); + } + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; + } + { + try { + try { + result = (std::vector< unsigned int,std::allocator< unsigned int > > *)std_vector_Sl_uint32_t_Sg____getitem____SWIG_0(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SWIGPY_SLICEOBJECT *arg2 = 0 ; + std::vector< unsigned int,std::allocator< unsigned int > > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 = SWIG_OLDOBJ ; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___setitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + if (!PySlice_Check(swig_obj[1])) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig___setitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); + } + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; + } + { + std::vector< unsigned int,std::allocator< unsigned int > > *ptr = (std::vector< unsigned int,std::allocator< unsigned int > > *)0; + res3 = swig::asptr(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorUInt32Swig___setitem__" "', argument " "3"" of type '" "std::vector< unsigned int,std::allocator< unsigned int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "VectorUInt32Swig___setitem__" "', argument " "3"" of type '" "std::vector< unsigned int,std::allocator< unsigned int > > const &""'"); + } + arg3 = ptr; + } + { + try { + try { + std_vector_Sl_uint32_t_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< unsigned int,std::allocator< unsigned int > > const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SWIGPY_SLICEOBJECT *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___setitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + if (!PySlice_Check(swig_obj[1])) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig___setitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); + } + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; + } + { + try { + try { + std_vector_Sl_uint32_t_Sg____setitem____SWIG_1(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___delitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SWIGPY_SLICEOBJECT *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___delitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + if (!PySlice_Check(swig_obj[1])) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig___delitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); + } + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; + } + { + try { + try { + std_vector_Sl_uint32_t_Sg____delitem____SWIG_1(arg1,arg2); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___delitem__(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___delitem__", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_VectorUInt32Swig___delitem____SWIG_1(self, argc, argv); + } + } + } + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig___delitem____SWIG_0(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig___delitem__'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::__delitem__(std::vector< unsigned int >::difference_type)\n" + " std::vector< uint32_t >::__delitem__(SWIGPY_SLICEOBJECT *)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___getitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + std::vector< unsigned int >::value_type *result = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___getitem__" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___getitem__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + { + try { + try { + result = (std::vector< unsigned int >::value_type *) &std_vector_Sl_uint32_t_Sg____getitem____SWIG_1((std::vector< unsigned int > const *)arg1,SWIG_STD_MOVE(arg2)); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(*result)); + if (!swig::container_owner::value_type>::category>::back_reference(resultobj, swig_obj[0]) && PyErr_Occurred()) { + SWIG_fail; + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___getitem__(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___getitem__", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_VectorUInt32Swig___getitem____SWIG_0(self, argc, argv); + } + } + } + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig___getitem____SWIG_1(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig___getitem__'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::__getitem__(SWIGPY_SLICEOBJECT *)\n" + " std::vector< uint32_t >::__getitem__(std::vector< unsigned int >::difference_type) const\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setitem____SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::difference_type arg2 ; + std::vector< unsigned int >::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + std::vector< unsigned int >::value_type temp3 ; + unsigned int val3 ; + int ecode3 = 0 ; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig___setitem__" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig___setitem__" "', argument " "2"" of type '" "std::vector< unsigned int >::difference_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::difference_type >(val2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig___setitem__" "', argument " "3"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp3 = static_cast< std::vector< unsigned int >::value_type >(val3); + arg3 = &temp3; + { + try { + try { + std_vector_Sl_uint32_t_Sg____setitem____SWIG_2(arg1,SWIG_STD_MOVE(arg2),(unsigned int const &)*arg3); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig___setitem__(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig___setitem__", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_VectorUInt32Swig___setitem____SWIG_1(self, argc, argv); + } + } + } + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + int res = swig::asptr(argv[2], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorUInt32Swig___setitem____SWIG_0(self, argc, argv); + } + } + } + } + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig___setitem____SWIG_2(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig___setitem__'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::__setitem__(SWIGPY_SLICEOBJECT *,std::vector< unsigned int,std::allocator< unsigned int > > const &)\n" + " std::vector< uint32_t >::__setitem__(SWIGPY_SLICEOBJECT *)\n" + " std::vector< uint32_t >::__setitem__(std::vector< unsigned int >::difference_type,std::vector< unsigned int >::value_type const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_pop(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::value_type result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_pop" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + try { + result = (std::vector< unsigned int >::value_type)std_vector_Sl_uint32_t_Sg__pop(arg1); + } catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + }; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_append(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector< unsigned int >::value_type temp2 ; + unsigned int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_append", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_append" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_append" "', argument " "2"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp2 = static_cast< std::vector< unsigned int >::value_type >(val2); + arg2 = &temp2; + { + try { + std_vector_Sl_uint32_t_Sg__append(arg1,(unsigned int const &)*arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorUInt32Swig__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { + PyObject *resultobj = 0; + std::vector< uint32_t > *result = 0 ; + + (void)self; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; + { + try { + result = (std::vector< uint32_t > *)new std::vector< uint32_t >();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorUInt32Swig__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + std::vector< uint32_t > *result = 0 ; + + (void)self; + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + { + std::vector< unsigned int,std::allocator< unsigned int > > *ptr = (std::vector< unsigned int,std::allocator< unsigned int > > *)0; + res1 = swig::asptr(swig_obj[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorUInt32Swig" "', argument " "1"" of type '" "std::vector< uint32_t > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "new_VectorUInt32Swig" "', argument " "1"" of type '" "std::vector< uint32_t > const &""'"); + } + arg1 = ptr; + } + { + try { + result = (std::vector< uint32_t > *)new std::vector< uint32_t >((std::vector< uint32_t > const &)*arg1);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_empty(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_empty" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (bool)((std::vector< uint32_t > const *)arg1)->empty();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_size(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::size_type result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_size" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = ((std::vector< uint32_t > const *)arg1)->size();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_swap(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< uint32_t > *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_swap", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_swap" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__vectorT_uint32_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorUInt32Swig_swap" "', argument " "2"" of type '" "std::vector< uint32_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "VectorUInt32Swig_swap" "', argument " "2"" of type '" "std::vector< uint32_t > &""'"); + } + arg2 = reinterpret_cast< std::vector< uint32_t > * >(argp2); + { + try { + (arg1)->swap(*arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_begin(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::vector< unsigned int >::iterator > result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_begin" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (arg1)->begin();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_end(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::vector< unsigned int >::iterator > result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_end" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (arg1)->end();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_rbegin(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::vector< unsigned int >::reverse_iterator > result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_rbegin" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (arg1)->rbegin();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::reverse_iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_rend(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::vector< unsigned int >::reverse_iterator > result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_rend" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (arg1)->rend();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::reverse_iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_clear(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_clear" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + (arg1)->clear();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_get_allocator(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< std::allocator< unsigned int > > result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_get_allocator" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = ((std::vector< uint32_t > const *)arg1)->get_allocator();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj((new std::vector< unsigned int >::allocator_type(result)), SWIGTYPE_p_std__allocatorT_unsigned_int_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorUInt32Swig__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< unsigned int >::size_type arg1 ; + size_t val1 ; + int ecode1 = 0 ; + std::vector< uint32_t > *result = 0 ; + + (void)self; + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorUInt32Swig" "', argument " "1"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg1 = static_cast< std::vector< unsigned int >::size_type >(val1); + { + try { + result = (std::vector< uint32_t > *)new std::vector< uint32_t >(SWIG_STD_MOVE(arg1));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_pop_back(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_pop_back" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + (arg1)->pop_back();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_resize__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_resize" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_resize" "', argument " "2"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::size_type >(val2); + { + try { + (arg1)->resize(SWIG_STD_MOVE(arg2));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_erase__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; + int res2 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > result; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_erase" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } else { + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } + } + { + try { + result = std_vector_Sl_uint32_t_Sg__erase__SWIG_0(arg1,SWIG_STD_MOVE(arg2));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_erase__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > arg2 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; + int res2 ; + swig::SwigPyIterator *iter3 = 0 ; + int res3 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > result; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_erase" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } else { + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(swig_obj[2], SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "3"" of type '" "std::vector< unsigned int >::iterator""'"); + } else { + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_erase" "', argument " "3"" of type '" "std::vector< unsigned int >::iterator""'"); + } + } + { + try { + result = std_vector_Sl_uint32_t_Sg__erase__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_erase(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_erase", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorUInt32Swig_erase__SWIG_0(self, argc, argv); + } + } + } + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorUInt32Swig_erase__SWIG_1(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig_erase'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::erase(std::vector< unsigned int >::iterator)\n" + " std::vector< uint32_t >::erase(std::vector< unsigned int >::iterator,std::vector< unsigned int >::iterator)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_new_VectorUInt32Swig__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< unsigned int >::size_type arg1 ; + std::vector< unsigned int >::value_type *arg2 = 0 ; + size_t val1 ; + int ecode1 = 0 ; + std::vector< unsigned int >::value_type temp2 ; + unsigned int val2 ; + int ecode2 = 0 ; + std::vector< uint32_t > *result = 0 ; + + (void)self; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorUInt32Swig" "', argument " "1"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg1 = static_cast< std::vector< unsigned int >::size_type >(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_VectorUInt32Swig" "', argument " "2"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp2 = static_cast< std::vector< unsigned int >::value_type >(val2); + arg2 = &temp2; + { + try { + result = (std::vector< uint32_t > *)new std::vector< uint32_t >(SWIG_STD_MOVE(arg1),(std::vector< unsigned int >::value_type const &)*arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorUInt32Swig(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_VectorUInt32Swig", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_new_VectorUInt32Swig__SWIG_0(self, argc, argv); + } + if (argc == 1) { + int _v = 0; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorUInt32Swig__SWIG_2(self, argc, argv); + } + } + if (argc == 1) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorUInt32Swig__SWIG_1(self, argc, argv); + } + } + if (argc == 2) { + int _v = 0; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorUInt32Swig__SWIG_3(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_VectorUInt32Swig'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::vector()\n" + " std::vector< uint32_t >::vector(std::vector< uint32_t > const &)\n" + " std::vector< uint32_t >::vector(std::vector< unsigned int >::size_type)\n" + " std::vector< uint32_t >::vector(std::vector< unsigned int >::size_type,std::vector< unsigned int >::value_type const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_push_back(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector< unsigned int >::value_type temp2 ; + unsigned int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_push_back", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_push_back" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_push_back" "', argument " "2"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp2 = static_cast< std::vector< unsigned int >::value_type >(val2); + arg2 = &temp2; + { + try { + (arg1)->push_back((std::vector< unsigned int >::value_type const &)*arg2);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_front(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::value_type *result = 0 ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_front" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (std::vector< unsigned int >::value_type *) &((std::vector< uint32_t > const *)arg1)->front();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(*result)); + if (!swig::container_owner::value_type>::category>::back_reference(resultobj, swig_obj[0]) && PyErr_Occurred()) { + SWIG_fail; + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_back(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::value_type *result = 0 ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_back" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = (std::vector< unsigned int >::value_type *) &((std::vector< uint32_t > const *)arg1)->back();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(*result)); + if (!swig::container_owner::value_type>::category>::back_reference(resultobj, swig_obj[0]) && PyErr_Occurred()) { + SWIG_fail; + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_assign(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::size_type arg2 ; + std::vector< unsigned int >::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector< unsigned int >::value_type temp3 ; + unsigned int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_assign", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_assign" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_assign" "', argument " "2"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::size_type >(val2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig_assign" "', argument " "3"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp3 = static_cast< std::vector< unsigned int >::value_type >(val3); + arg3 = &temp3; + { + try { + (arg1)->assign(SWIG_STD_MOVE(arg2),(std::vector< unsigned int >::value_type const &)*arg3);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_resize__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::size_type arg2 ; + std::vector< unsigned int >::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector< unsigned int >::value_type temp3 ; + unsigned int val3 ; + int ecode3 = 0 ; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_resize" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_resize" "', argument " "2"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::size_type >(val2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig_resize" "', argument " "3"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp3 = static_cast< std::vector< unsigned int >::value_type >(val3); + arg3 = &temp3; + { + try { + (arg1)->resize(SWIG_STD_MOVE(arg2),(std::vector< unsigned int >::value_type const &)*arg3);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_resize(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_resize", 0, 3, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig_resize__SWIG_0(self, argc, argv); + } + } + } + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig_resize__SWIG_1(self, argc, argv); + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig_resize'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::resize(std::vector< unsigned int >::size_type)\n" + " std::vector< uint32_t >::resize(std::vector< unsigned int >::size_type,std::vector< unsigned int >::value_type const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_insert__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > arg2 ; + std::vector< unsigned int >::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; + int res2 ; + std::vector< unsigned int >::value_type temp3 ; + unsigned int val3 ; + int ecode3 = 0 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > result; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_insert" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_insert" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } else { + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_insert" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } + } + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig_insert" "', argument " "3"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp3 = static_cast< std::vector< unsigned int >::value_type >(val3); + arg3 = &temp3; + { + try { + result = std_vector_Sl_uint32_t_Sg__insert__SWIG_0(arg1,SWIG_STD_MOVE(arg2),(unsigned int const &)*arg3);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< unsigned int >::iterator & >(result)), + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_insert__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + SwigValueWrapper< std::vector< unsigned int >::iterator > arg2 ; + std::vector< unsigned int >::size_type arg3 ; + std::vector< unsigned int >::value_type *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + std::vector< unsigned int >::value_type temp4 ; + unsigned int val4 ; + int ecode4 = 0 ; + + (void)self; + if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_insert" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_insert" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } else { + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorUInt32Swig_insert" "', argument " "2"" of type '" "std::vector< unsigned int >::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorUInt32Swig_insert" "', argument " "3"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg3 = static_cast< std::vector< unsigned int >::size_type >(val3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorUInt32Swig_insert" "', argument " "4"" of type '" "std::vector< unsigned int >::value_type""'"); + } + temp4 = static_cast< std::vector< unsigned int >::value_type >(val4); + arg4 = &temp4; + { + try { + std_vector_Sl_uint32_t_Sg__insert__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(unsigned int const &)*arg4);; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_insert(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[5] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_insert", 0, 4, argv))) SWIG_fail; + --argc; + if (argc == 3) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig_insert__SWIG_0(self, argc, argv); + } + } + } + } + if (argc == 4) { + int _v = 0; + int res = swig::asptr(argv[0], (std::vector< unsigned int,std::allocator< unsigned int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorUInt32Swig_insert__SWIG_1(self, argc, argv); + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'VectorUInt32Swig_insert'.\n" + " Possible C/C++ prototypes are:\n" + " std::vector< uint32_t >::insert(std::vector< unsigned int >::iterator,std::vector< unsigned int >::value_type const &)\n" + " std::vector< uint32_t >::insert(std::vector< unsigned int >::iterator,std::vector< unsigned int >::size_type,std::vector< unsigned int >::value_type const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_reserve(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + std::vector< unsigned int >::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + (void)self; + if (!SWIG_Python_UnpackTuple(args, "VectorUInt32Swig_reserve", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_reserve" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorUInt32Swig_reserve" "', argument " "2"" of type '" "std::vector< unsigned int >::size_type""'"); + } + arg2 = static_cast< std::vector< unsigned int >::size_type >(val2); + { + try { + (arg1)->reserve(SWIG_STD_MOVE(arg2));; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorUInt32Swig_capacity(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::vector< unsigned int >::size_type result; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorUInt32Swig_capacity" "', argument " "1"" of type '" "std::vector< uint32_t > const *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + result = ((std::vector< uint32_t > const *)arg1)->capacity();; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorUInt32Swig(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::vector< uint32_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorUInt32Swig" "', argument " "1"" of type '" "std::vector< uint32_t > *""'"); + } + arg1 = reinterpret_cast< std::vector< uint32_t > * >(argp1); + { + try { + delete arg1;; + } + catch(FatalException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NotImplementedException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(InvalidPropertyException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(EvidenceException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(TooManyValuesException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(NoValuesAvailableException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(StatusCodeException& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorUInt32Swig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj = NULL; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_uint32_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *VectorUInt32Swig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_new_EngineHashSwig__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; + ConfigHash *arg2 = 0 ; + RequiredPropertiesConfig *arg3 = 0 ; + int res1 = SWIG_OLDOBJ ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + EngineHash *result = 0 ; + + (void)self; + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EngineHashSwig" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "new_EngineHashSwig" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ConfigHash, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_EngineHashSwig" "', argument " "2"" of type '" "ConfigHash *""'"); + } arg2 = reinterpret_cast< ConfigHash * >(argp2); res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_RequiredPropertiesConfig, 0 | 0 ); if (!SWIG_IsOK(res3)) { @@ -27030,125 +30626,95 @@ SWIGINTERN PyObject *_wrap_EngineHashSwig_process__SWIG_1(PyObject *self, Py_ssi } -SWIGINTERN PyObject *_wrap_EngineHashSwig_process__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - EngineHash *arg1 = 0 ; - EvidenceDeviceDetection *arg2 = 0 ; - int *arg3 = 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - ResultsHash *result = 0 ; +SWIGINTERN PyObject *_wrap_EngineHashSwig_process(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; - (void)self; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EngineHash, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineHashSwig_process" "', argument " "1"" of type '" "EngineHash *""'"); - } - arg1 = reinterpret_cast< EngineHash * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EvidenceDeviceDetection, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineHashSwig_process" "', argument " "2"" of type '" "EvidenceDeviceDetection *""'"); - } - arg2 = reinterpret_cast< EvidenceDeviceDetection * >(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EngineHashSwig_process" "', argument " "3"" of type '" "int const *""'"); - } - arg3 = reinterpret_cast< int * >(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EngineHashSwig_process" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - try { - result = (ResultsHash *)(arg1)->process(arg2,(int const *)arg3,arg4);; - } - catch(FatalException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NotImplementedException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(InvalidPropertyException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(EvidenceException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(TooManyValuesException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NoValuesAvailableException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(StatusCodeException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(runtime_error& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); + if (!(argc = SWIG_Python_UnpackTuple(args, "EngineHashSwig_process", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v = 0; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EvidenceDeviceDetection, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EngineHashSwig_process__SWIG_0(self, argc, argv); + } } - catch(invalid_argument& e) { - SWIG_exception(SWIG_ValueError, e.what()); + } + if (argc == 2) { + int _v = 0; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EngineHashSwig_process__SWIG_1(self, argc, argv); + } } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ResultsHash, SWIG_POINTER_OWN | 0 ); - return resultobj; + fail: - return NULL; + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'EngineHashSwig_process'.\n" + " Possible C/C++ prototypes are:\n" + " EngineHash::process(EvidenceDeviceDetection *)\n" + " EngineHash::process(char const *)\n"); + return 0; } -SWIGINTERN PyObject *_wrap_EngineHashSwig_process__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_EngineHashSwig_getProfileIdsForPropertyValue(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EngineHash *arg1 = 0 ; - char *arg2 = 0 ; - int *arg3 = 0 ; - int arg4 ; + std::string *arg2 = 0 ; + std::string *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - ResultsHash *result = 0 ; + int res2 = SWIG_OLDOBJ ; + int res3 = SWIG_OLDOBJ ; + PyObject *swig_obj[3] ; + std::vector< uint32_t,std::allocator< uint32_t > > result; (void)self; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "EngineHashSwig_getProfileIdsForPropertyValue", 3, 3, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EngineHash, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineHashSwig_process" "', argument " "1"" of type '" "EngineHash *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineHashSwig_getProfileIdsForPropertyValue" "', argument " "1"" of type '" "EngineHash *""'"); } arg1 = reinterpret_cast< EngineHash * >(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineHashSwig_process" "', argument " "2"" of type '" "char const *""'"); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineHashSwig_getProfileIdsForPropertyValue" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "EngineHashSwig_getProfileIdsForPropertyValue" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EngineHashSwig_process" "', argument " "3"" of type '" "int const *""'"); + { + std::string *ptr = (std::string *)0; + res3 = SWIG_AsPtr_std_string(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EngineHashSwig_getProfileIdsForPropertyValue" "', argument " "3"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_NullReferenceError, "invalid null reference " "in method '" "EngineHashSwig_getProfileIdsForPropertyValue" "', argument " "3"" of type '" "std::string const &""'"); + } + arg3 = ptr; } - arg3 = reinterpret_cast< int * >(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EngineHashSwig_process" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); { try { - result = (ResultsHash *)(arg1)->process((char const *)arg2,(int const *)arg3,arg4);; + result = (arg1)->getProfileIdsForPropertyValue((std::string const &)*arg2,(std::string const &)*arg3);; } catch(FatalException& e) { SWIG_exception(SWIG_RuntimeError, e.what()); @@ -27178,111 +30744,17 @@ SWIGINTERN PyObject *_wrap_EngineHashSwig_process__SWIG_3(PyObject *self, Py_ssi SWIG_exception(SWIG_ValueError, e.what()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ResultsHash, SWIG_POINTER_OWN | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + resultobj = swig::from(static_cast< std::vector< unsigned int,std::allocator< unsigned int > > >(result)); + if (SWIG_IsNewObj(res2)) delete arg2; + if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (SWIG_IsNewObj(res2)) delete arg2; + if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } -SWIGINTERN PyObject *_wrap_EngineHashSwig_process(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "EngineHashSwig_process", 0, 4, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EvidenceDeviceDetection, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_EngineHashSwig_process__SWIG_0(self, argc, argv); - } - } - } - if (argc == 2) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_EngineHashSwig_process__SWIG_1(self, argc, argv); - } - } - } - if (argc == 4) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EvidenceDeviceDetection, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_EngineHashSwig_process__SWIG_2(self, argc, argv); - } - } - } - } - } - if (argc == 4) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineHash, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_EngineHashSwig_process__SWIG_3(self, argc, argv); - } - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'EngineHashSwig_process'.\n" - " Possible C/C++ prototypes are:\n" - " EngineHash::process(EvidenceDeviceDetection *)\n" - " EngineHash::process(char const *)\n" - " EngineHash::process(EvidenceDeviceDetection *,int const *,int)\n" - " EngineHash::process(char const *,int const *,int)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_EngineHashSwig_processBase(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EngineHash *arg1 = 0 ; @@ -28577,6 +32049,8 @@ static PyMethodDef SwigMethods[] = { { "ConfigHashSwig_setUsePerformanceGraph", _wrap_ConfigHashSwig_setUsePerformanceGraph, METH_VARARGS, NULL}, { "ConfigHashSwig_setUsePredictiveGraph", _wrap_ConfigHashSwig_setUsePredictiveGraph, METH_VARARGS, NULL}, { "ConfigHashSwig_setTraceRoute", _wrap_ConfigHashSwig_setTraceRoute, METH_VARARGS, NULL}, + { "ConfigHashSwig_setPropertyValueIndex", _wrap_ConfigHashSwig_setPropertyValueIndex, METH_VARARGS, NULL}, + { "ConfigHashSwig_setIndexedProperties", _wrap_ConfigHashSwig_setIndexedProperties, METH_VARARGS, NULL}, { "ConfigHashSwig_getStrings", _wrap_ConfigHashSwig_getStrings, METH_O, NULL}, { "ConfigHashSwig_getProperties", _wrap_ConfigHashSwig_getProperties, METH_O, NULL}, { "ConfigHashSwig_getValues", _wrap_ConfigHashSwig_getValues, METH_O, NULL}, @@ -28589,9 +32063,46 @@ static PyMethodDef SwigMethods[] = { { "ConfigHashSwig_getUsePredictiveGraph", _wrap_ConfigHashSwig_getUsePredictiveGraph, METH_O, NULL}, { "ConfigHashSwig_getConcurrency", _wrap_ConfigHashSwig_getConcurrency, METH_O, NULL}, { "ConfigHashSwig_getTraceRoute", _wrap_ConfigHashSwig_getTraceRoute, METH_O, NULL}, + { "ConfigHashSwig_getPropertyValueIndex", _wrap_ConfigHashSwig_getPropertyValueIndex, METH_O, NULL}, + { "ConfigHashSwig_getIndexedProperties", _wrap_ConfigHashSwig_getIndexedProperties, METH_O, NULL}, { "delete_ConfigHashSwig", _wrap_delete_ConfigHashSwig, METH_O, NULL}, { "ConfigHashSwig_swigregister", ConfigHashSwig_swigregister, METH_O, NULL}, { "ConfigHashSwig_swiginit", ConfigHashSwig_swiginit, METH_VARARGS, NULL}, + { "VectorUInt32Swig_iterator", _wrap_VectorUInt32Swig_iterator, METH_O, NULL}, + { "VectorUInt32Swig___nonzero__", _wrap_VectorUInt32Swig___nonzero__, METH_O, NULL}, + { "VectorUInt32Swig___bool__", _wrap_VectorUInt32Swig___bool__, METH_O, NULL}, + { "VectorUInt32Swig___len__", _wrap_VectorUInt32Swig___len__, METH_O, NULL}, + { "VectorUInt32Swig___getslice__", _wrap_VectorUInt32Swig___getslice__, METH_VARARGS, NULL}, + { "VectorUInt32Swig___setslice__", _wrap_VectorUInt32Swig___setslice__, METH_VARARGS, NULL}, + { "VectorUInt32Swig___delslice__", _wrap_VectorUInt32Swig___delslice__, METH_VARARGS, NULL}, + { "VectorUInt32Swig___delitem__", _wrap_VectorUInt32Swig___delitem__, METH_VARARGS, NULL}, + { "VectorUInt32Swig___getitem__", _wrap_VectorUInt32Swig___getitem__, METH_VARARGS, NULL}, + { "VectorUInt32Swig___setitem__", _wrap_VectorUInt32Swig___setitem__, METH_VARARGS, NULL}, + { "VectorUInt32Swig_pop", _wrap_VectorUInt32Swig_pop, METH_O, NULL}, + { "VectorUInt32Swig_append", _wrap_VectorUInt32Swig_append, METH_VARARGS, NULL}, + { "VectorUInt32Swig_empty", _wrap_VectorUInt32Swig_empty, METH_O, NULL}, + { "VectorUInt32Swig_size", _wrap_VectorUInt32Swig_size, METH_O, NULL}, + { "VectorUInt32Swig_swap", _wrap_VectorUInt32Swig_swap, METH_VARARGS, NULL}, + { "VectorUInt32Swig_begin", _wrap_VectorUInt32Swig_begin, METH_O, NULL}, + { "VectorUInt32Swig_end", _wrap_VectorUInt32Swig_end, METH_O, NULL}, + { "VectorUInt32Swig_rbegin", _wrap_VectorUInt32Swig_rbegin, METH_O, NULL}, + { "VectorUInt32Swig_rend", _wrap_VectorUInt32Swig_rend, METH_O, NULL}, + { "VectorUInt32Swig_clear", _wrap_VectorUInt32Swig_clear, METH_O, NULL}, + { "VectorUInt32Swig_get_allocator", _wrap_VectorUInt32Swig_get_allocator, METH_O, NULL}, + { "VectorUInt32Swig_pop_back", _wrap_VectorUInt32Swig_pop_back, METH_O, NULL}, + { "VectorUInt32Swig_erase", _wrap_VectorUInt32Swig_erase, METH_VARARGS, NULL}, + { "new_VectorUInt32Swig", _wrap_new_VectorUInt32Swig, METH_VARARGS, NULL}, + { "VectorUInt32Swig_push_back", _wrap_VectorUInt32Swig_push_back, METH_VARARGS, NULL}, + { "VectorUInt32Swig_front", _wrap_VectorUInt32Swig_front, METH_O, NULL}, + { "VectorUInt32Swig_back", _wrap_VectorUInt32Swig_back, METH_O, NULL}, + { "VectorUInt32Swig_assign", _wrap_VectorUInt32Swig_assign, METH_VARARGS, NULL}, + { "VectorUInt32Swig_resize", _wrap_VectorUInt32Swig_resize, METH_VARARGS, NULL}, + { "VectorUInt32Swig_insert", _wrap_VectorUInt32Swig_insert, METH_VARARGS, NULL}, + { "VectorUInt32Swig_reserve", _wrap_VectorUInt32Swig_reserve, METH_VARARGS, NULL}, + { "VectorUInt32Swig_capacity", _wrap_VectorUInt32Swig_capacity, METH_O, NULL}, + { "delete_VectorUInt32Swig", _wrap_delete_VectorUInt32Swig, METH_O, NULL}, + { "VectorUInt32Swig_swigregister", VectorUInt32Swig_swigregister, METH_O, NULL}, + { "VectorUInt32Swig_swiginit", VectorUInt32Swig_swiginit, METH_VARARGS, NULL}, { "new_EngineHashSwig", _wrap_new_EngineHashSwig, METH_VARARGS, NULL}, { "EngineHashSwig_getPublishedTime", _wrap_EngineHashSwig_getPublishedTime, METH_O, NULL}, { "EngineHashSwig_getUpdateAvailableTime", _wrap_EngineHashSwig_getUpdateAvailableTime, METH_O, NULL}, @@ -28601,6 +32112,7 @@ static PyMethodDef SwigMethods[] = { { "EngineHashSwig_refreshDataFromFile", _wrap_EngineHashSwig_refreshDataFromFile, METH_VARARGS, NULL}, { "EngineHashSwig_refreshDataFromMemory", _wrap_EngineHashSwig_refreshDataFromMemory, METH_VARARGS, NULL}, { "EngineHashSwig_process", _wrap_EngineHashSwig_process, METH_VARARGS, NULL}, + { "EngineHashSwig_getProfileIdsForPropertyValue", _wrap_EngineHashSwig_getProfileIdsForPropertyValue, METH_VARARGS, NULL}, { "EngineHashSwig_processBase", _wrap_EngineHashSwig_processBase, METH_VARARGS, NULL}, { "EngineHashSwig_processDeviceDetection", _wrap_EngineHashSwig_processDeviceDetection, METH_VARARGS, NULL}, { "delete_EngineHashSwig", _wrap_delete_EngineHashSwig, METH_O, NULL}, @@ -28706,10 +32218,12 @@ static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0 static swig_type_info _swigt__p_std__allocatorT_std__pairT_std__string_const_std__string_t_t = {"_p_std__allocatorT_std__pairT_std__string_const_std__string_t_t", "std::map< std::string,std::string >::allocator_type *|std::allocator< std::pair< std::string const,std::string > > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__allocatorT_std__string_t = {"_p_std__allocatorT_std__string_t", "std::vector< std::string >::allocator_type *|std::allocator< std::string > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__allocatorT_unsigned_char_t = {"_p_std__allocatorT_unsigned_char_t", "std::vector< unsigned char >::allocator_type *|std::allocator< unsigned char > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__allocatorT_unsigned_int_t = {"_p_std__allocatorT_unsigned_int_t", "std::vector< unsigned int >::allocator_type *|std::allocator< unsigned int > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__lessT_std__string_t = {"_p_std__lessT_std__string_t", "std::less< std::string > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__mapT_std__string_std__string_t = {"_p_std__mapT_std__string_std__string_t", "std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > *|std::map< std::string,std::string > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT_std__string_t = {"_p_std__vectorT_std__string_t", "std::vector< std::string,std::allocator< std::string > > *|std::vector< std::string > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_uint32_t_t = {"_p_std__vectorT_uint32_t_t", "std::vector< uint32_t > *|std::vector< unsigned int,std::allocator< unsigned int > > *|std::vector< unsigned int > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT_uint8_t_t = {"_p_std__vectorT_uint8_t_t", "std::vector< uint8_t > *|std::vector< unsigned char,std::allocator< unsigned char > > *|std::vector< unsigned char > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "uint8_t *|uint_fast8_t *|uint_least8_t *|unsigned char *", 0, 0, (void*)0, 0}; @@ -28765,10 +32279,12 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_std__allocatorT_std__pairT_std__string_const_std__string_t_t, &_swigt__p_std__allocatorT_std__string_t, &_swigt__p_std__allocatorT_unsigned_char_t, + &_swigt__p_std__allocatorT_unsigned_int_t, &_swigt__p_std__invalid_argument, &_swigt__p_std__lessT_std__string_t, &_swigt__p_std__mapT_std__string_std__string_t, &_swigt__p_std__vectorT_std__string_t, + &_swigt__p_std__vectorT_uint32_t_t, &_swigt__p_std__vectorT_uint8_t_t, &_swigt__p_swig__SwigPyIterator, &_swigt__p_unsigned_char, @@ -28824,10 +32340,12 @@ static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0} static swig_cast_info _swigc__p_std__allocatorT_std__pairT_std__string_const_std__string_t_t[] = { {&_swigt__p_std__allocatorT_std__pairT_std__string_const_std__string_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__allocatorT_std__string_t[] = { {&_swigt__p_std__allocatorT_std__string_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__allocatorT_unsigned_char_t[] = { {&_swigt__p_std__allocatorT_unsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__allocatorT_unsigned_int_t[] = { {&_swigt__p_std__allocatorT_unsigned_int_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__lessT_std__string_t[] = { {&_swigt__p_std__lessT_std__string_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__mapT_std__string_std__string_t[] = { {&_swigt__p_std__mapT_std__string_std__string_t, 0, 0, 0}, {&_swigt__p_EvidenceBase, _p_EvidenceBaseTo_p_std__mapT_std__string_std__string_t, 0, 0}, {&_swigt__p_EvidenceDeviceDetection, _p_EvidenceDeviceDetectionTo_p_std__mapT_std__string_std__string_t, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT_std__string_t[] = { {&_swigt__p_std__vectorT_std__string_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_uint32_t_t[] = { {&_swigt__p_std__vectorT_uint32_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT_uint8_t_t[] = { {&_swigt__p_std__vectorT_uint8_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -28883,10 +32401,12 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_std__allocatorT_std__pairT_std__string_const_std__string_t_t, _swigc__p_std__allocatorT_std__string_t, _swigc__p_std__allocatorT_unsigned_char_t, + _swigc__p_std__allocatorT_unsigned_int_t, _swigc__p_std__invalid_argument, _swigc__p_std__lessT_std__string_t, _swigc__p_std__mapT_std__string_std__string_t, _swigc__p_std__vectorT_std__string_t, + _swigc__p_std__vectorT_uint32_t_t, _swigc__p_std__vectorT_uint8_t_t, _swigc__p_swig__SwigPyIterator, _swigc__p_unsigned_char, diff --git a/ip-intelligence/fiftyone_ipintelligence_onpremise/src/fiftyone_ipintelligence_onpremise/ipi_python_wrap.cxx b/ip-intelligence/fiftyone_ipintelligence_onpremise/src/fiftyone_ipintelligence_onpremise/ipi_python_wrap.cxx index 61d05328..0d472453 100644 --- a/ip-intelligence/fiftyone_ipintelligence_onpremise/src/fiftyone_ipintelligence_onpremise/ipi_python_wrap.cxx +++ b/ip-intelligence/fiftyone_ipintelligence_onpremise/src/fiftyone_ipintelligence_onpremise/ipi_python_wrap.cxx @@ -47460,263 +47460,13 @@ SWIGINTERN PyObject *_wrap_EngineIpiSwig_process__SWIG_2(PyObject *self, Py_ssiz } -SWIGINTERN PyObject *_wrap_EngineIpiSwig_process__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - EngineIpi *arg1 = 0 ; - EvidenceIpi *arg2 = 0 ; - int *arg3 = 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - ResultsIpi *result = 0 ; - - (void)self; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EngineIpi, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineIpiSwig_process" "', argument " "1"" of type '" "EngineIpi *""'"); - } - arg1 = reinterpret_cast< EngineIpi * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EvidenceIpi, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineIpiSwig_process" "', argument " "2"" of type '" "EvidenceIpi *""'"); - } - arg2 = reinterpret_cast< EvidenceIpi * >(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EngineIpiSwig_process" "', argument " "3"" of type '" "int const *""'"); - } - arg3 = reinterpret_cast< int * >(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EngineIpiSwig_process" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - try { - result = (ResultsIpi *)(arg1)->process(arg2,(int const *)arg3,arg4);; - } - catch(FatalException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NotImplementedException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(InvalidPropertyException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(EvidenceException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(TooManyValuesException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NoValuesAvailableException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(StatusCodeException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(runtime_error& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(invalid_argument& e) { - SWIG_exception(SWIG_ValueError, e.what()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ResultsIpi, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_EngineIpiSwig_process__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - EngineIpi *arg1 = 0 ; - char *arg2 = 0 ; - int *arg3 = 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - ResultsIpi *result = 0 ; - - (void)self; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EngineIpi, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineIpiSwig_process" "', argument " "1"" of type '" "EngineIpi *""'"); - } - arg1 = reinterpret_cast< EngineIpi * >(argp1); - res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineIpiSwig_process" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EngineIpiSwig_process" "', argument " "3"" of type '" "int const *""'"); - } - arg3 = reinterpret_cast< int * >(argp3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EngineIpiSwig_process" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - try { - result = (ResultsIpi *)(arg1)->process((char const *)arg2,(int const *)arg3,arg4);; - } - catch(FatalException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NotImplementedException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(InvalidPropertyException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(EvidenceException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(TooManyValuesException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NoValuesAvailableException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(StatusCodeException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(runtime_error& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(invalid_argument& e) { - SWIG_exception(SWIG_ValueError, e.what()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ResultsIpi, SWIG_POINTER_OWN | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_EngineIpiSwig_process__SWIG_5(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - EngineIpi *arg1 = 0 ; - unsigned char *arg2 = (unsigned char *)0 ; - long arg3 ; - fiftyoneDegreesIpType arg4 ; - int *arg5 = 0 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int val6 ; - int ecode6 = 0 ; - ResultsIpi *result = 0 ; - - (void)self; - if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EngineIpi, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EngineIpiSwig_process" "', argument " "1"" of type '" "EngineIpi *""'"); - } - arg1 = reinterpret_cast< EngineIpi * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EngineIpiSwig_process" "', argument " "2"" of type '" "unsigned char []""'"); - } - arg2 = reinterpret_cast< unsigned char * >(argp2); - ecode3 = SWIG_AsVal_long(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "EngineIpiSwig_process" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EngineIpiSwig_process" "', argument " "4"" of type '" "fiftyoneDegreesIpType""'"); - } - arg4 = static_cast< fiftyoneDegreesIpType >(val4); - res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "EngineIpiSwig_process" "', argument " "5"" of type '" "int const *""'"); - } - arg5 = reinterpret_cast< int * >(argp5); - ecode6 = SWIG_AsVal_int(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "EngineIpiSwig_process" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - try { - result = (ResultsIpi *)(arg1)->process(arg2,arg3,arg4,(int const *)arg5,arg6);; - } - catch(FatalException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NotImplementedException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(InvalidPropertyException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(EvidenceException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(TooManyValuesException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(NoValuesAvailableException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(StatusCodeException& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(runtime_error& e) { - SWIG_exception(SWIG_RuntimeError, e.what()); - } - catch(invalid_argument& e) { - SWIG_exception(SWIG_ValueError, e.what()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ResultsIpi, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_EngineIpiSwig_process(PyObject *self, PyObject *args) { Py_ssize_t argc; - PyObject *argv[7] = { + PyObject *argv[5] = { 0 }; - if (!(argc = SWIG_Python_UnpackTuple(args, "EngineIpiSwig_process", 0, 6, argv))) SWIG_fail; + if (!(argc = SWIG_Python_UnpackTuple(args, "EngineIpiSwig_process", 0, 4, argv))) SWIG_fail; --argc; if (argc == 2) { int _v = 0; @@ -47771,102 +47521,13 @@ SWIGINTERN PyObject *_wrap_EngineIpiSwig_process(PyObject *self, PyObject *args) } } } - if (argc == 4) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineIpi, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EvidenceIpi, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_EngineIpiSwig_process__SWIG_3(self, argc, argv); - } - } - } - } - } - if (argc == 4) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineIpi, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_EngineIpiSwig_process__SWIG_4(self, argc, argv); - } - } - } - } - } - if (argc == 6) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EngineIpi, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_EngineIpiSwig_process__SWIG_5(self, argc, argv); - } - } - } - } - } - } - } fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'EngineIpiSwig_process'.\n" " Possible C/C++ prototypes are:\n" " EngineIpi::process(EvidenceIpi *)\n" " EngineIpi::process(char const *)\n" - " EngineIpi::process(unsigned char [],long,fiftyoneDegreesIpType)\n" - " EngineIpi::process(EvidenceIpi *,int const *,int)\n" - " EngineIpi::process(char const *,int const *,int)\n" - " EngineIpi::process(unsigned char [],long,fiftyoneDegreesIpType,int const *,int)\n"); + " EngineIpi::process(unsigned char [],long,fiftyoneDegreesIpType)\n"); return 0; } From 49cea61a5ed963f25ec792cffe93df28823eec68 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 04:15:41 +0000 Subject: [PATCH 4/6] Remove the temporary SWIG wrapper workflow --- .github/workflows/tmp-regen-swig.yml | 222 --------------------------- 1 file changed, 222 deletions(-) delete mode 100644 .github/workflows/tmp-regen-swig.yml diff --git a/.github/workflows/tmp-regen-swig.yml b/.github/workflows/tmp-regen-swig.yml deleted file mode 100644 index f399bcaa..00000000 --- a/.github/workflows/tmp-regen-swig.yml +++ /dev/null @@ -1,222 +0,0 @@ -name: Temporary SWIG wrapper generation - -# Temporary. Generates both SWIG wrappers for the move of cxx to 4.5.102, -# commits them to this branch, and is then deleted from the branch. - -on: - push: - branches: - - 'feature/cxx-4.5.102' - -permissions: - contents: write - -env: - SWIG_TAG: v4.4.1 - SWIG_COMMIT: c7b01379fa00ff152bc22d4dd0e0d5bb862282d9 - CXX_OLD: 4110d6813e167a803a06489318b33b83a230fa32 - CXX_NEW: 1bec7b570575e2e180b52435599bef9b03e35ad8 - DD: device-detection/fiftyone_devicedetection_onpremise - IPI: ip-intelligence/fiftyone_ipintelligence_onpremise - # The %module names in cxx's hash.i and ipi.i. - DD_MODULE: DeviceDetectionHashEngineModule - IPI_MODULE: IpIntelligenceEngineModule - -defaults: - run: - shell: bash - -jobs: - Generate: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Check out with submodules - uses: actions/checkout@v4 - with: - submodules: true - - - name: Check the starting point - run: | - set -euo pipefail - git log -1 --format='%H %s' - test "$(git -C cxx rev-parse HEAD)" = "$CXX_OLD" - - - name: Build SWIG from its tag - run: | - set -euo pipefail - sudo apt-get update - sudo apt-get install -y autoconf automake bison libpcre2-dev - git clone --depth 1 --branch "$SWIG_TAG" \ - https://github.com/swig/swig.git "$RUNNER_TEMP/swig-src" - test "$(git -C "$RUNNER_TEMP/swig-src" rev-parse HEAD)" = "$SWIG_COMMIT" - cd "$RUNNER_TEMP/swig-src" - ./autogen.sh - ./configure --prefix="$RUNNER_TEMP/swig" - make -j"$(nproc)" - make install - echo "SWIG_BIN=$RUNNER_TEMP/swig/bin/swig" >> "$GITHUB_ENV" - mkdir -p "$RUNNER_TEMP/artifact" - "$RUNNER_TEMP/swig/bin/swig" -version \ - | tee "$RUNNER_TEMP/artifact/swig-version.txt" - - - name: Write the generation script - run: | - set -euo pipefail - # generate - # - # Stages common and the product's folder of cxx/src beside the - # interface, as setup.py does, runs SWIG there and copies the - # wrapper and the Python module to . - cat > "$RUNNER_TEMP/generate.sh" <<'SCRIPT' - set -euo pipefail - src="$1/src/$(basename "$1")" - interface=$2 - wrapper=$3 - product=$4 - module=$5 - out=$6 - work="$RUNNER_TEMP/work-$(basename "$1")" - rm -rf "$work" - cp -R "$GITHUB_WORKSPACE/$src" "$work" - rm -rf "$work/cxx" - mkdir -p "$work/cxx/src" - cp -R "$GITHUB_WORKSPACE/cxx/src/common" "$work/cxx/src/common" - cp -R "$GITHUB_WORKSPACE/cxx/src/$product" "$work/cxx/src/$product" - cd "$work" - set -x - "$SWIG_BIN" -c++ -python -outdir . -o "$wrapper" "$interface" - set +x - mkdir -p "$out" - cp "$wrapper" "$module.py" "$out/" - echo "$module" > "$out/module.txt" - SCRIPT - chmod +x "$RUNNER_TEMP/generate.sh" - - - name: Generate at 4110d681 and compare with the committed files - id: old - run: | - set -euo pipefail - identical=true - for spec in "$DD hash_python.i hash_python_wrap.cxx dd $DD_MODULE" \ - "$IPI ipi_python.i ipi_python_wrap.cxx ipi $IPI_MODULE"; do - set -- $spec - out="$RUNNER_TEMP/artifact/old-$(basename "$1")" - bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$5" "$out" - module=$(cat "$out/module.txt") - src="$1/src/$(basename "$1")" - for f in "$3" "$module.py"; do - if cmp "$src/$f" "$out/$f"; then - echo "$f at 4110d681 is byte for byte the committed file." - else - identical=false - diff "$src/$f" "$out/$f" > "$out/$f.diff" || true - echo "$f at 4110d681 differs from the committed file:" - head -60 "$out/$f.diff" - fi - done - done - echo "identical=$identical" >> "$GITHUB_OUTPUT" - - - name: Move cxx to 1bec7b57 and generate in place - if: steps.old.outputs.identical == 'true' - run: | - set -euo pipefail - git -C cxx fetch --depth 1 origin "$CXX_NEW" - git -C cxx checkout --detach "$CXX_NEW" - test "$(git -C cxx rev-parse HEAD)" = "$CXX_NEW" - for spec in "$DD hash_python.i hash_python_wrap.cxx dd $DD_MODULE" \ - "$IPI ipi_python.i ipi_python_wrap.cxx ipi $IPI_MODULE"; do - set -- $spec - out="$RUNNER_TEMP/artifact/new-$(basename "$1")" - bash "$RUNNER_TEMP/generate.sh" "$1" "$2" "$3" "$4" "$5" "$out" - module=$(cat "$out/module.txt") - cp "$out/$3" "$out/$module.py" "$1/src/$(basename "$1")/" - done - git status --porcelain --untracked-files=all \ - | tee "$RUNNER_TEMP/artifact/status-new.txt" - git diff --stat - - - name: Upload the outputs and the diffs - if: always() - uses: actions/upload-artifact@v4 - with: - name: swig-wrappers - path: ${{ runner.temp }}/artifact - if-no-files-found: warn - - - name: Stop unless the 4110d681 outputs are the committed files - if: steps.old.outputs.identical != 'true' - run: | - echo "The command does not reproduce the committed wrappers." - echo "Nothing is committed." - exit 1 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Build both packages against 1bec7b57 and load the modules - run: | - set -euo pipefail - python -m pip install --upgrade pip - for pkg in "$DD" "$IPI"; do - python -m pip wheel --no-deps -w "$RUNNER_TEMP/dist" "./$pkg" - done - python -m pip install --no-deps "$RUNNER_TEMP"/dist/*.whl - cd "$RUNNER_TEMP" - python - <<'PY' - import importlib - for name, cls in ( - ('fiftyone_devicedetection_onpremise.DeviceDetectionHashEngineModule', - 'EngineHashSwig'), - ('fiftyone_ipintelligence_onpremise.IpIntelligenceEngineModule', - 'EngineIpiSwig')): - module = importlib.import_module(name) - assert hasattr(getattr(module, cls), 'process'), (name, cls) - print(name, 'loads, and', cls, 'has process') - PY - # The build stages cxx/src inside each package, which git ignores. - git -C "$GITHUB_WORKSPACE" status --porcelain --untracked-files=all - - - name: Commit the pointer and the wrappers, and push - env: - GIT_AUTHOR_NAME: James Rosewell - GIT_AUTHOR_EMAIL: james@51degrees.com - GIT_COMMITTER_NAME: James Rosewell - GIT_COMMITTER_EMAIL: james@51degrees.com - run: | - set -euo pipefail - git add cxx "$DD/src" "$IPI/src" - left="$(git status --porcelain --untracked-files=all \ - | grep -v -E '^M cxx$' \ - | grep -v -E '^M (device-detection|ip-intelligence)/[^ ]+_onpremise/src/[^ ]+_onpremise/[A-Za-z_]+(\.py|_wrap\.cxx)$' \ - || true)" - if [ -n "$left" ]; then - echo "Changes other than the pointer and the wrappers:" - echo "$left" - exit 1 - fi - git diff --cached --stat - cat > "$RUNNER_TEMP/message.txt" <<'MSG' - Generate both SWIG wrappers again for 51degrees-cxx 4.5.102 - - Between 4.5.100 and 4.5.102, 51degrees-cxx removed the two - EngineHash process overloads and the three EngineIpi process - overloads that take required property indexes. The committed - wrappers still called them, so neither on-premise package compiled - against 4.5.102, which the nightly submodule update brings in #26. - - This moves the cxx submodule from 4110d681, the 4.5.100 release, to - 1bec7b57, the 4.5.102 release, and generates hash_python_wrap.cxx, - DeviceDetectionHashEngineModule.py, ipi_python_wrap.cxx and - IpIntelligenceEngineModule.py again with SWIG 4.4.1 built from its - v4.4.1 tag. Run against 4110d681, the same command gives files byte - for byte the same as the ones committed before, so every difference - here comes from cxx. Both engines call only process(evidence), which - cxx keeps. - MSG - git commit -F "$RUNNER_TEMP/message.txt" - git log -1 --format='commit %H%nauthor %an <%ae>%n%n%B' - git push origin "HEAD:refs/heads/$GITHUB_REF_NAME" From ce3e12f4d455ca1e78443c3234adad1e70786577 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 05:38:40 +0000 Subject: [PATCH 5/6] Read the data files from the data repository inside cxx The examples, tests, packaging and CI now read the data files from cxx/data/device-detection and cxx/data/ip-intelligence. That is the data repository, which cxx has as a submodule. They no longer read cxx/device-detection-data, or this repository's own ip-intelligence/ip-intelligence-data submodule, which is removed. - cxx moves to f03dbfd6, the head of its pull request that adds the data submodule. - The examples' shared helpers, the two example_utils.py files, run the data repository's script for a linked file that is missing, then look again, and print the command if the file is still missing. - The device detection helper looks in cxx/data/device-detection before searching by file name, so it does not pick up an older copy with the same name. - CI downloads the ASN file with the data repository's script, because it is now a link rather than a committed file. - AsnDataFileTests replaces CommittedDataFileTests and checks that the downloaded ASN file is present and opens. - The translation package copies its YAML files from cxx/data/ip-intelligence/Translations, and a new test checks that the built package holds them. - The web example and the on-premise readme no longer link the Azure blob storage. They use the data repository's script, or the Distributor's free download. - The two ExtraPaths entries for the removed submodule are removed, because a folder inside cxx never shows in this repository's diffs. --- .gitmodules | 3 - AGENTS.md | 18 ++++- README.md | 23 ++++++ ci/packages.json | 2 - cxx | 2 +- device-detection/ci/fetch-assets.ps1 | 12 ++- .../examples/gettingstarted.py | 2 +- .../example_utils.py | 76 +++++++++++++++++-- .../onpremise/datafileupdate_console.py | 5 +- .../onpremise/gettingstarted_console.py | 6 +- .../onpremise/gettingstarted_web/app.py | 5 +- .../gettingstarted_web/templates/index.html | 4 +- .../onpremise/match_metrics.py | 5 +- .../onpremise/metadata_console.py | 5 +- .../onpremise/offlineprocessing.py | 5 +- .../onpremise/performance.py | 2 +- .../onpremise/shareusage.py | 5 +- .../onpremise/useragentclienthints_web/app.py | 5 +- .../tests/test_devicedetection.py | 4 +- .../tests/test_properties.py | 2 +- .../tests/test_swig.py | 2 +- device-detection/readme.md | 19 +++-- ip-intelligence/ci/fetch-assets.ps1 | 8 ++ .../readme.md | 13 ++-- .../example_utils.py | 72 +++++++++++++++--- .../onpremise/compare_console.py | 10 +-- .../onpremise/countries_console.py | 5 +- .../onpremise/gettingstarted_console.py | 13 ++-- .../onpremise/gettingstarted_web/app.py | 8 +- .../onpremise/metadata_console.py | 5 +- .../onpremise/mixed_console.py | 19 +++-- .../onpremise/offlineprocessing.py | 8 +- .../onpremise/performance_console.py | 6 +- .../tests/test_examples.py | 12 +-- .../readme.md | 19 +++-- .../tests/constants.py | 11 +-- .../tests/test_ipintelligence.py | 39 +++++----- .../example_constants.py | 13 ++-- .../.gitignore | 4 +- .../setup.py | 15 ++-- .../resources.py | 15 ++-- .../tests/test_translation.py | 15 ++++ ip-intelligence/ip-intelligence-data | 1 - ip-intelligence/readme.md | 43 ++++++----- 44 files changed, 388 insertions(+), 178 deletions(-) delete mode 160000 ip-intelligence/ip-intelligence-data diff --git a/.gitmodules b/.gitmodules index f0d05919..af600379 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "pipeline/owid-python"] path = pipeline/owid-python url = https://github.com/SWAN-community/owid-python.git -[submodule "ip-intelligence/ip-intelligence-data"] - path = ip-intelligence/ip-intelligence-data - url = ../ip-intelligence-data [submodule "cxx"] path = cxx url = ../51degrees-cxx diff --git a/AGENTS.md b/AGENTS.md index 8dececdf..11855b13 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,10 +39,20 @@ so a pipeline change is tested with every product in the same run. ## Submodules -The C/C++ engines and the data files are submodules, listed in the root -`.gitmodules` at their paths under each product folder. The IP Intelligence -on-premise package must compile its own copy of the common C library with -large data file support; the Device Detection one without it. +The C/C++ engines are the `cxx` submodule, listed in the root `.gitmodules`. +The data files come through cxx's own `data` submodule, at +`cxx/data/device-detection` and `cxx/data/ip-intelligence`, where each free +file is a `.link` that `cxx/data/get-data-files.ps1` or +`cxx/data/get-data-files.sh` downloads. Each product's `ci/fetch-assets.ps1` +gets the files its tests need, and the examples' `example_utils.py` runs the +script for a file that is missing. The IP Intelligence on-premise package must +compile its own copy of the common C library with large data file support; +the Device Detection one without it. + +A package's `ExtraPaths` in `ci/packages.json` cannot be a folder inside +`cxx`, because git reports any change there as a change to `cxx` itself. A +cxx update therefore releases no package, even when it brings new translations +in `cxx/data/ip-intelligence`. ## History diff --git a/README.md b/README.md index 3110be9c..2303b4fe 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,29 @@ Clone with the submodules: git clone --recurse-submodules https://github.com/51Degrees/51degrees-python.git ``` +The data files the examples and tests use are not stored in a repository. The +[data](https://github.com/51Degrees/data) repository, which is the `cxx/data` +submodule, holds a `.link` file for each free one, where the file goes, and +two scripts that download them. From the root of this repository, run + +``` +sh cxx/data/get-data-files.sh +``` + +or, in PowerShell, + +``` +./cxx/data/get-data-files.ps1 +``` + +An example whose file is missing runs the script for that file itself. + +Git leaves the folder of a removed submodule on disk. A clone made before the +data files moved to `cxx/data` still has an `ip-intelligence/ip-intelligence-data` +folder, and keeps `cxx/device-detection-data` and `cxx/ip-intelligence-data` +once cxx removes them. Delete those folders, so that nothing finds an old copy +of a data file in them. + Each product's README says what else it needs, such as a C/C++ compiler for the on-premise engines and the data files. diff --git a/ci/packages.json b/ci/packages.json index 873df967..deb06ce9 100644 --- a/ci/packages.json +++ b/ci/packages.json @@ -140,7 +140,6 @@ "Name": "fiftyone_ipintelligence_onpremise", "Product": "ip-intelligence", "Path": "ip-intelligence/fiftyone_ipintelligence_onpremise", - "ExtraPaths": ["ip-intelligence/ip-intelligence-data"], "DependsOn": [ "fiftyone_ipintelligence_shared", "fiftyone_pipeline_engines_fiftyone" @@ -153,7 +152,6 @@ "Name": "fiftyone_ipintelligence_translation", "Product": "ip-intelligence", "Path": "ip-intelligence/fiftyone_ipintelligence_translation", - "ExtraPaths": ["ip-intelligence/ip-intelligence-data"], "DependsOn": [ "fiftyone_pipeline_core", "fiftyone_pipeline_translation" diff --git a/cxx b/cxx index 1bec7b57..f03dbfd6 160000 --- a/cxx +++ b/cxx @@ -1 +1 @@ -Subproject commit 1bec7b570575e2e180b52435599bef9b03e35ad8 +Subproject commit f03dbfd6ab9a7ecc898543936dd0338da0668513 diff --git a/device-detection/ci/fetch-assets.ps1 b/device-detection/ci/fetch-assets.ps1 index c551f8f9..45cb2875 100644 --- a/device-detection/ci/fetch-assets.ps1 +++ b/device-detection/ci/fetch-assets.ps1 @@ -11,7 +11,8 @@ if ($env:GITHUB_JOB -eq "PreBuild") { exit 0 } -$deviceDetectionData = "$PSScriptRoot/../../cxx/device-detection-data" +$data = "$PSScriptRoot/../../cxx/data" +$deviceDetectionData = "$data/device-detection" $assets = '51Degrees-LiteV4.1.hash', '20000 Evidence Records.yml', '20000 User Agents.csv' if ($DeviceDetection) { @@ -29,3 +30,12 @@ foreach ($asset in $assets) { default {New-Item -ItemType SymbolicLink -Force -Target "$PWD/assets/$_" -Path "$deviceDetectionData/$_"} } } + +# Downloads any other file the data repository links to in the folder. The +# script keeps a file that is already there, so the assets linked in above +# are not downloaded again. +$global:LASTEXITCODE = 0 +& "$data/get-data-files.ps1" device-detection +if ($LASTEXITCODE -ne 0) { + throw "Not every data file in $deviceDetectionData was downloaded" +} diff --git a/device-detection/fiftyone_devicedetection/examples/gettingstarted.py b/device-detection/fiftyone_devicedetection/examples/gettingstarted.py index 994d736f..cf3a7b7f 100644 --- a/device-detection/fiftyone_devicedetection/examples/gettingstarted.py +++ b/device-detection/fiftyone_devicedetection/examples/gettingstarted.py @@ -24,7 +24,7 @@ # First create the device detection pipeline with the desired settings. -data_file = "../../cxx/device-detection-data/51Degrees-LiteV4.1.hash" +data_file = "../../cxx/data/device-detection/51Degrees-LiteV4.1.hash" resource_key = "!!YOUR_RESOURCE_KEY!!" # Uncommment the line below 'On-Premise' and comment the line below 'Cloud' to diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py index d36c35ea..05260f95 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py @@ -23,6 +23,8 @@ from datetime import datetime, timedelta from threading import Event, Thread import os +import shlex +import subprocess from pathlib import Path @@ -51,6 +53,15 @@ class ExampleUtils: # file named in its configuration. DATA_FILE_ENV_VAR = "51DEGREES_DD_PATH" + # The data repository's device detection folder, from the root of a + # checkout of this repository. Each file the data repository links to + # belongs in this folder, beside its .link file. + DATA_FOLDER = os.path.join("cxx", "data", "device-detection") + + # Sent with each download, so the downloads these examples make can be + # counted. + DOWNLOAD_SOURCE = "examples-51degrees-python" + @staticmethod def get_resource_key_from_config(config): key = "" @@ -183,12 +194,29 @@ def __get_env_variable(name): else: return "" - # Find the specified filename within the specified directory. - # If no directory is specified, the working directory is used. - # If the file cannot be found, the algorithm will move to the - # parent directory and repeat the process. + # Find the specified file. A path to a file that exists is returned as + # it is. Next, the data repository's folder is checked in the working + # directory and in each directory above it, and a file the data + # repository links to is downloaded there when it is missing. Otherwise + # the working directory is searched for a file with the same name, then + # each parent directory in turn. None is returned when nothing is found. @staticmethod def find_file(file_name): + path = Path(file_name).absolute() + if path.is_file(): + return str(path.resolve()) + + # The data repository's copy is preferred to a file with the same + # name elsewhere in the tree, which may be out of date or a Git LFS + # pointer. + current = Path(os.getcwd()).absolute() + for root in [current, *current.parents]: + candidate = root / ExampleUtils.DATA_FOLDER / path.name + if candidate.is_file(): + return str(candidate) + if candidate.with_name(candidate.name + ".link").is_file(): + return ExampleUtils.__download(str(candidate)) + stop_event = Event() result = [None] # Start the file system search as a separate task. @@ -235,6 +263,39 @@ def __find_file(file_name, stop_event, result, search_dir=None): if search_dir.parent != search_dir and not stop_event.is_set(): ExampleUtils.__find_file(file_name, stop_event, result, search_dir.parent) + # Download a file the data repository links to, by running the data + # repository's own script for that file, and return its path, or None + # when it could not be downloaded. The data repository is the folder + # above the one that holds the file's .link. + @staticmethod + def __download(path): + name = os.path.basename(path) + data = os.path.dirname(os.path.dirname(path)) + if os.name == "nt": + command = [ + "powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", + "-File", os.path.join(data, "get-data-files.ps1"), name, + "-Source", ExampleUtils.DOWNLOAD_SOURCE] + text = subprocess.list2cmdline(command) + else: + command = [ + "sh", os.path.join(data, "get-data-files.sh"), + "-s", ExampleUtils.DOWNLOAD_SOURCE, name] + text = shlex.join(command) + + # Flushed first, because the script writes to the same output. + print(f"{name} is missing, so it is being downloaded by running\n" + f"{text}", flush=True) + try: + subprocess.run(command, check=False) + except OSError: + pass + if os.path.isfile(path): + return path + print(f"{name} could not be downloaded. Run this command to try " + f"again.\n{text}") + return None + @staticmethod def get_data_file_date(engine): date = engine.engine.getPublishedTime() @@ -272,9 +333,10 @@ def check_data_file(pipeline, logger): f"that is more than '{ExampleUtils.DATA_FILE_AGE_WARNING}' days " + "old. A more recent data file may be needed to " + "correctly detect the latest devices, browsers, " + - "etc. The latest lite data file is available from " + - "the device-detection-data repository on GitHub " + - "https://github.com/51Degrees/device-detection-data. " + + "etc. Get the latest lite data file by running " + + "cxx/data/get-data-files.sh -u 51Degrees-LiteV4.1.hash, " + + "or cxx/data/get-data-files.ps1 51Degrees-LiteV4.1.hash " + + "-Update on Windows. " + "Find out about the Enterprise data file, which " + "includes automatic updates, on our pricing page: " + "https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-example_utils.py&utm_term=data-file-age-warning") diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/datafileupdate_console.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/datafileupdate_console.py index bf9ff7a3..d5fd2228 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/datafileupdate_console.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/datafileupdate_console.py @@ -53,9 +53,8 @@ # # ## Lite Data File # Lite data files (free-to-use, limited capabilities, no license key required) are created roughly -# once a month and cannot be updated using auto-update, they may be downloaded from -# [Github](https://github.com/51Degrees/device-detection-data) and are included with -# source distributions of this software. +# once a month and cannot be updated using auto-update, they may be downloaded with the +# scripts in the [data](https://github.com/51Degrees/data) repository on GitHub. # # # Update on Start-Up # You can configure the pipeline builder to download an Enterprise data file on start-up. diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_console.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_console.py index 9c695f43..f49c5bc0 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_console.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_console.py @@ -152,9 +152,9 @@ def main(argv): else: logger.log("error", "Failed to find a device detection " + - "data file. Make sure the device-detection-data " + - "submodule has been updated by running " + - "`git submodule update --recursive`.") + "data file. Make sure the data submodule is there, " + + "by running `git submodule update --init --recursive`, " + + "and run this example again to download the file.") if __name__ == "__main__": main(sys.argv[1:]) diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py index c2ec0e2b..dee9b99b 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py @@ -246,8 +246,9 @@ def build_config(): if foundDataFile == False: raise Exception("Failed to find a device detection data file matching " + f"'{dataFile}'. If using the lite file, then make sure the " + - "device-detection-data submodule has been updated by running " + - "`git submodule update --recursive`. Otherwise, ensure that the filename " + + "data submodule is there, by running " + + "`git submodule update --init --recursive`, and run this " + + "example again to download the file. Otherwise, ensure that the filename " + "is correct in config.json, or set the environment variable " + f"'{ExampleUtils.DATA_FILE_ENV_VAR}' to the path of the data file.") diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/templates/index.html b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/templates/index.html index 8106f4cc..d26ab8da 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/templates/index.html +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/templates/index.html @@ -30,8 +30,8 @@
WARNING: This example is using a data file that is more than {{ utils.DATA_FILE_AGE_WARNING }} days old. A more recent data file may be needed to correctly detect the latest devices, - browsers, etc. The latest lite data file is available from the - device-detection-data + browsers, etc. Get the latest lite data file with the scripts in the + data repository on GitHub. Find out about the Enterprise data file, which includes automatic daily updates, on our pricing page.
diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/match_metrics.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/match_metrics.py index f9f254f8..5daeb284 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/match_metrics.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/match_metrics.py @@ -189,8 +189,9 @@ def main(argv): else: logger.log("error", "Failed to find a device detection data file. Make sure the " + - "device-detection-data submodule has been updated by running " + - "`git submodule update --recursive`.") + "data submodule is there, by running " + + "`git submodule update --init --recursive`, and run this " + + "example again to download the file.") if __name__ == "__main__": main(sys.argv[1:]) \ No newline at end of file diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/metadata_console.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/metadata_console.py index 1e5e0929..ed974ae6 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/metadata_console.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/metadata_console.py @@ -129,8 +129,9 @@ def main(argv): else: logger.log("error", "Failed to find a device detection data file. Make sure the " + - "device-detection-data submodule has been updated by running " + - "`git submodule update --recursive`.") + "data submodule is there, by running " + + "`git submodule update --init --recursive`, and run this " + + "example again to download the file.") if __name__ == "__main__": main(sys.argv[1:]) \ No newline at end of file diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/offlineprocessing.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/offlineprocessing.py index 2487f3e9..80ca344f 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/offlineprocessing.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/offlineprocessing.py @@ -211,8 +211,9 @@ def main(argv): else: logger.log("error", "Failed to find a device detection data file. Make sure the " + - "device-detection-data submodule has been updated by running " + - "`git submodule update --recursive`.") + "data submodule is there, by running " + + "`git submodule update --init --recursive`, and run this " + + "example again to download the file.") if __name__ == "__main__": main(sys.argv[1:]) diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/performance.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/performance.py index 665cdabf..271ce134 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/performance.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/performance.py @@ -145,7 +145,7 @@ def run(data_file, skip = False): if __name__ == "__main__": ap = argparse.ArgumentParser(description='Run detection benchmark.') ap.add_argument('-d', '--data_file', default='', help='Path to data file') - ap.add_argument('-u', '--user_agents_file', default='../../cxx/device-detection-data/20000 User Agents.csv', help='Path to user agents evidence file') + ap.add_argument('-u', '--user_agents_file', default='../../cxx/data/device-detection/20000 User Agents.csv', help='Path to user agents evidence file') ap.add_argument('-j', '--json_output', default='', help='Output results in JSON format') args = ap.parse_args() if args.data_file == "": diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/shareusage.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/shareusage.py index 5d808bf4..6cbbbfd7 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/shareusage.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/shareusage.py @@ -184,8 +184,9 @@ def main(argv): ShareUsageExample().run(input) else: print("ERROR: Failed to find the evidence file. Make sure the " - "device-detection-data submodule has been updated by running " - "`git submodule update --recursive`.") + "data submodule is there, by running " + "`git submodule update --init --recursive`, and run this " + "example again to download the file.") if __name__ == "__main__": diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py index 6d10a1a7..570ab57e 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py @@ -148,8 +148,9 @@ def build_config(): if foundDataFile == False: raise Exception("Failed to find a device detection data file matching " + f"'{dataFile}'. If using the lite file, then make sure the " + - "device-detection-data submodule has been updated by running " + - "`git submodule update --recursive`. Otherwise, ensure that the filename " + + "data submodule is there, by running " + + "`git submodule update --init --recursive`, and run this " + + "example again to download the file. Otherwise, ensure that the filename " + "is correct in config.json.") return config diff --git a/device-detection/fiftyone_devicedetection_onpremise/tests/test_devicedetection.py b/device-detection/fiftyone_devicedetection_onpremise/tests/test_devicedetection.py index 3cd885ce..135cc69d 100644 --- a/device-detection/fiftyone_devicedetection_onpremise/tests/test_devicedetection.py +++ b/device-detection/fiftyone_devicedetection_onpremise/tests/test_devicedetection.py @@ -36,7 +36,7 @@ from fiftyone_pipeline_core.pipelinebuilder import PipelineBuilder from fiftyone_pipeline_engines.lru_cache import LRUEngineCache -data_file = "../../cxx/device-detection-data/51Degrees-LiteV4.1.hash" +data_file = "../../cxx/data/device-detection/51Degrees-LiteV4.1.hash" mobile_ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C114" @@ -46,7 +46,7 @@ # User agents file -with open('../../cxx/device-detection-data/20000 User Agents.csv', newline='') as file: +with open('../../cxx/data/device-detection/20000 User Agents.csv', newline='') as file: reader = csv.reader(file) user_agents = list(reader) no_user_agents = len(user_agents) diff --git a/device-detection/fiftyone_devicedetection_onpremise/tests/test_properties.py b/device-detection/fiftyone_devicedetection_onpremise/tests/test_properties.py index def20c1c..0d9b6435 100644 --- a/device-detection/fiftyone_devicedetection_onpremise/tests/test_properties.py +++ b/device-detection/fiftyone_devicedetection_onpremise/tests/test_properties.py @@ -28,7 +28,7 @@ from fiftyone_devicedetection_shared.utils import * from fiftyone_devicedetection_onpremise import constants -data_file = "../../cxx/device-detection-data/51Degrees-LiteV4.1.hash" +data_file = "../../cxx/data/device-detection/51Degrees-LiteV4.1.hash" mobile_ua = ("Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X) " "AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile" "/11D167 Safari/9537.53") diff --git a/device-detection/fiftyone_devicedetection_onpremise/tests/test_swig.py b/device-detection/fiftyone_devicedetection_onpremise/tests/test_swig.py index 04b4ee50..0b4bea5a 100644 --- a/device-detection/fiftyone_devicedetection_onpremise/tests/test_swig.py +++ b/device-detection/fiftyone_devicedetection_onpremise/tests/test_swig.py @@ -28,7 +28,7 @@ from fiftyone_devicedetection_onpremise.swig_data import SwigData from fiftyone_devicedetection_shared.utils import * -data_file = "../../cxx/device-detection-data/51Degrees-LiteV4.1.hash" +data_file = "../../cxx/data/device-detection/51Degrees-LiteV4.1.hash" # Create a simple pipeline to access the engine with and process it with flow data deviceDetectionOnPremiseEngine = DeviceDetectionOnPremise( diff --git a/device-detection/readme.md b/device-detection/readme.md index 379b1ed1..379be178 100644 --- a/device-detection/readme.md +++ b/device-detection/readme.md @@ -43,22 +43,25 @@ to use the Cloud API. You can create resource keys using our #### On-Premise In order to perform device detection on-premise, you will need to use a 51Degrees data file. -This repository includes a free, 'lite' file in the 'device-detection-data' sub-module that has a -significantly reduced set of properties. To obtain a file with a more complete set of device -properties see the [51Degrees website](https://51degrees.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=readme.md&utm_term=on-premise). If you want to use the lite -file, you will need to install [GitLFS](https://git-lfs.github.com/): +A free, 'lite' file is available, with a significantly reduced set of properties. To obtain a +file with a more complete set of device properties see the [51Degrees website](https://51degrees.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=51degrees-python&utm_content=readme.md&utm_term=on-premise). + +The lite file is not stored in a repository. The [data](https://github.com/51Degrees/data) +repository, which is the `cxx/data` submodule, links to it from +`cxx/data/device-detection`. Download it from the root of this repository by running: ``` -sudo apt-get install git-lfs -git lfs install +sh cxx/data/get-data-files.sh 51Degrees-LiteV4.1.hash ``` -Then, navigate to 'src/fiftyone_devicedetection_onpremise/cxx/device-detection-data' and execute: +or, in PowerShell: ``` -git lfs pull +./cxx/data/get-data-files.ps1 51Degrees-LiteV4.1.hash ``` +The examples run this for themselves when the file is missing. + ## Folders * `fiftyone_devicedetection` - references both cloud and on-premise packages, contains generic Device-Detection Pipeline Builder. diff --git a/ip-intelligence/ci/fetch-assets.ps1 b/ip-intelligence/ci/fetch-assets.ps1 index 00e2bd91..a26332bc 100644 --- a/ip-intelligence/ci/fetch-assets.ps1 +++ b/ip-intelligence/ci/fetch-assets.ps1 @@ -29,6 +29,14 @@ foreach ($asset in $assets) { } } +# The ASN file is not an asset, so the data repository's script downloads it +# beside its link in cxx/data/ip-intelligence, where the tests look for it. +$global:LASTEXITCODE = 0 +& "$PSScriptRoot/../../cxx/data/get-data-files.ps1" 51Degrees-IPIV4AsnIpiV41.ipi +if ($LASTEXITCODE -ne 0) { + throw "The ASN data file was not downloaded" +} + # If the Enterprise file was downloaded, prefer it for tests by exposing # it through the environment variable used by the test suites. if ($IpIntelligenceUrl) { diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/readme.md b/ip-intelligence/fiftyone_ipintelligence_examples/readme.md index af0db8c7..d9542f6a 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/readme.md +++ b/ip-intelligence/fiftyone_ipintelligence_examples/readme.md @@ -34,11 +34,12 @@ python -m fiftyone_ipintelligence_examples.cloud.gettingstarted_web ## On-premise examples Require a `.ipi` data file in the format the engine reads (see -[Data files](../readme.md#data-files)). The -`ip-intelligence-data` submodule includes a freely available network-only -file (`51Degrees-IPIV4AsnIpiV41.ipi`) that the examples fall back to; it -only contains the ASN/network properties, so location and registration -properties are reported as "not present in the data file". +[Data files](../readme.md#data-files)). The data repository, at +`cxx/data`, links to a freely available network-only file +(`51Degrees-IPIV4AsnIpiV41.ipi`) that the examples fall back to, and an +example downloads it when it is missing. It only contains the ASN/network +properties, so location and registration properties are reported as "not +present in the data file". For the full set of properties (location, registration, etc.), a more complete data file is required - to obtain one for testing please @@ -50,7 +51,7 @@ the first command line argument. - `onpremise/metadata_console.py` - list the properties available from the data file. - `onpremise/offlineprocessing.py` - batch process the evidence file - from the ip-intelligence-data repository. + from the data repository. - `onpremise/performance_console.py` - benchmark the number of IP lookups performed per second. - `onpremise/compare_console.py` - compare the location returned for each diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/example_utils.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/example_utils.py index 56e3d783..81eb5829 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/example_utils.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/example_utils.py @@ -22,6 +22,8 @@ from datetime import datetime, timedelta import os +import shlex +import subprocess from pathlib import Path @@ -43,6 +45,15 @@ class ExampleUtils: # to use when running examples. DATA_FILE_ENV_VAR = "IPINTELLIGENCEDATAFILE" + # The data repository's IP intelligence folder, from the root of a + # checkout of this repository. Each file the data repository links to + # belongs in this folder, beside its .link file. + DATA_FOLDER = os.path.join("cxx", "data", "ip-intelligence") + + # Sent with each download, so the downloads these examples make can be + # counted. + DOWNLOAD_SOURCE = "examples-51degrees-python" + @staticmethod def get_human_readable(ip_data, property): try: @@ -112,8 +123,9 @@ def find_file(file_name): """! Find the specified file. First checks the data file environment variable, then searches up the directory tree from the current - working directory looking in 'assets' and 'ip-intelligence-data' - folders. + working directory looking in 'assets' and the data repository's + folder. A file the data repository links to is downloaded there + when it is missing. """ env = os.environ.get(ExampleUtils.DATA_FILE_ENV_VAR) @@ -123,15 +135,54 @@ def find_file(file_name): current = Path(os.getcwd()).resolve() roots = [current, *current.parents] for root in roots[:8]: - for sub_dir in [ - ".", - "assets", - "ip-intelligence-data", - os.path.join("cxx", "ip-intelligence-data")]: + for sub_dir in [".", "assets", ExampleUtils.DATA_FOLDER]: candidate = os.path.join(str(root), sub_dir, file_name) if os.path.isfile(candidate): return candidate + for root in roots[:8]: + candidate = os.path.join( + str(root), ExampleUtils.DATA_FOLDER, file_name) + if os.path.isfile(candidate + ".link"): + return ExampleUtils.__download(candidate) + + return None + + @staticmethod + def __download(path): + + """! + Download a file the data repository links to, by running the data + repository's own script for that file, and return its path, or None + when it could not be downloaded. The data repository is the folder + above the one that holds the file's .link. + """ + + name = os.path.basename(path) + data = os.path.dirname(os.path.dirname(path)) + if os.name == "nt": + command = [ + "powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", + "-File", os.path.join(data, "get-data-files.ps1"), name, + "-Source", ExampleUtils.DOWNLOAD_SOURCE] + text = subprocess.list2cmdline(command) + else: + command = [ + "sh", os.path.join(data, "get-data-files.sh"), + "-s", ExampleUtils.DOWNLOAD_SOURCE, name] + text = shlex.join(command) + + # Flushed first, because the script writes to the same output. + print(f"{name} is missing, so it is being downloaded by running\n" + f"{text}", flush=True) + try: + subprocess.run(command, check=False) + except OSError: + pass + if os.path.isfile(path): + return path + print(f"{name} could not be downloaded. Run this command to try " + f"again.\n{text}") return None @staticmethod @@ -167,9 +218,10 @@ def check_data_file(pipeline, logger): f"This data file is more than " f"{ExampleUtils.DATA_FILE_AGE_WARNING} days old. A more " f"recent data file may be needed to correctly resolve " - f"the latest IP addresses. The latest data file is " - f"available from the ip-intelligence-data repository on " - f"GitHub https://github.com/51Degrees/ip-intelligence-data.") + f"the latest IP addresses. Get the latest free data files " + f"by running cxx/data/get-data-files.sh -u ip-intelligence, " + f"or cxx/data/get-data-files.ps1 ip-intelligence -Update " + f"on Windows.") if product == "Lite": logger.log("warning", diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/compare_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/compare_console.py index d0479c2e..062e24da 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/compare_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/compare_console.py @@ -30,8 +30,8 @@ # an IP-to-location service compare to real world information, especially # when evaluating different solutions. # -# The input CSV (geoip_comparison_evidence.csv in the ip-intelligence-data -# repository) provides these fields: +# The input CSV (geoip_comparison_evidence.csv in the data repository's +# ip-intelligence folder) provides these fields: # DateTimeUtc, Latitude, Longitude, Ip, AddressFamily, Continent, Country # # For each record the engine is used to obtain the latitude and longitude @@ -56,7 +56,7 @@ from fiftyone_pipeline_core.logger import Logger from fiftyone_ipintelligence_shared.example_constants import ENTERPRISE_DATAFILE_NAME -# Name of the truth CSV file in the ip-intelligence-data repository. +# Name of the truth CSV file in the data repository. GEOIP_COMPARISON_EVIDENCE_FILE_NAME = "geoip_comparison_evidence.csv" # Mean radius of the earth in kilometres, used for the distance calculation. @@ -184,8 +184,8 @@ def main(argv): else: logger.log("error", "Failed to find a data file or truth file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`. To obtain an enterprise " + "data submodule is there, by running " + "`git submodule update --init --recursive`. To obtain an enterprise " "data file for testing, please contact us: " "https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence_examples-src-fiftyone_ipintelligence_examples-onpremise-compare_console.py&utm_term=data-file-required") diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/countries_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/countries_console.py index 35266657..6d26ce73 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/countries_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/countries_console.py @@ -150,8 +150,9 @@ def main(argv): else: logger.log("error", "Failed to find an IP intelligence data file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`, or supply the path to a " + "data submodule is there, by running " + "`git submodule update --init --recursive`, and run this " + "example again to download the file, or supply the path to a " "data file as the first command line argument.") diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_console.py index 0f211919..f5ad8cdc 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_console.py @@ -32,10 +32,10 @@ # 2. How to pass input data (evidence) to the Pipeline # 3. How to retrieve the results # -# This example uses a local IP intelligence data file (.ipi). The -# ip-intelligence-data submodule provides a freely available data file; -# a more complete data file can be supplied as the first command line -# argument. +# This example uses a local IP intelligence data file (.ipi). The data +# repository links to a freely available data file, which the example +# downloads when it is missing. A more complete data file can be supplied +# as the first command line argument. # # Required PyPi Dependencies: # - fiftyone_ipintelligence @@ -170,8 +170,9 @@ def main(argv): else: logger.log("error", "Failed to find an IP intelligence data file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`, or supply the path to a " + "data submodule is there, by running " + "`git submodule update --init --recursive`, and run this " + "example again to download the file, or supply the path to a " "data file as the first command line argument.") if __name__ == "__main__": diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_web/app.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_web/app.py index 49bc8b72..debc4a1b 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_web/app.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/gettingstarted_web/app.py @@ -133,9 +133,11 @@ def main(data_file = None): data_file = ExampleUtils.find_file(LITE_DATAFILE_NAME) if not data_file: raise Exception( - "Failed to find an IP intelligence data file. Download the " - "Lite file from https://51ddatafiles.blob.core.windows.net/" - "enterpriseipi/51Degrees-LiteIpiV41.ipi.gz") + "Failed to find an IP intelligence data file. Make sure the " + "data submodule is there, by running " + "`git submodule update --init --recursive`, and run this " + "example again to download the file, or supply the path to a " + "data file as the first command line argument.") build_pipeline(data_file) app.run(debug=False) diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/metadata_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/metadata_console.py index e10df504..ec2be8a1 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/metadata_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/metadata_console.py @@ -66,9 +66,8 @@ def main(argv): MetadataConsole().run(data_file, logger, print) else: logger.log("error", - "Failed to find an IP intelligence data file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`. To obtain an enterprise " + "Failed to find an IP intelligence data file. Supply its path " + "as the first command line argument. To obtain an enterprise " "data file for testing, please contact us: " "https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence_examples-src-fiftyone_ipintelligence_examples-onpremise-metadata_console.py&utm_term=data-file-required") diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/mixed_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/mixed_console.py index 11805592..07839ab1 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/mixed_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/mixed_console.py @@ -48,8 +48,8 @@ from fiftyone_ipintelligence_examples.example_utils import ExampleUtils from fiftyone_ipintelligence_shared.example_constants import ASN_DATAFILE_NAME -# Default name of the device detection data file (the lite file included in -# the device-detection-data repository). +# Default name of the device detection data file (the lite file the data +# repository links to). HASH_DATAFILE_NAME = "51Degrees-LiteV4.1.hash" # Combined evidence: a User-Agent for device detection and an IP address for @@ -199,14 +199,19 @@ def main(argv): else: if not device_file: logger.log("error", - "Failed to find a device detection data file. Make sure the " - "device-detection-data submodule has been updated, or supply " - "the path as the first command line argument.") + "Failed to find a device detection data file. Supply its " + "path as the first command line argument. Get the free Lite " + "file by running " + "cxx/data/get-data-files.sh 51Degrees-LiteV4.1.hash, or " + "cxx/data/get-data-files.ps1 51Degrees-LiteV4.1.hash on " + "Windows, which saves it in cxx/data/device-detection.") if not ip_file: logger.log("error", "Failed to find an IP intelligence data file. Make sure the " - "ip-intelligence-data submodule has been updated, or supply " - "the path as the second command line argument.") + "data submodule is there, by running " + "`git submodule update --init --recursive`, and run this " + "example again to download the file, or supply the path as " + "the second command line argument.") if __name__ == "__main__": main(sys.argv[1:]) diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/offlineprocessing.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/offlineprocessing.py index a32c11cb..9c7109cc 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/offlineprocessing.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/offlineprocessing.py @@ -23,8 +23,8 @@ ## @example onpremise/offlineprocessing.py # Provides an example of processing a YAML file containing evidence for # IP intelligence. There are 20,000 IP addresses in the supplied file of -# evidence records ('evidence.yml' in the ip-intelligence-data -# repository). +# evidence records ('evidence.yml' in the data repository's +# ip-intelligence folder). # # We create a pipeline using the on-premise engine, deserialize the # YAML evidence records, pass each entry to the pipeline and write the @@ -120,8 +120,8 @@ def main(argv): else: logger.log("error", "Failed to find a data file or evidence file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`.") + "data submodule is there, by running " + "`git submodule update --init --recursive`.") if __name__ == "__main__": main(sys.argv[1:]) diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/performance_console.py b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/performance_console.py index 7ca71715..310bd727 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/performance_console.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/src/fiftyone_ipintelligence_examples/onpremise/performance_console.py @@ -25,7 +25,7 @@ # # This example measures the performance of the on-premise IP intelligence # engine. It processes the IP addresses from the evidence file supplied in -# the ip-intelligence-data repository and reports the number of IP lookups +# the data repository and reports the number of IP lookups # performed per second. # # Requesting fewer properties reduces processing time. If you do not specify @@ -225,8 +225,8 @@ def main(argv): else: logger.log("error", "Failed to find a data file or evidence file. Make sure the " - "ip-intelligence-data submodule has been updated by running " - "`git submodule update --recursive`. To obtain an enterprise " + "data submodule is there, by running " + "`git submodule update --init --recursive`. To obtain an enterprise " "data file for testing, please contact us: " "https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_ipintelligence_examples-src-fiftyone_ipintelligence_examples-onpremise-performance_console.py&utm_term=data-file-required") diff --git a/ip-intelligence/fiftyone_ipintelligence_examples/tests/test_examples.py b/ip-intelligence/fiftyone_ipintelligence_examples/tests/test_examples.py index b0e359a3..a2d17c30 100644 --- a/ip-intelligence/fiftyone_ipintelligence_examples/tests/test_examples.py +++ b/ip-intelligence/fiftyone_ipintelligence_examples/tests/test_examples.py @@ -29,10 +29,10 @@ from fiftyone_ipintelligence_shared.example_constants import ASN_DATAFILE_NAME from fiftyone_ipintelligence_shared.example_constants import EVIDENCE_FILE_NAME -# The tests run against the freely available data file committed to the -# ip-intelligence-data submodule, so they only rely on properties that the -# free data file provides (location properties such as Latitude, Longitude -# and Areas are not present in it). +# The tests run against the freely available ASN data file the data +# repository links to, so they only rely on properties that the free data +# file provides (location properties such as Latitude, Longitude and Areas +# are not present in it). data_file = ExampleUtils.find_file(ASN_DATAFILE_NAME) evidence_file = ExampleUtils.find_file(EVIDENCE_FILE_NAME) truth_file = ExampleUtils.find_file("geoip_comparison_evidence.csv") @@ -61,8 +61,8 @@ class ExampleTests(unittest.TestCase): @unittest.skipUnless( bool(data_file), "No IP intelligence data file available") def test_onpremise_datafile_loads(self): - # Verify the freely available data file committed to the - # ip-intelligence-data submodule loads and processes correctly. + # Verify the freely available ASN data file loads and processes + # correctly. from fiftyone_ipintelligence.ipintelligence_pipelinebuilder import IpIntelligencePipelineBuilder pipeline = IpIntelligencePipelineBuilder( data_file_path=data_file, diff --git a/ip-intelligence/fiftyone_ipintelligence_onpremise/readme.md b/ip-intelligence/fiftyone_ipintelligence_onpremise/readme.md index b7eb9ac3..65b11d8e 100644 --- a/ip-intelligence/fiftyone_ipintelligence_onpremise/readme.md +++ b/ip-intelligence/fiftyone_ipintelligence_onpremise/readme.md @@ -28,12 +28,17 @@ python setup.py build_clib build_ext ## Data files -The on-premise engine requires a `.ipi` data file. A Lite data file can be -downloaded from -[51Degrees](https://51ddatafiles.blob.core.windows.net/enterpriseipi/51Degrees-LiteIpiV41.ipi.gz), -see also the [ip-intelligence-data](https://github.com/51Degrees/ip-intelligence-data) -repository which is included as a nested submodule and contains evidence -files for testing. +The on-premise engine requires a `.ipi` data file. The free Lite data file, +`51Degrees-LiteV41.ipi`, is linked from the +[data](https://github.com/51Degrees/data) repository, which is included as +the nested submodule `cxx/data` and contains evidence files for testing. From +the root of a checkout of +[51degrees-python](https://github.com/51Degrees/51degrees-python), download it +by running `sh cxx/data/get-data-files.sh 51Degrees-LiteV41.ipi`, or +`./cxx/data/get-data-files.ps1 51Degrees-LiteV41.ipi` in PowerShell. Without a +checkout, download it from +https://distributor.51degrees.com/api/v2/free/ipi-lite-v41, which sends it +gzip compressed. ## Usage @@ -41,7 +46,7 @@ files for testing. from fiftyone_ipintelligence_onpremise.ipintelligence_onpremise_pipelinebuilder import IpIntelligenceOnPremisePipelineBuilder pipeline = IpIntelligenceOnPremisePipelineBuilder( - data_file_path="51Degrees-LiteIpiV41.ipi", + data_file_path="51Degrees-LiteV41.ipi", licence_keys="", usage_sharing=False).build() diff --git a/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/constants.py b/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/constants.py index 6f9123f3..2c5180f8 100644 --- a/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/constants.py +++ b/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/constants.py @@ -42,11 +42,12 @@ def get_data_file_path(): os.path.dirname(__file__), "..", "..", "assets", "51Degrees-LiteIpiV41.ipi") - # The ASN data file committed to the repository's ip-intelligence-data - # submodule. Unlike the Lite and Enterprise files it needs no download - # or secret, so it is always present wherever the engine can be built. + # The free ASN data file, which ci/fetch-assets.ps1 downloads with the + # data repository's script, beside its link in cxx/data/ip-intelligence. + # Unlike the Enterprise file it needs no secret. @staticmethod - def get_committed_data_file_path(): + def get_asn_data_file_path(): return os.path.join( os.path.dirname(__file__), - "..", "..", "ip-intelligence-data", ASN_DATAFILE_NAME) + "..", "..", "..", "cxx", "data", "ip-intelligence", + ASN_DATAFILE_NAME) diff --git a/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/test_ipintelligence.py b/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/test_ipintelligence.py index 13f5d042..df9f835e 100644 --- a/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/test_ipintelligence.py +++ b/ip-intelligence/fiftyone_ipintelligence_onpremise/tests/test_ipintelligence.py @@ -171,42 +171,41 @@ def test_missing_licence_key(self): self.assertIn("licence key is required", str(context.exception)) -class CommittedDataFileTests(unittest.TestCase): +class AsnDataFileTests(unittest.TestCase): """! - The native engine accepts exactly one data file format version, so the - cxx (51degrees-cxx) pin and the ip-intelligence-data pin must agree. - They once did not: the engine moved to format 4.6 while the data pin - still held the 4.5 ASN file. These tests open the ASN file committed to - the data submodule, which needs no download or secret, so pins that - disagree fail here on any machine. - - They do not prove the engine reads the data files 51Degrees publishes. - That is IpIntelligenceOnPremiseTests above, against the Lite or - Enterprise file CI downloads; it skips when neither is present. + The native engine accepts exactly one data file format version. These + tests open the free ASN data file. The Distributor always serves the + latest one published, and it needs no secret, so an engine that cannot + read the format 51Degrees publishes fails here on any machine. + + IpIntelligenceOnPremiseTests above runs against the Lite or Enterprise + file CI downloads, and skips when neither is present. test_onpremise_datafile_loads in the examples package also opens the ASN file, but it skips silently when the file is not found and it runs after the examples build, so it is not relied on here. """ - def test_committed_data_file_present(self): + def test_asn_data_file_present(self): """! - The committed data file exists. If it does not, the - ip-intelligence-data submodule was not checked out, and the test + The ASN data file has been downloaded. If it has not, the test below would prove nothing. """ self.assertTrue( - os.path.isfile(TestConstants.get_committed_data_file_path()), - "Run 'git submodule update --init --recursive'.") + os.path.isfile(TestConstants.get_asn_data_file_path()), + "Download it from the repository root by running " + "'sh cxx/data/get-data-files.sh 51Degrees-IPIV4AsnIpiV41.ipi', " + "or './cxx/data/get-data-files.ps1 51Degrees-IPIV4AsnIpiV41.ipi' " + "in PowerShell.") - def test_committed_data_file_opens(self): + def test_asn_data_file_opens(self): """! - The engine opens the committed data file, so it reads that file's - format version, and returns its properties for an IPv4 address. + The engine opens the ASN data file, so it reads that file's format + version, and returns its properties for an IPv4 address. """ engine = IpIntelligenceOnPremise( - data_file_path=TestConstants.get_committed_data_file_path(), + data_file_path=TestConstants.get_asn_data_file_path(), licence_keys="") pipeline = PipelineBuilder().add(engine).build() diff --git a/ip-intelligence/fiftyone_ipintelligence_shared/src/fiftyone_ipintelligence_shared/example_constants.py b/ip-intelligence/fiftyone_ipintelligence_shared/src/fiftyone_ipintelligence_shared/example_constants.py index e11dd421..35945298 100644 --- a/ip-intelligence/fiftyone_ipintelligence_shared/src/fiftyone_ipintelligence_shared/example_constants.py +++ b/ip-intelligence/fiftyone_ipintelligence_shared/src/fiftyone_ipintelligence_shared/example_constants.py @@ -38,12 +38,13 @@ # Note: the .NET examples' Constants.cs still uses the legacy name # "51Degrees-EnterpriseIpiV41.ipi", but the published enterprise/ASN data # files use the "IPIV4" infix (cf. 51Degrees-IPIV4AsnIpiV41.ipi in the -# ip-intelligence-data repo), so the current name is used here. +# data repository), so the current name is used here. ENTERPRISE_DATAFILE_NAME = '51Degrees-IPIV4EnterpriseIpiV41.ipi' -LITE_DATAFILE_NAME = '51Degrees-LiteIpiV41.ipi' -# The ASN data file is the freely available data file committed -# to the ip-intelligence-data submodule. It only contains the network -# (ASN) properties, but is useful for testing the on-premise engine against -# the current data format without an enterprise data file. +# The free Lite data file, named as the data repository links to it. +LITE_DATAFILE_NAME = '51Degrees-LiteV41.ipi' +# The ASN data file is a freely available data file the data repository +# links to. It only contains the network (ASN) properties, but is useful for +# testing the on-premise engine against the current data format without an +# enterprise data file. ASN_DATAFILE_NAME = '51Degrees-IPIV4AsnIpiV41.ipi' EVIDENCE_FILE_NAME = 'evidence.yml' diff --git a/ip-intelligence/fiftyone_ipintelligence_translation/.gitignore b/ip-intelligence/fiftyone_ipintelligence_translation/.gitignore index 36ed5ddc..c39739ff 100644 --- a/ip-intelligence/fiftyone_ipintelligence_translation/.gitignore +++ b/ip-intelligence/fiftyone_ipintelligence_translation/.gitignore @@ -1,3 +1,3 @@ -# Translation YAML staged from the ip-intelligence-data submodule at build -# time (see setup.py stage_translations). Not committed; generated on build. +# Translation YAML staged from cxx/data/ip-intelligence at build time (see +# setup.py stage_translations). Not committed; generated on build. src/fiftyone_ipintelligence_translation/translations/ diff --git a/ip-intelligence/fiftyone_ipintelligence_translation/setup.py b/ip-intelligence/fiftyone_ipintelligence_translation/setup.py index a29e4097..3f06c4a4 100644 --- a/ip-intelligence/fiftyone_ipintelligence_translation/setup.py +++ b/ip-intelligence/fiftyone_ipintelligence_translation/setup.py @@ -40,14 +40,17 @@ def read(file_name): def stage_translations(): - """Copy the translation YAML files shipped in the ip-intelligence-data - submodule into the package so they are included in the built distribution. - This mirrors how the .NET project embeds the same files as resources. If the - submodule is not present the package falls back to reading it at run time, - so any failure here is ignored.""" + """Copy the translation YAML files from the data repository, the + cxx/data submodule, into the package so they are included in the built + distribution. This mirrors how the .NET project embeds the same files as + resources. A build from a source distribution has no cxx folder, but its + package already holds the files, so a missing folder is skipped. Any + failure here is ignored, and a package run from a source checkout reads + the folder at run time instead.""" here = os.path.dirname(os.path.abspath(__file__)) - source = os.path.join(here, "..", "ip-intelligence-data", "Translations") + source = os.path.join( + here, "..", "..", "cxx", "data", "ip-intelligence", "Translations") dest = os.path.join( here, "src", "fiftyone_ipintelligence_translation", "translations") if not os.path.isdir(source): diff --git a/ip-intelligence/fiftyone_ipintelligence_translation/src/fiftyone_ipintelligence_translation/resources.py b/ip-intelligence/fiftyone_ipintelligence_translation/src/fiftyone_ipintelligence_translation/resources.py index eb9aff55..4c0ffc4c 100644 --- a/ip-intelligence/fiftyone_ipintelligence_translation/src/fiftyone_ipintelligence_translation/resources.py +++ b/ip-intelligence/fiftyone_ipintelligence_translation/src/fiftyone_ipintelligence_translation/resources.py @@ -30,14 +30,15 @@ def _find_submodule_translations(): - """Walk up from this package looking for the ip-intelligence-data - submodule's Translations directory, used when the package is run from a - source checkout rather than an installed distribution.""" + """Walk up from this package looking for the data repository's + Translations directory, cxx/data/ip-intelligence/Translations, used when + the package is run from a source checkout rather than an installed + distribution.""" current = _PACKAGE_DIR for _ in range(8): candidate = os.path.join( - current, "ip-intelligence-data", "Translations") + current, "cxx", "data", "ip-intelligence", "Translations") if os.path.isdir(candidate): return candidate parent = os.path.dirname(current) @@ -50,9 +51,9 @@ def _find_submodule_translations(): def _translation_files(): """Return a dict of translation file name -> absolute path. The packaged - translations directory is preferred; if it is empty the ip-intelligence-data - submodule is used as a fallback (countrycodes at the root, countries under - OSM).""" + translations directory is preferred; if it is empty the data repository's + Translations directory is used as a fallback (countrycodes at the root, + countries under OSM).""" files = {} diff --git a/ip-intelligence/fiftyone_ipintelligence_translation/tests/test_translation.py b/ip-intelligence/fiftyone_ipintelligence_translation/tests/test_translation.py index 4decac97..199ca3b6 100644 --- a/ip-intelligence/fiftyone_ipintelligence_translation/tests/test_translation.py +++ b/ip-intelligence/fiftyone_ipintelligence_translation/tests/test_translation.py @@ -20,6 +20,7 @@ # such notice(s) shall fulfill the requirements of that article. # ********************************************************************* +import os import unittest import yaml @@ -34,6 +35,7 @@ from fiftyone_ipintelligence_translation.countries_translation_engine_builder import ( CountriesTranslationEngineBuilder) from fiftyone_ipintelligence_translation.comparer import make_comparer +from fiftyone_ipintelligence_translation import resources from fiftyone_ipintelligence_translation.resources import ( get_all_countries, get_country_resources) @@ -448,5 +450,18 @@ def test_population_translated_names(self): self.assertNotEqual(geo_codes[0], pop_codes[0]) +class PackagedTranslationsTests(unittest.TestCase): + + def test_translations_are_packaged(self): + # The tests run against the built package. A build that cannot find + # the data repository's Translations folder still succeeds, without + # the YAML files, and the other tests can still pass by reading the + # folder from the checkout, so this checks the package itself. + folder = resources._PACKAGED_TRANSLATIONS + names = os.listdir(folder) if os.path.isdir(folder) else [] + self.assertIn("countrycodes.en_GB.yml", names) + self.assertIn("countries.de_DE.yml", names) + + if __name__ == "__main__": unittest.main() diff --git a/ip-intelligence/ip-intelligence-data b/ip-intelligence/ip-intelligence-data deleted file mode 160000 index b0f0b6af..00000000 --- a/ip-intelligence/ip-intelligence-data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b0f0b6afe4fe741bc93a7bd6a7a2ad1058dd6e71 diff --git a/ip-intelligence/readme.md b/ip-intelligence/readme.md index 68e79e2e..18d82f7e 100644 --- a/ip-intelligence/readme.md +++ b/ip-intelligence/readme.md @@ -28,10 +28,9 @@ page shows the Python versions that we currently test against. The on-premise engine wraps the native [51degrees-cxx](https://github.com/51Degrees/51degrees-cxx/blob/main/docs/ipi/README.md) -library, and the -[ip-intelligence-data](https://github.com/51Degrees/ip-intelligence-data) -repository (data and evidence files used for testing) is also included, both -as git submodules. When cloning, use: +library, which is included as the `cxx` git submodule. It has the +[data](https://github.com/51Degrees/data) repository (data and evidence files +used for testing) as its own submodule, at `cxx/data`. When cloning, use: ``` git clone --recurse-submodules https://github.com/51Degrees/51degrees-python.git @@ -45,13 +44,25 @@ git submodule update --init --recursive ### Data files -The on-premise engine requires a `.ipi` data file. The -[ip-intelligence-data](https://github.com/51Degrees/ip-intelligence-data) -submodule provides a freely available network-only data file +The on-premise engine requires a `.ipi` data file. The data repository's +`cxx/data/ip-intelligence` folder holds the evidence files used for testing, +and links to a freely available network-only data file (`51Degrees-IPIV4AsnIpiV41.ipi`), which the examples tests and -`CommittedDataFileTests` use, along with the evidence files used for -testing. The on-premise unit tests default to -`assets/51Degrees-LiteIpiV41.ipi`. +`AsnDataFileTests` use. The linked files are not stored in a repository. +Download them from the root of this repository by running: + +``` +sh cxx/data/get-data-files.sh ip-intelligence +``` + +or, in PowerShell: + +``` +./cxx/data/get-data-files.ps1 ip-intelligence +``` + +An example whose file is missing runs the script for that file itself. The +on-premise unit tests default to `assets/51Degrees-LiteIpiV41.ipi`. For the full set of properties (location, registration, etc.) an enterprise data file is required. To obtain one for testing, please @@ -59,12 +70,12 @@ data file is required. To obtain one for testing, please line argument to the examples, or place it within the project space. Note: the engine reads exactly one data file format version, set by -`FIFTYONE_DEGREES_IPI_TARGET_VERSION_MAJOR` and `_MINOR` in the -`ip-intelligence-cxx` submodule's `src/ipi.c`, and refuses any other as -"an unsupported version". Move the `ip-intelligence-cxx` and -`ip-intelligence-data` pins together. `CommittedDataFileTests` in +`FIFTYONE_DEGREES_IPI_TARGET_VERSION_MAJOR` and `_MINOR` in the `cxx` +submodule's `src/ipi/ipi.c`, and refuses any other as "an unsupported +version". The ASN data file is downloaded from the Distributor, which always +serves the latest one published, so `AsnDataFileTests` in [test_ipintelligence.py](fiftyone_ipintelligence_onpremise/tests/test_ipintelligence.py) -fails when the two disagree. +fails when the engine cannot read the format 51Degrees publishes. ## Folders @@ -77,8 +88,6 @@ fails when the two disagree. wraps ip-intelligence-cxx via SWIG. - `fiftyone_ipintelligence_shared` - code shared between the engines. - `fiftyone_ipintelligence_examples` - usage examples for both engines. -- `ip-intelligence-data` - submodule containing the test data file and - evidence files used by the examples and tests. ## Installation From 5e5ba20c5b0e506073c5672f9940429a6a364036 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Wed, 4 Nov 2026 16:19:28 +0000 Subject: [PATCH 6/6] Move cxx to the 4.5.103 release cxx moves from f03dbfd6, the head of the cxx change that adds the data submodule (51Degrees/51degrees-cxx#96), to e866f6d3, the 4.5.103 release on cxx main that carries it. Both have the same src/ tree and the same data, device-detection-data and ip-intelligence-data commits, so nothing this repository builds or reads changes. They differ only in cxx's AGENTS.md, README.md and two C Hash examples. The nightly submodule update moves cxx to the head of cxx main, which now has the data folder. --- cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxx b/cxx index f03dbfd6..e866f6d3 160000 --- a/cxx +++ b/cxx @@ -1 +1 @@ -Subproject commit f03dbfd6ab9a7ecc898543936dd0338da0668513 +Subproject commit e866f6d3cea936587790f87967eff7863778b30e