diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ed79653a..ebd1f580 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.8.2 +current_version = 2.0.0 commit = False tag = False diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 09162a5f..5fae229e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,12 +11,9 @@ version: 2 # Set the OS, Python version and other tools you might need build: - - os: ubuntu-22.04 - - tools: - - python: "3.11" + os: ubuntu-22.04 + tools: + python: "3.11" # You can also specify other tool versions: @@ -30,8 +27,7 @@ build: # Build documentation in the "docs/" directory with Sphinx sphinx: - - configuration: docs/conf.py + configuration: docs/conf.py # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs @@ -58,7 +54,5 @@ sphinx: # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: - - install: - - - requirements: docs/requirements.txt \ No newline at end of file + install: + - requirements: docs/requirements.txt diff --git a/AUTHORS.rst b/AUTHORS.rst index c06c7a61..e46e4d9d 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -2,8 +2,10 @@ Authors ======= -* Mohamad Atayi - mentalab.com -* Masooma Fazelian - mentalab.com + * Salman Rahman - mentalab.com * Andrea Escartin - mentalab.com +* Sonja Stefani - mentalab.com +* Mohamad Atayi - mentalab.com +* Masoome Fazelian - mentalab.com * Alex Platt - mentalab.com diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1a5149ad..10967293 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,19 @@ Changelog ========= +3.0.0 (7.6.2024) +------------------ +* Improve Mac OSX support +* Add Support for Explore Pro +* Robust data parsing + +2.0.0 (5.1.2024) +------------------ +* Add Mac OSX support +* Remove browser based visualization support +* Update build script for docs + + 1.8.2 (28.8.2023) ------------------ * Improve explore mock device diff --git a/README.rst b/README.rst index da202144..96cc4ca7 100644 --- a/README.rst +++ b/README.rst @@ -17,9 +17,9 @@ :target: https://pypi.org/project/explorepy -.. |commits-since| image:: https://img.shields.io/github/commits-since/Mentalab-hub/explorepy/v1.8.2.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/Mentalab-hub/explorepy/v2.0.0.svg :alt: Commits since latest release - :target: https://github.com/Mentalab-hub/explorepy/compare/v1.8.2...master + :target: https://github.com/Mentalab-hub/explorepy/compare/v2.0.0...master .. |wheel| image:: https://img.shields.io/pypi/wheel/explorepy.svg @@ -54,13 +54,13 @@ Quick installation ================== For Windows users, the best way to install ``explorepy`` is to download the latest ``explorepy`` version from the `release page `_. Please note that dependencies will install automatically from the release page. -For other operating systems, or to build the package manually on Windows, please refer to the information below. MAC OSX is currently not supported. +For other operating systems, or to build the package manually on Windows, please refer to the information below. Requirements ------------ -* Python 3.7 to Python 3.11. +* Python 3.10 to Python 3.12. * Visual Studio 2015 community edition (Windows only. For package building). * Bluetooth header files (Linux only. Use: ``sudo apt-get install libbluetooth-dev``). diff --git a/docs/conf.py b/docs/conf.py index 1089100e..3fced07a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,10 +26,10 @@ source_suffix = '.rst' master_doc = 'index' project = 'explorepy' -year = '2018-2022' +year = '2018-2024' author = 'Mentalab GmbH.' copyright = '{0}, {1}'.format(year, author) -version = release = '1.8.2' +version = release = '2.0.0' pygments_style = 'trac' templates_path = ['.'] @@ -38,10 +38,10 @@ 'pr': ('https://github.com/Mentalab-hub/explorepy/pull/%s', 'PR #'), } # on_rtd is whether we are on readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +#on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -if not on_rtd: # only set the theme if we're building docs locally - html_theme = 'sphinx_rtd_theme' +#if not on_rtd: # only set the theme if we're building docs locally +html_theme = 'sphinx_rtd_theme' html_use_smartypants = True html_last_updated_fmt = '%b %d, %Y' diff --git a/docs/installation.rst b/docs/installation.rst index 45872b13..6bc7f295 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -4,14 +4,14 @@ Installation Minimal Requirements ------------ -* Python 3.7 to Python 3.11 +* Python 3.10 to Python 3.12 * Microsoft Build Tools for Visual Studio 2019 (only Windows) * 6GB RAM (minimum 1GB *free* RAM during the session) * Intel i5 or higher (2x2.5GHz) CPU Recommended Requirements ------------ -* Python 3.7 to Python 3.11 +* Python 3.10 to Python 3.12 * Microsoft Build Tools for Visual Studio 2019 (only Windows) * 8GB RAM * Intel i7 or higher CPU @@ -25,7 +25,7 @@ Windows Option 1: Installing .exe file (basic) """""""" -*This option is best for users who only intend to use* ``explorepy`` *from a command-line prompt.* +*This option is best for users who only intend to use* ``explorepy`` *via graphical user interface* For example, if you want to quickly visualize and record data, use Option 1. If you intend to add ``explorepy`` commands to a Python script @@ -33,8 +33,11 @@ If you intend to add ``explorepy`` commands to a Python script For an overview of ``explorepy`` commands, click `here `_. -On a Windows machine, ``explorepy`` can be installed using the .exe installable file uploaded to -``explorepy``'s `release page `_. Please note that the dependencies will be installed automatically. +On a Windows machine, standalone desktop software ``explorepy-desktop`` can be installed using the .exe installable file uploaded to +`release page `_. Please note that the dependencies will be installed automatically. + +A standalone Mac installer is also available in ` release page `_ + Option 2: Installing from Python Package Index (PyPI) and pip (advanced) """""""" @@ -48,7 +51,7 @@ To install the ``explorepy`` API and all its dependencies using pip on Windows: 3. Open the Conda command prompt. 4. We recommend using a virtual environment. To do this: - a. In Conda command prompt: ``conda create -n myenv python=3.8`` + a. In Conda command prompt: ``conda create -n myenv python=3.10`` b. Activate the virtual environment: ``conda activate myenv`` 5. Upgrade your pip: ``python -m pip install --upgrade pip`` @@ -56,29 +59,30 @@ To install the ``explorepy`` API and all its dependencies using pip on Windows: Ubuntu ^^^^^^ -1. Install Bluetooth header files using ``sudo apt-get install libbluetooth-dev`` -2. We recommend installing Anaconda. Download and install the `Anaconda Python 3.7 Ubuntu installer `_. +1. From Linux Terminal, run these commands one by one: ``sudo apt-get install libbluetooth-dev`` and ``sudo apt-get install build-essential`` and ``conda install -c conda-forge liblsl``. +2. We recommend installing Anaconda. Download and install the `Anaconda Python 3.10 Ubuntu installer `_. 3. We recommend using a virtual environment in Conda. To do this: - a. In Conda command prompt: ``conda create -n myenv python=3.8`` + a. In Conda command prompt: ``conda create -n myenv python=3.10`` b. Activate the virtual environment: ``conda activate myenv`` 4. Upgrade your pip: ``python -m pip install --upgrade pip`` 5. Run: ``pip install explorepy``, to install ``explorepy`` from PyPI. +6. From Linux Terminal, run: ``sudo apt install libxcb-cursor0`` Mac ^^^ -Please note that Mac OSX is not supported at the moment due to some bluetooth bug from Apple OS updates. 1. Install ``XCode`` from the Mac App store. For this, you may need to upgrade to the latest version of MacOS. For older versions of MacOS, find compatible versions of ``XCode`` `here `_. All old ``XCode`` versions are available `here `_. 2. Accept the license agreement: ``sudo xcodebuild -license`` -3. It is best to install Anaconda. Download and install the `Anaconda Python 3.7 Mac installer `_. For older versions of MacOS, compatible version of Anaconda can be found in `this table `_ and downloaded `here `_. +3. It is best to install Anaconda. Download and install the `Anaconda Python 3.10 Mac installer `_. For older versions of MacOS, compatible version of Anaconda can be found in `this table `_ and downloaded `here `_. 4. We recommend using a virtual environment in Conda. - a. In Conda command prompt: ``conda create -n myenv python=3.8`` + a. In Conda command prompt: ``conda create -n myenv python=3.10`` b. Activate the virtual environment: ``conda activate myenv`` 5. Upgrade your pip: ``python -m pip install --upgrade pip`` 6. Run: ``pip install explorepy``, to install ``explorepy`` from PyPI. +7. Connect your Explore device from Mac Bluetooth menu and run your Python script. Quick test ---------- @@ -91,75 +95,19 @@ Quick test Troubleshooting --------------- -**1. Pylsl import issue** - -:: - - self._handle = _dlopen(self._name, mode) - OSError: [WinError 126] The specified module could not be found - - -Solution: Install an older version of Pylsl. To do this, run: :: - - pip install pylsl==1.13.1 - -Alternatively, install `MS Visual C++ redistributable (vc_redist) `_. - --------------------- - - -**2. Anaconda asyncio events library raises "NotImplementedError" error in Windows** - -:: - - File "c:\users\jose\anaconda3\lib\site-packages\bokeh\server\server.py", line 407, in __init__ - http_server.add_sockets(sockets) - File "c:\users\jose\anaconda3\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets - self._handlers[sock.fileno()] = add_accept_handler( - File "c:\users\jose\anaconda3\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler - io_loop.add_handler(sock, accept_handler, IOLoop.READ) - File "c:\users\jose\anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler - self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ) - File "c:\users\jose\anaconda3\lib\asyncio\events.py", line 501, in add_reader - raise NotImplementedError - -Solution: Downgrade your Anaconda distribution to version 3.6 or 3.7. - ---------------------- - -**3. No module named 'numpy'** - -:: - - ERROR: Command errored out with exit status 4294967295: - command: 'C:\Users\mh\Anaconda3\envs\test130_38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mh_at\\AppData\\Local\\Temp\\pip-install-6fpsl7b1\\pyedflib_e1c2dcc3a4dc46af9468c24083cbda2b\\setup.py'"'"'; __file__='"'"'C:\\Users\\mh_at\\AppData\\Local\\Temp\\pip-install-6fpsl7b1\\pyedflib_e1c2dcc3a4dc46af9468c24083cbda2b\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\mh_at\AppData\Local\Temp\pip-pip-egg-info-48yn2fu3' - cwd: C:\Users\mh\AppData\Local\Temp\pip-install-6fpsl7b1\pyedflib_e1c2dcc3a4dc46af9468c24083cbda2b\ - Complete output (4 lines): - No module named 'numpy' - *** package "numpy" not found *** - pyEDFlib requires a version of NumPy, even for setup. - Please get it from http://numpy.scipy.org/ or install it through your package manager. - ---------------------------------------- - ERROR: Command errored out with exit status 4294967295: python setup.py egg_info Check the logs for full command output. - - -Solution: Install numpy separately using ``pip install numpy`` and then install ``explorepy``. - ---------------------- - -**4. OSError: A socket operation was attempted to an unreachable network.** +**1. OSError: A socket operation was attempted to an unreachable network.** Solution: Ensure that your Explore device is paired with your computer and try again. --------------------- -**5. ValueError: Error opening socket.** +**2. ValueError: Error opening socket.** Solution: Ensure the Bluetooth module of your computer's operating system is on and working. --------------------- -**6. OSError: The handle is invalid.** +**3. OSError: The handle is invalid.** Solution: Ensure the Bluetooth module of your computer's operating system is on and working. diff --git a/docs/logo.png b/docs/logo.png index 066b2f4b..5ad665cc 100644 Binary files a/docs/logo.png and b/docs/logo.png differ diff --git a/docs/requirements.txt b/docs/requirements.txt index 848c76f9..e16ef5a0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -12,3 +12,5 @@ PyYAML==6.0.1 scipy==1.11.1 sentry_sdk==1.19.1 tornado==6.3.2 +sphinx-rtd-theme==1.3.0 +sphinx==7.2.4 diff --git a/examples/p300_demo/analysis_csv_4_channel.py b/examples/p300_demo/analysis_csv_4_channel.py index 8845a21e..728032ea 100644 --- a/examples/p300_demo/analysis_csv_4_channel.py +++ b/examples/p300_demo/analysis_csv_4_channel.py @@ -67,8 +67,8 @@ def main(): lf = .5 hf = 40 - label_target = 11 - label_nontarget = 10 + label_target = 'sw_11' + label_nontarget = 'sw_10' t_min = -.3 t_max = 1. diff --git a/examples/p300_demo/analysis_csv_8_channel.py b/examples/p300_demo/analysis_csv_8_channel.py index ef5c5cf9..d98a4eb4 100644 --- a/examples/p300_demo/analysis_csv_8_channel.py +++ b/examples/p300_demo/analysis_csv_8_channel.py @@ -67,8 +67,8 @@ def main(): lf = .5 hf = 40 - label_target = 11 - label_nontarget = 10 + label_target = 'sw_11' + label_nontarget = 'sw_10' t_min = -.3 t_max = 1. diff --git a/examples/ssvep_demo/ssvep.py b/examples/ssvep_demo/ssvep.py index 637081c0..0ef11ef9 100644 --- a/examples/ssvep_demo/ssvep.py +++ b/examples/ssvep_demo/ssvep.py @@ -4,6 +4,7 @@ """ import time from threading import Lock +from psychopy_visionscience.radial import RadialStim from psychopy import visual, event import numpy as np from analysis import CCAAnalysis @@ -29,9 +30,9 @@ def __init__(self, window, size, position, n_frame, log_time=False): pattern = np.ones((4, 4)) pattern[::2, ::2] *= -1 pattern[1::2, 1::2] *= -1 - self._stim1 = visual.RadialStim(win=self._window, tex=pattern, pos=position, + self._stim1 = RadialStim(win=self._window, tex=pattern, pos=position, size=size, radialCycles=1, texRes=256, opacity=1) - self._stim2 = visual.RadialStim(win=self._window, tex=pattern*-1, pos=position, + self._stim2 = RadialStim(win=self._window, tex=pattern*-1, pos=position, size=size, radialCycles=1, texRes=256, opacity=1) self._toggle_flag = False self.log_time = log_time diff --git a/installer/windows/README.md b/installer/windows/README.md index 285a662b..8b9561a2 100644 --- a/installer/windows/README.md +++ b/installer/windows/README.md @@ -26,7 +26,7 @@ Tested versions in (brackets). - [NSIS - the Nullsoft Scriptable Install System](https://nsis.sourceforge.io/) (3.06.1) - [Microsoft Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16) - - A local python installation with virtual env support (3.7.7) + - A local python installation with virtual env support (3.10) #### Python wheels diff --git a/installer/windows/installer.cfg b/installer/windows/installer.cfg index d6d666b1..dee88282 100644 --- a/installer/windows/installer.cfg +++ b/installer/windows/installer.cfg @@ -1,6 +1,6 @@ [Application] name=MentaLab ExplorePy -version=1.8.2 +version=2.0.0 entry_point=explorepy.cli:cli console=true icon=mentalab.ico @@ -26,6 +26,7 @@ pypi_wheels = decorator==5.1.1 distlib==0.3.7 eeglabio==0.0.2.post4 + explorepy==2.0.0 fonttools==4.42.1 idna==3.4 importlib-resources==6.0.1 diff --git a/lib/linux/ExploreException.h b/lib/linux/ExploreException.h index db66b8c2..e7ff4441 100644 --- a/lib/linux/ExploreException.h +++ b/lib/linux/ExploreException.h @@ -83,3 +83,22 @@ class ExploreIOException : std::exception } }; + +// class to throw exception when no BT service is available +class ExploreNoBluetoothException : std::exception +{ +private: + std::string message; +public: + ExploreNoBluetoothException(std::string message) NOEXCEPT + { + this->message = message; + + } + + virtual const char* what() const NOEXCEPT + { + return message.c_str(); + } + +}; diff --git a/lib/linux/exploresdk.py b/lib/linux/exploresdk.py index 10677307..5670bacd 100644 --- a/lib/linux/exploresdk.py +++ b/lib/linux/exploresdk.py @@ -1,13 +1,10 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.2.0 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") - # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _exploresdk @@ -29,10 +26,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -61,7 +58,11 @@ class _SwigNonDynamicMeta(type): __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) -import collections.abc +if _swig_python_version_info[0:2] >= (3, 3): + import collections.abc +else: + import collections + class SwigPyIterator(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -70,59 +71,58 @@ def __init__(self, *args, **kwargs): __repr__ = _swig_repr __swig_destroy__ = _exploresdk.delete_SwigPyIterator - def value(self) -> "PyObject *": + def value(self): return _exploresdk.SwigPyIterator_value(self) - def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + def incr(self, n=1): return _exploresdk.SwigPyIterator_incr(self, n) - def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + def decr(self, n=1): return _exploresdk.SwigPyIterator_decr(self, n) - def distance(self, x: "SwigPyIterator") -> "ptrdiff_t": + def distance(self, x): return _exploresdk.SwigPyIterator_distance(self, x) - def equal(self, x: "SwigPyIterator") -> "bool": + def equal(self, x): return _exploresdk.SwigPyIterator_equal(self, x) - def copy(self) -> "swig::SwigPyIterator *": + def copy(self): return _exploresdk.SwigPyIterator_copy(self) - def next(self) -> "PyObject *": + def next(self): return _exploresdk.SwigPyIterator_next(self) - def __next__(self) -> "PyObject *": + def __next__(self): return _exploresdk.SwigPyIterator___next__(self) - def previous(self) -> "PyObject *": + def previous(self): return _exploresdk.SwigPyIterator_previous(self) - def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + def advance(self, n): return _exploresdk.SwigPyIterator_advance(self, n) - def __eq__(self, x: "SwigPyIterator") -> "bool": + def __eq__(self, x): return _exploresdk.SwigPyIterator___eq__(self, x) - def __ne__(self, x: "SwigPyIterator") -> "bool": + def __ne__(self, x): return _exploresdk.SwigPyIterator___ne__(self, x) - def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + def __iadd__(self, n): return _exploresdk.SwigPyIterator___iadd__(self, n) - def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + def __isub__(self, n): return _exploresdk.SwigPyIterator___isub__(self, n) - def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + def __add__(self, n): return _exploresdk.SwigPyIterator___add__(self, n) - def __sub__(self, *args) -> "ptrdiff_t": + def __sub__(self, *args): return _exploresdk.SwigPyIterator___sub__(self, *args) def __iter__(self): return self # Register SwigPyIterator in _exploresdk: _exploresdk.SwigPyIterator_swigregister(SwigPyIterator) - class BTSerialPortBinding(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -132,192 +132,196 @@ def __init__(self, *args, **kwargs): __swig_destroy__ = _exploresdk.delete_BTSerialPortBinding @staticmethod - def Create(address: "std::string", channelID: "int") -> "BTSerialPortBinding *": + def Create(address, channelID): return _exploresdk.BTSerialPortBinding_Create(address, channelID) - def Connect(self) -> "int": + def Connect(self): return _exploresdk.BTSerialPortBinding_Connect(self) - def Close(self) -> "void": + def Close(self): return _exploresdk.BTSerialPortBinding_Close(self) - def Read(self, bt_buffer: "char *") -> "void": + def Read(self, bt_buffer): return _exploresdk.BTSerialPortBinding_Read(self, bt_buffer) - def Write(self, write_buffer: "char const *") -> "void": + def Write(self, write_buffer): return _exploresdk.BTSerialPortBinding_Write(self, write_buffer) - def IsDataAvailable(self) -> "bool": + def IsDataAvailable(self): return _exploresdk.BTSerialPortBinding_IsDataAvailable(self) # Register BTSerialPortBinding in _exploresdk: _exploresdk.BTSerialPortBinding_swigregister(BTSerialPortBinding) - -def BTSerialPortBinding_Create(address: "std::string", channelID: "int") -> "BTSerialPortBinding *": - return _exploresdk.BTSerialPortBinding_Create(address, channelID) - -class vectordevice(collections.abc.MutableSequence): +class vectordevice(collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def iterator(self) -> "swig::SwigPyIterator *": + def iterator(self): return _exploresdk.vectordevice_iterator(self) def __iter__(self): return self.iterator() - def __nonzero__(self) -> "bool": + def __nonzero__(self): return _exploresdk.vectordevice___nonzero__(self) - def __bool__(self) -> "bool": + def __bool__(self): return _exploresdk.vectordevice___bool__(self) - def __len__(self) -> "std::vector< device >::size_type": + def __len__(self): return _exploresdk.vectordevice___len__(self) - def __getslice__(self, i: "std::vector< device >::difference_type", j: "std::vector< device >::difference_type") -> "std::vector< device,std::allocator< device > > *": + def __getslice__(self, i, j): return _exploresdk.vectordevice___getslice__(self, i, j) - def __setslice__(self, *args) -> "void": + def __setslice__(self, *args): return _exploresdk.vectordevice___setslice__(self, *args) - def __delslice__(self, i: "std::vector< device >::difference_type", j: "std::vector< device >::difference_type") -> "void": + def __delslice__(self, i, j): return _exploresdk.vectordevice___delslice__(self, i, j) - def __delitem__(self, *args) -> "void": + def __delitem__(self, *args): return _exploresdk.vectordevice___delitem__(self, *args) - def __getitem__(self, *args) -> "std::vector< device >::value_type const &": + def __getitem__(self, *args): return _exploresdk.vectordevice___getitem__(self, *args) - def __setitem__(self, *args) -> "void": + def __setitem__(self, *args): return _exploresdk.vectordevice___setitem__(self, *args) - def pop(self) -> "std::vector< device >::value_type": + def pop(self): return _exploresdk.vectordevice_pop(self) - def append(self, x: "device") -> "void": + def append(self, x): return _exploresdk.vectordevice_append(self, x) - def empty(self) -> "bool": + def empty(self): return _exploresdk.vectordevice_empty(self) - def size(self) -> "std::vector< device >::size_type": + def size(self): return _exploresdk.vectordevice_size(self) - def swap(self, v: "vectordevice") -> "void": + def swap(self, v): return _exploresdk.vectordevice_swap(self, v) - def begin(self) -> "std::vector< device >::iterator": + def begin(self): return _exploresdk.vectordevice_begin(self) - def end(self) -> "std::vector< device >::iterator": + def end(self): return _exploresdk.vectordevice_end(self) - def rbegin(self) -> "std::vector< device >::reverse_iterator": + def rbegin(self): return _exploresdk.vectordevice_rbegin(self) - def rend(self) -> "std::vector< device >::reverse_iterator": + def rend(self): return _exploresdk.vectordevice_rend(self) - def clear(self) -> "void": + def clear(self): return _exploresdk.vectordevice_clear(self) - def get_allocator(self) -> "std::vector< device >::allocator_type": + def get_allocator(self): return _exploresdk.vectordevice_get_allocator(self) - def pop_back(self) -> "void": + def pop_back(self): return _exploresdk.vectordevice_pop_back(self) - def erase(self, *args) -> "std::vector< device >::iterator": + def erase(self, *args): return _exploresdk.vectordevice_erase(self, *args) def __init__(self, *args): _exploresdk.vectordevice_swiginit(self, _exploresdk.new_vectordevice(*args)) - def push_back(self, x: "device") -> "void": + def push_back(self, x): return _exploresdk.vectordevice_push_back(self, x) - def front(self) -> "std::vector< device >::value_type const &": + def front(self): return _exploresdk.vectordevice_front(self) - def back(self) -> "std::vector< device >::value_type const &": + def back(self): return _exploresdk.vectordevice_back(self) - def assign(self, n: "std::vector< device >::size_type", x: "device") -> "void": + def assign(self, n, x): return _exploresdk.vectordevice_assign(self, n, x) - def resize(self, *args) -> "void": + def resize(self, *args): return _exploresdk.vectordevice_resize(self, *args) - def insert(self, *args) -> "void": + def insert(self, *args): return _exploresdk.vectordevice_insert(self, *args) - def reserve(self, n: "std::vector< device >::size_type") -> "void": + def reserve(self, n): return _exploresdk.vectordevice_reserve(self, n) - def capacity(self) -> "std::vector< device >::size_type": + def capacity(self): return _exploresdk.vectordevice_capacity(self) __swig_destroy__ = _exploresdk.delete_vectordevice # Register vectordevice in _exploresdk: _exploresdk.vectordevice_swigregister(vectordevice) - class ExploreException(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, message: "std::string"): + def __init__(self, message): _exploresdk.ExploreException_swiginit(self, _exploresdk.new_ExploreException(message)) - def what(self) -> "char const *": + def what(self): return _exploresdk.ExploreException_what(self) __swig_destroy__ = _exploresdk.delete_ExploreException # Register ExploreException in _exploresdk: _exploresdk.ExploreException_swigregister(ExploreException) - class ExploreReadBufferException(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, message: "std::string"): + def __init__(self, message): _exploresdk.ExploreReadBufferException_swiginit(self, _exploresdk.new_ExploreReadBufferException(message)) - def what(self) -> "char const *": + def what(self): return _exploresdk.ExploreReadBufferException_what(self) __swig_destroy__ = _exploresdk.delete_ExploreReadBufferException # Register ExploreReadBufferException in _exploresdk: _exploresdk.ExploreReadBufferException_swigregister(ExploreReadBufferException) - class ExploreBtSocketException(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, message: "std::string"): + def __init__(self, message): _exploresdk.ExploreBtSocketException_swiginit(self, _exploresdk.new_ExploreBtSocketException(message)) - def what(self) -> "char const *": + def what(self): return _exploresdk.ExploreBtSocketException_what(self) __swig_destroy__ = _exploresdk.delete_ExploreBtSocketException # Register ExploreBtSocketException in _exploresdk: _exploresdk.ExploreBtSocketException_swigregister(ExploreBtSocketException) - class ExploreIOException(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, message: "std::string"): + def __init__(self, message): _exploresdk.ExploreIOException_swiginit(self, _exploresdk.new_ExploreIOException(message)) - def what(self) -> "char const *": + def what(self): return _exploresdk.ExploreIOException_what(self) __swig_destroy__ = _exploresdk.delete_ExploreIOException # Register ExploreIOException in _exploresdk: _exploresdk.ExploreIOException_swigregister(ExploreIOException) +class ExploreNoBluetoothException(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, message): + _exploresdk.ExploreNoBluetoothException_swiginit(self, _exploresdk.new_ExploreNoBluetoothException(message)) + def what(self): + return _exploresdk.ExploreNoBluetoothException_what(self) + __swig_destroy__ = _exploresdk.delete_ExploreNoBluetoothException + +# Register ExploreNoBluetoothException in _exploresdk: +_exploresdk.ExploreNoBluetoothException_swigregister(ExploreNoBluetoothException) class device(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -335,7 +339,6 @@ def __init__(self): # Register device in _exploresdk: _exploresdk.device_swigregister(device) - class ExploreSDK(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -345,20 +348,15 @@ def __init__(self, *args, **kwargs): __swig_destroy__ = _exploresdk.delete_ExploreSDK @staticmethod - def Create() -> "ExploreSDK *": + def Create(): return _exploresdk.ExploreSDK_Create() - def PerformDeviceSearch(self, length: "int"=8) -> "std::vector< device,std::allocator< device > >": + def PerformDeviceSearch(self, length=8): return _exploresdk.ExploreSDK_PerformDeviceSearch(self, length) - def SdpSearch(self, address: "std::string") -> "int": + def SdpSearch(self, address): return _exploresdk.ExploreSDK_SdpSearch(self, address) # Register ExploreSDK in _exploresdk: _exploresdk.ExploreSDK_swigregister(ExploreSDK) -def ExploreSDK_Create() -> "ExploreSDK *": - return _exploresdk.ExploreSDK_Create() - - - diff --git a/lib/linux/swig_interface_wrap.cxx b/lib/linux/swig_interface_wrap.cxx index 83032b36..636f5d69 100644 --- a/lib/linux/swig_interface_wrap.cxx +++ b/lib/linux/swig_interface_wrap.cxx @@ -1,46 +1,17 @@ /* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 + * This file was automatically generated by SWIG (https://www.swig.org). + * Version 4.2.0 * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. + * Do not make changes to this file unless you know what you are doing - modify + * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ -#ifndef SWIGPYTHON +#define SWIG_VERSION 0x040200 #define SWIGPYTHON -#endif - -#define SWIG_PYTHON_THREADS #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #define SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -165,14 +136,38 @@ template T SwigValueInit() { # pragma warning disable 592 #endif +#if __cplusplus >=201103L +# define SWIG_NULLPTR nullptr +#else +# define SWIG_NULLPTR NULL +#endif + #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ # include #endif +#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) +#define PY_SSIZE_T_CLEAN +#endif + +#if __GNUC__ >= 7 +#pragma GCC diagnostic push +#if defined(__cplusplus) && __cplusplus >=201703L +#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ +#endif +#endif + #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ + +#if defined(_MSC_VER) && _MSC_VER >= 1929 +/* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later + * See https://github.com/swig/swig/issues/2090 */ +# include +#endif + # undef _DEBUG # include # define _DEBUG 1 @@ -180,6 +175,12 @@ template T SwigValueInit() { # include #endif +#if __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif + +#include + /* ----------------------------------------------------------------------------- * swigrun.swg * @@ -226,6 +227,8 @@ template T SwigValueInit() { #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 #define SWIG_POINTER_NO_NULL 0x4 +#define SWIG_POINTER_CLEAR 0x8 +#define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN) /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,7 +300,7 @@ template T SwigValueInit() { SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this + allows returning the 'cast rank', for example, if you have this int food(double) int fooi(int); @@ -311,7 +314,13 @@ template T SwigValueInit() { */ #define SWIG_OK (0) +/* Runtime errors are < 0 */ #define SWIG_ERROR (-1) +/* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */ +/* Errors in range -100 to -199 are language specific errors defined in *errors.swg */ +/* Errors < -200 are generic runtime specific errors */ +#define SWIG_ERROR_RELEASE_NOT_OWNED (-200) + #define SWIG_IsOK(r) (r >= 0) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) @@ -319,14 +328,14 @@ template T SwigValueInit() { #define SWIG_CASTRANKLIMIT (1 << 8) /* The NewMask denotes the object was created (using new/malloc) */ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ +/* The TmpMask is for in/out typemaps that use temporary objects */ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) /* Simple returning values */ #define SWIG_BADOBJ (SWIG_ERROR) #define SWIG_OLDOBJ (SWIG_OK) #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ +/* Check, add and del object mask methods */ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) @@ -355,6 +364,23 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif +/* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF + * if you're missing it. + */ +#if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \ + (defined __cplusplus && __cplusplus >= 201103L) || \ + defined SWIG_HAVE_SNPRINTF) && \ + !defined SWIG_NO_SNPRINTF +# define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A) +# define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B) +#else +/* Fallback versions ignore the buffer size, but most of our uses either have a + * fixed maximum possible size or dynamically allocate a buffer that's large + * enough. + */ +# define SWIG_snprintf(O,S,F,A) sprintf(O,F,A) +# define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B) +#endif #include @@ -472,7 +498,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { +SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { @@ -532,9 +558,9 @@ SWIG_TypeName(const swig_type_info *ty) { SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ + type, separated by vertical-bar characters. Choose the last + name. It should be the most specific; a fully resolved name + but not necessarily with default template parameters expanded. */ if (!type) return NULL; if (type->str != NULL) { const char *last_name = type->str; @@ -754,7 +780,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { } #endif -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -770,7 +796,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define SWIG_NullReferenceError -13 - /* Compatibility macros for Python 3 */ #if PY_VERSION_HEX >= 0x03000000 @@ -786,7 +811,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define PyString_Size(str) PyBytes_Size(str) #define PyString_InternFromString(key) PyUnicode_InternFromString(key) #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) #endif @@ -804,36 +828,29 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #endif -/* Warning: This function will allocate a new string in Python 3, - * so please call SWIG_Python_str_DelForPy3(x) to free the space. - */ -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) +/* Wrapper around PyUnicode_AsUTF8AndSize - call Py_XDECREF on the returned pbytes when finished with the returned string */ +SWIGINTERN const char * +SWIG_PyUnicode_AsUTF8AndSize(PyObject *str, Py_ssize_t *psize, PyObject **pbytes) { -#if PY_VERSION_HEX >= 0x03000000 - char *newstr = 0; - str = PyUnicode_AsUTF8String(str); - if (str) { - char *cstr; - Py_ssize_t len; - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - } - return newstr; +#if PY_VERSION_HEX >= 0x03030000 +# if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 + *pbytes = NULL; + return PyUnicode_AsUTF8AndSize(str, psize); +# else + *pbytes = PyUnicode_AsUTF8String(str); + const char *chars = *pbytes ? PyBytes_AsString(*pbytes) : NULL; + if (chars && psize) + *psize = PyBytes_Size(*pbytes); + return chars; +# endif #else - return PyString_AsString(str); + char *chars = NULL; + *pbytes = NULL; + PyString_AsStringAndSize(str, &chars, psize); + return chars; #endif } -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) -#else -# define SWIG_Python_str_DelForPy3(x) -#endif - - SWIGINTERN PyObject* SWIG_Python_str_FromChar(const char *c) { @@ -848,10 +865,14 @@ SWIG_Python_str_FromChar(const char *c) # define PyObject_DEL PyObject_Del #endif -// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user -// interface files check for it. +/* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */ # define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) +#ifdef SWIGPYTHON_BUILTIN +# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME +#else +# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME +#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME) #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) @@ -859,6 +880,20 @@ SWIG_Python_str_FromChar(const char *c) #define Py_hash_t long #endif +#ifdef Py_LIMITED_API +# define PyTuple_GET_ITEM PyTuple_GetItem +/* Note that PyTuple_SetItem() has different semantics from PyTuple_SET_ITEM as it decref's the original tuple item, so in general they cannot be used + interchangeably. However in SWIG-generated code PyTuple_SET_ITEM is only used with newly initialized tuples without any items and for them this does work. */ +# define PyTuple_SET_ITEM PyTuple_SetItem +# define PyTuple_GET_SIZE PyTuple_Size +# define PyCFunction_GET_FLAGS PyCFunction_GetFlags +# define PyCFunction_GET_FUNCTION PyCFunction_GetFunction +# define PyCFunction_GET_SELF PyCFunction_GetSelf +# define PyList_GET_ITEM PyList_GetItem +# define PyList_SET_ITEM PyList_SetItem +# define PySliceObject PyObject +#endif + /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ @@ -918,14 +953,15 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); + PyObject *bytes = NULL; + const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes); PyErr_Clear(); Py_XINCREF(type); if (tmp) PyErr_Format(type, "%s %s", tmp, mesg); else PyErr_Format(type, "%s", mesg); - SWIG_Python_str_DelForPy3(tmp); + Py_XDECREF(bytes); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -956,8 +992,12 @@ SWIG_Python_RaiseOrModifyTypeError(const char *message) #else newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); #endif - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); + if (newvalue) { + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + PyErr_Restore(type, value, traceback); + } } else { /* Raise TypeError using given message */ PyErr_SetString(PyExc_TypeError, message); @@ -974,8 +1014,12 @@ SWIG_Python_RaiseOrModifyTypeError(const char *message) # define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# if PY_VERSION_HEX < 0x03070000 +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# else +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif # endif # ifdef __cplusplus /* C++ code */ class SWIG_Python_Thread_Block { @@ -990,7 +1034,7 @@ SWIG_Python_RaiseOrModifyTypeError(const char *message) bool status; PyThreadState *save; public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + void end() { if (status) { status = false; PyEval_RestoreThread(save); }} SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} ~SWIG_Python_Thread_Allow() { end(); } }; @@ -1073,8 +1117,8 @@ typedef struct swig_const_info { # error "This version of SWIG only supports Python >= 2.7" #endif -#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 -# error "This version of SWIG only supports Python 3 >= 3.2" +#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000 +# error "This version of SWIG only supports Python 3 >= 3.3" #endif /* Common SWIG API */ @@ -1189,7 +1233,12 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { if (!PyList_Check(result)) { PyObject *o2 = result; result = PyList_New(1); - PyList_SetItem(result, 0, o2); + if (result) { + PyList_SET_ITEM(result, 0, o2); + } else { + Py_DECREF(obj); + return o2; + } } PyList_Append(result,obj); Py_DECREF(obj); @@ -1245,6 +1294,19 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } } +SWIGINTERN int +SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + /* A functor is a function object with one single object argument */ #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); @@ -1258,6 +1320,261 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var #endif +#ifdef __cplusplus +extern "C" { +#endif + +/* Python-specific SWIG API */ +#define SWIG_newvarlink() SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) + +/* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + +typedef struct swig_globalvar { + char *name; /* Name of global variable */ + PyObject *(*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject *); /* Set the value */ + struct swig_globalvar *next; +} swig_globalvar; + +typedef struct swig_varlinkobject { + PyObject_HEAD + swig_globalvar *vars; +} swig_varlinkobject; + +SWIGINTERN PyObject * +swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else + return PyString_FromString(""); +#endif +} + +SWIGINTERN PyObject * +swig_varlink_str(PyObject *o) { + swig_varlinkobject *v = (swig_varlinkobject *) o; +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else + PyObject *str = PyString_FromString("("); + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + PyString_ConcatAndDel(&str,PyString_FromString(var->name)); + if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); + } + PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif + return str; +} + +SWIGINTERN void +swig_varlink_dealloc(PyObject *o) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + swig_globalvar *var = v->vars; + while (var) { + swig_globalvar *n = var->next; + free(var->name); + free(var); + var = n; + } +} + +SWIGINTERN PyObject * +swig_varlink_getattr(PyObject *o, char *n) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + PyObject *res = NULL; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->get_attr)(); + break; + } + var = var->next; + } + if (res == NULL && !PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN int +swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + int res = 1; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->set_attr)(p); + break; + } + var = var->next; + } + if (res == 1 && !PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN PyTypeObject* +swig_varlink_type(void) { + static char varlink__doc__[] = "Swig var link object"; +#ifndef Py_LIMITED_API + static PyTypeObject varlink_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) swig_varlink_dealloc, /* tp_dealloc */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif + (getattrfunc) swig_varlink_getattr, /* tp_getattr */ + (setattrfunc) swig_varlink_setattr, /* tp_setattr */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) swig_varlink_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + varlink__doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; + if (PyType_Ready(&varlink_type) < 0) + return NULL; + } + return &varlink_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)swig_varlink_dealloc }, + { Py_tp_repr, (void *)swig_varlink_repr }, + { Py_tp_getattr, (void *)swig_varlink_getattr }, + { Py_tp_setattr, (void *)swig_varlink_setattr }, + { Py_tp_str, (void *)swig_varlink_str }, + { Py_tp_doc, (void *)varlink__doc__ }, + { 0, NULL } + }; + PyType_Spec spec = { + "swigvarlink", + sizeof(swig_varlinkobject), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif +} + +/* Create a variable linking object for use later */ +SWIGINTERN PyObject * +SWIG_Python_newvarlink(void) { + swig_varlinkobject *result = PyObject_New(swig_varlinkobject, swig_varlink_type()); + if (result) { + result->vars = 0; + } + return ((PyObject*) result); +} + +SWIGINTERN void +SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + swig_varlinkobject *v = (swig_varlinkobject *) p; + swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); + if (gv) { + size_t size = strlen(name)+1; + gv->name = (char *)malloc(size); + if (gv->name) { + memcpy(gv->name, name, size); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + } + } + v->vars = gv; +} + + +static PyObject *Swig_Globals_global = NULL; + +SWIGINTERN PyObject * +SWIG_globals(void) { + if (Swig_Globals_global == NULL) { + Swig_Globals_global = SWIG_newvarlink(); + } + return Swig_Globals_global; +} + +#ifdef __cplusplus +} +#endif + /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ @@ -1328,18 +1645,25 @@ SwigPyClientData_New(PyObject* obj) /* the newraw method and newargs arguments used to create a new raw instance */ if (PyClass_Check(obj)) { data->newraw = 0; - data->newargs = obj; Py_INCREF(obj); + data->newargs = obj; } else { data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); + data->newargs = PyTuple_New(1); + if (data->newargs) { + Py_INCREF(obj); + PyTuple_SET_ITEM(data->newargs, 0, obj); + } else { + Py_DECREF(data->newraw); + Py_DECREF(data->klass); + free(data); + return 0; + } } else { - data->newargs = obj; + Py_INCREF(obj); + data->newargs = obj; } - Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); @@ -1348,10 +1672,7 @@ SwigPyClientData_New(PyObject* obj) data->destroy = 0; } if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); - data->delargs = !(flags & (METH_O)); + data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O); } else { data->delargs = 0; } @@ -1362,10 +1683,13 @@ SwigPyClientData_New(PyObject* obj) } SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { +SwigPyClientData_Del(SwigPyClientData *data) +{ + Py_XDECREF(data->klass); Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); + free(data); } /* =============== SwigPyObject =====================*/ @@ -1392,7 +1716,7 @@ SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) if (!sobj->dict) sobj->dict = PyDict_New(); - Py_INCREF(sobj->dict); + Py_XINCREF(sobj->dict); return sobj->dict; } @@ -1410,18 +1734,21 @@ SwigPyObject_format(const char* fmt, SwigPyObject *v) PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { - PyObject *ofmt = SWIG_Python_str_FromChar(fmt); + PyObject *val = SwigPyObject_long(v); + if (val) { + PyObject *ofmt; + PyTuple_SET_ITEM(args, 0, val); + ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { #if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); + res = PyUnicode_Format(ofmt,args); #else - res = PyString_Format(ofmt,args); + res = PyString_Format(ofmt,args); #endif - Py_DECREF(ofmt); + Py_DECREF(ofmt); } - Py_DECREF(args); } + Py_DECREF(args); } return res; } @@ -1443,18 +1770,23 @@ SwigPyObject_repr(SwigPyObject *v) { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { + if (repr && v->next) { PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); + if (nrep) { # if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; # else - PyString_ConcatAndDel(&repr,nrep); + PyString_ConcatAndDel(&repr,nrep); # endif + } else { + Py_DecRef(repr); + repr = NULL; + } } - return repr; + return repr; } /* We need a version taking two PyObject* parameters so it's a valid @@ -1477,12 +1809,14 @@ SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) SWIGRUNTIME PyObject* SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) { - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + PyObject* res = NULL; + if (!PyErr_Occurred()) { + if (op != Py_EQ && op != Py_NE) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); return res; } @@ -1510,20 +1844,34 @@ SwigPyObject_type(void) { SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) + PyTypeObject *op_type = Py_TYPE(op); +#ifdef SWIGPYTHON_BUILTIN + if (PyType_IsSubtype(op_type, target_tp)) return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); + return (strcmp(op_type->tp_name, "SwigPyObject") == 0); #else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); + if (op_type == target_tp) + return 1; +# ifdef Py_LIMITED_API + int cmp; + PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__"); + if (!tp_name) + return 0; + cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyObject"); + Py_DECREF(tp_name); + return cmp == 0; +# else + return (strcmp(op_type->tp_name, "SwigPyObject") == 0); +# endif #endif } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own); +static PyObject* Swig_Capsule_global = NULL; + SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v) { @@ -1550,8 +1898,12 @@ SwigPyObject_dealloc(PyObject *v) if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); + if (tmp) { + res = SWIG_Python_CallFunctor(destroy, tmp); + } else { + res = 0; + } + Py_XDECREF(tmp); } else { PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); PyObject *mself = PyCFunction_GET_SELF(destroy); @@ -1570,8 +1922,12 @@ SwigPyObject_dealloc(PyObject *v) printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); } #endif - } + Py_XDECREF(Swig_Capsule_global); + } Py_XDECREF(next); +#ifdef SWIGPYTHON_BUILTIN + Py_XDECREF(sobj->dict); +#endif PyObject_DEL(v); } @@ -1583,6 +1939,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; } + ((SwigPyObject *)next)->next = sobj->next; sobj->next = next; Py_INCREF(next); return SWIG_Py_Void(); @@ -1627,9 +1984,9 @@ SwigPyObject_own(PyObject *v, PyObject *args) PyObject *obj = PyBool_FromLong(sobj->own); if (val) { if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); + Py_DECREF(SwigPyObject_acquire(v,args)); } else { - SwigPyObject_disown(v,args); + Py_DECREF(SwigPyObject_disown(v,args)); } } return obj; @@ -1650,7 +2007,7 @@ swigobject_methods[] = { SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - +#ifndef Py_LIMITED_API static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ @@ -1709,7 +2066,11 @@ SwigPyObject_TypeOnce(void) { sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 @@ -1758,6 +2119,15 @@ SwigPyObject_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -1768,21 +2138,50 @@ SwigPyObject_TypeOnce(void) { }; swigpyobject_type = tmp; type_init = 1; - if (PyType_Ready(&swigpyobject_type) < 0) + if (PyType_Ready(&swigpyobject_type) != 0) return NULL; } return &swigpyobject_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)SwigPyObject_dealloc }, + { Py_tp_repr, (void *)SwigPyObject_repr }, + { Py_tp_getattro, (void *)PyObject_GenericGetAttr }, + { Py_tp_doc, (void *)swigobject_doc }, + { Py_tp_richcompare, (void *)SwigPyObject_richcompare }, + { Py_tp_methods, (void *)swigobject_methods }, + { Py_nb_int, (void *)SwigPyObject_long }, + { 0, NULL } + }; + PyType_Spec spec = { + "SwigPyObject", + sizeof(SwigPyObject), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + SwigPyObject *sobj = PyObject_New(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; sobj->own = own; sobj->next = 0; +#ifdef SWIGPYTHON_BUILTIN + sobj->dict = 0; +#endif + if (own == SWIG_POINTER_OWN) { + /* Obtain a reference to the Python capsule wrapping the module information, so that the + * module information is correctly destroyed after all SWIG python objects have been freed + * by the GC (and corresponding destructors invoked) */ + Py_XINCREF(Swig_Capsule_global); + } } return (PyObject *)sobj; } @@ -1839,8 +2238,20 @@ SwigPyPacked_type(void) { SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); + PyTypeObject* op_type = Py_TYPE(op); + if (op_type == SwigPyPacked_TypeOnce()) + return 1; +#ifdef Py_LIMITED_API + int cmp; + PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__"); + if (!tp_name) + return 0; + cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyPacked"); + Py_DECREF(tp_name); + return cmp == 0; +#else + return (strcmp(op_type->tp_name, "SwigPyPacked") == 0); +#endif } SWIGRUNTIME void @@ -1856,6 +2267,7 @@ SwigPyPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; +#ifndef Py_LIMITED_API static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { @@ -1870,7 +2282,11 @@ SwigPyPacked_TypeOnce(void) { sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - 0, /* tp_print */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -1919,6 +2335,15 @@ SwigPyPacked_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, /* tp_watched */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -1929,16 +2354,34 @@ SwigPyPacked_TypeOnce(void) { }; swigpypacked_type = tmp; type_init = 1; - if (PyType_Ready(&swigpypacked_type) < 0) + if (PyType_Ready(&swigpypacked_type) != 0) return NULL; } return &swigpypacked_type; +#else + PyType_Slot slots[] = { + { Py_tp_dealloc, (void *)SwigPyPacked_dealloc }, + { Py_tp_repr, (void *)SwigPyPacked_repr }, + { Py_tp_str, (void *)SwigPyPacked_str }, + { Py_tp_getattro, (void *)PyObject_GenericGetAttr }, + { Py_tp_doc, (void *)swigpacked_doc }, + { 0, NULL } + }; + PyType_Spec spec = { + "SwigPyPacked", + sizeof(SwigPyPacked), + 0, + Py_TPFLAGS_DEFAULT, + slots + }; + return (PyTypeObject *)PyType_FromSpec(&spec); +#endif } SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + SwigPyPacked *sobj = PyObject_New(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -2119,12 +2562,19 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; + if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) { + res = SWIG_ERROR_RELEASE_NOT_OWNED; + } else { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + if (flags & SWIG_POINTER_CLEAR) { + sobj->ptr = 0; + } + res = SWIG_OK; } - res = SWIG_OK; } else { if (implicit_conv) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; @@ -2183,10 +2633,20 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { swig_cast_info *tc; /* here we get the method pointer for callbacks */ +#ifndef Py_LIMITED_API const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); +#else + PyObject* pystr_doc = PyObject_GetAttrString(obj, "__doc__"); + PyObject *bytes = NULL; + const char *doc = pystr_doc ? SWIG_PyUnicode_AsUTF8AndSize(pystr_doc, NULL, &bytes) : 0; +#endif const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; +#ifdef Py_LIMITED_API + Py_XDECREF(bytes); + Py_XDECREF(pystr_doc); +#endif if (!desc) return SWIG_ERROR; tc = SWIG_TypeCheck(desc,ty); @@ -2237,16 +2697,23 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + } else{ + Py_DECREF(inst); + inst = 0; + } } #else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } #endif } } else { @@ -2255,11 +2722,20 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) if (empty_args) { PyObject *empty_kwargs = PyDict_New(); if (empty_kwargs) { - inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); +#ifndef Py_LIMITED_API + newfunc newfn = ((PyTypeObject *)data->newargs)->tp_new; +#else + newfunc newfn = (newfunc)PyType_GetSlot((PyTypeObject *)data->newargs, Py_tp_new); +#endif + inst = newfn((PyTypeObject *)data->newargs, empty_args, empty_kwargs); Py_DECREF(empty_kwargs); if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } else { + PyType_Modified(Py_TYPE(inst)); + } } } Py_DECREF(empty_args); @@ -2276,25 +2752,25 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) return inst; } -SWIGRUNTIME void +SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { - PyObject *dict; #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + if (dict) { + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } else{ + return -1; + } + } #endif - dict = PyObject_GetAttrString(inst, "__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); + return PyObject_SetAttr(inst, SWIG_This(), swig_this); } @@ -2306,9 +2782,10 @@ SWIG_Python_InitShadowInstance(PyObject *args) { } else { SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); + Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1])); } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; } return SWIG_Py_Void(); } @@ -2332,7 +2809,12 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f if (flags & SWIG_BUILTIN_TP_INIT) { newobj = (SwigPyObject*) self; if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); +#ifndef Py_LIMITED_API + allocfunc alloc = clientdata->pytype->tp_alloc; +#else + allocfunc alloc = (allocfunc)PyType_GetSlot(clientdata->pytype, Py_tp_alloc); +#endif + PyObject *next_self = alloc(clientdata->pytype, 0); while (newobj->next) newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; @@ -2344,7 +2826,9 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); #ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; + if (newobj) { + newobj->dict = 0; + } #endif } if (newobj) { @@ -2383,39 +2867,61 @@ SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { void *SWIG_ReturnGlobalTypeList(void *); #endif +static PyObject *Swig_TypeCache_global = NULL; + +/* The python cached type query */ +SWIGRUNTIME PyObject * +SWIG_Python_TypeCache(void) { + if (Swig_TypeCache_global == NULL) { + Swig_TypeCache_global = PyDict_New(); + } + return Swig_TypeCache_global; +} + SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { +#ifdef SWIG_LINK_RUNTIME static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); + } #else - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif + void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; } +#endif return (swig_module_info *) type_pointer; } + +static int interpreter_counter = 0; /* how many (sub-)interpreters are using swig_module's types */ + SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj) { swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); swig_type_info **types = swig_module->types; size_t i; + if (--interpreter_counter != 0) /* another sub-interpreter may still be using the swig_module's types */ + return; for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + ty->clientdata = 0; if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); Swig_This_global = NULL; + Py_DECREF(SWIG_globals()); + Swig_Globals_global = NULL; + Py_DECREF(SWIG_Python_TypeCache()); + Swig_TypeCache_global = NULL; + Swig_Capsule_global = NULL; } SWIGRUNTIME void @@ -2429,19 +2935,17 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { #endif PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { - PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) { + ++interpreter_counter; + Swig_Capsule_global = pointer; + } else { + Py_DECREF(pointer); + } } else { Py_XDECREF(pointer); } } -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { @@ -2456,8 +2960,10 @@ SWIG_Python_TypeQuery(const char *type) descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { obj = PyCapsule_New((void*) descriptor, NULL, NULL); - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); + if (obj) { + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } } } Py_DECREF(key); @@ -2481,7 +2987,8 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyErr_Fetch(&type, &value, &traceback); if (value) { PyObject *old_str = PyObject_Str(value); - const char *tmp = SWIG_Python_str_AsChar(old_str); + PyObject *bytes = NULL; + const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes); const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); @@ -2490,7 +2997,7 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) } else { PyErr_Format(type, "%s %s", errmesg, mesg); } - SWIG_Python_str_DelForPy3(tmp); + Py_XDECREF(bytes); Py_DECREF(old_str); } return 1; @@ -2535,21 +3042,25 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) } else #endif { +#ifndef Py_LIMITED_API + /* tp_name is not accessible */ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; + PyObject *bytes = NULL; + const char *cstr = str ? SWIG_PyUnicode_AsUTF8AndSize(str, NULL, &bytes) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); - SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } + Py_XDECREF(bytes); Py_XDECREF(str); return; } +#endif } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { @@ -2564,12 +3075,6 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(arg void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); -#if SWIG_POINTER_EXCEPTION - if (flags) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } -#endif } return result; } @@ -2600,7 +3105,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { } if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) + if (PyType_Ready(tp) != 0) goto done; } @@ -2615,7 +3120,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { } else { encoded_name = PyUnicode_AsUTF8String(name); if (!encoded_name) - return -1; + goto done; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2638,23 +3143,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Method creation and docstring support functions */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); +#define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0) -#ifdef __cplusplus -} -#endif #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) @@ -2666,24 +3156,25 @@ SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyO #define SWIGTYPE_p_ExploreBtSocketException swig_types[1] #define SWIGTYPE_p_ExploreException swig_types[2] #define SWIGTYPE_p_ExploreIOException swig_types[3] -#define SWIGTYPE_p_ExploreReadBufferException swig_types[4] -#define SWIGTYPE_p_ExploreSDK swig_types[5] -#define SWIGTYPE_p_allocator_type swig_types[6] -#define SWIGTYPE_p_char swig_types[7] -#define SWIGTYPE_p_device swig_types[8] -#define SWIGTYPE_p_difference_type swig_types[9] -#define SWIGTYPE_p_int swig_types[10] -#define SWIGTYPE_p_p_PyObject swig_types[11] -#define SWIGTYPE_p_size_type swig_types[12] -#define SWIGTYPE_p_std__allocatorT_device_t swig_types[13] -#define SWIGTYPE_p_std__exception swig_types[14] -#define SWIGTYPE_p_std__invalid_argument swig_types[15] -#define SWIGTYPE_p_std__time_t swig_types[16] -#define SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t swig_types[17] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[18] -#define SWIGTYPE_p_value_type swig_types[19] -static swig_type_info *swig_types[21]; -static swig_module_info swig_module = {swig_types, 20, 0, 0, 0, 0}; +#define SWIGTYPE_p_ExploreNoBluetoothException swig_types[4] +#define SWIGTYPE_p_ExploreReadBufferException swig_types[5] +#define SWIGTYPE_p_ExploreSDK swig_types[6] +#define SWIGTYPE_p_allocator_type swig_types[7] +#define SWIGTYPE_p_char swig_types[8] +#define SWIGTYPE_p_device swig_types[9] +#define SWIGTYPE_p_difference_type swig_types[10] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_p_PyObject swig_types[12] +#define SWIGTYPE_p_size_type swig_types[13] +#define SWIGTYPE_p_std__allocatorT_device_t swig_types[14] +#define SWIGTYPE_p_std__exception swig_types[15] +#define SWIGTYPE_p_std__invalid_argument swig_types[16] +#define SWIGTYPE_p_std__time_t swig_types[17] +#define SWIGTYPE_p_std__vectorT_device_t swig_types[18] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[19] +#define SWIGTYPE_p_value_type swig_types[20] +static swig_type_info *swig_types[22]; +static swig_module_info swig_module = {swig_types, 21, 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) @@ -2706,8 +3197,52 @@ static swig_module_info swig_module = {swig_types, 20, 0, 0, 0, 0}; #endif #define SWIG_name "_exploresdk" -#define SWIGVERSION 0x040001 -#define SWIG_VERSION SWIGVERSION +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } + static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); } +}; + +/* + * SwigValueInit() is a generic initialisation solution as the following approach: + * + * T c_result = T(); + * + * doesn't compile for all types for example: + * + * unsigned int c_result = unsigned int(); + */ +template T SwigValueInit() { + return T(); +} + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) @@ -2996,9 +3531,11 @@ SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + double fx, cx, rd; + errno = 0; + fx = floor(x); + cx = ceil(x); + rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ if ((errno == EDOM) || (errno == ERANGE)) { errno = 0; } else { @@ -3059,7 +3596,11 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + // Largest double not larger than ULONG_MAX (not portably calculated easily) + // Note that double(ULONG_MAX) is stored in a double rounded up by one (for 64-bit unsigned long) + // 0xfffffffffffff800ULL == (uint64_t)std::nextafter(double(__uint128_t(ULONG_MAX)+1), double(0)) + const double ulong_max = sizeof(unsigned long) == 8 ? 0xfffffffffffff800ULL : ULONG_MAX; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ulong_max)) { if (val) *val = (unsigned long)(d); return res; } @@ -3215,7 +3756,12 @@ SWIG_AsVal_long (PyObject *obj, long* val) if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + // Largest double not larger than LONG_MAX (not portably calculated easily) + // Note that double(LONG_MAX) is stored in a double rounded up by one (for 64-bit long) + // 0x7ffffffffffffc00LL == (int64_t)std::nextafter(double(__uint128_t(LONG_MAX)+1), double(0)) + const double long_max = sizeof(long) == 8 ? 0x7ffffffffffffc00LL : LONG_MAX; + // No equivalent needed for 64-bit double(LONG_MIN) is exactly LONG_MIN + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, long_max)) { if (val) *val = (long)(d); return res; } @@ -3333,8 +3879,10 @@ SWIG_pchar_descriptor(void) } +/* Return string from Python obj. NOTE: obj must remain in scope in order + to use the returned cptr (but only when alloc is set to SWIG_OLDOBJ) */ SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc) { #if PY_VERSION_HEX>=0x03000000 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) @@ -3347,53 +3895,31 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #endif { char *cstr; Py_ssize_t len; + PyObject *bytes = NULL; int ret = SWIG_OK; -#if PY_VERSION_HEX>=0x03000000 -#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (!obj) - return SWIG_TypeError; if (alloc) - *alloc = SWIG_NEWOBJ; -#endif - PyBytes_AsStringAndSize(obj, &cstr, &len); + *alloc = SWIG_OLDOBJ; +#if PY_VERSION_HEX>=0x03000000 && defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; #else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { + cstr = (char *)SWIG_PyUnicode_AsUTF8AndSize(obj, &len, &bytes); + if (!cstr) + return SWIG_TypeError; + /* The returned string is only duplicated if the char * returned is not owned and memory managed by obj */ + if (bytes && cptr) { if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } + cstr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + *alloc = SWIG_NEWOBJ; } else { -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -#endif -#else - *cptr = SWIG_Python_str_AsChar(obj); - if (!*cptr) - ret = SWIG_TypeError; -#endif + /* alloc must be set in order to clean up allocated memory */ + return SWIG_RuntimeError; } } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); #endif + if (cptr) *cptr = cstr; + if (psize) *psize = len + 1; + Py_XDECREF(bytes); return ret; } else { #if defined(SWIG_PYTHON_2_UNICODE) @@ -3654,11 +4180,20 @@ namespace swig { template struct traits_asptr { static int asptr(PyObject *obj, Type **val) { - Type *p = 0; + int res = SWIG_ERROR; swig_type_info *descriptor = type_info(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; + if (val) { + Type *p = 0; + int newmem = 0; + res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; + if (SWIG_IsOK(res)) { + if (newmem & SWIG_CAST_NEW_MEMORY) { + res |= SWIG_NEWOBJMASK; + } + *val = p; + } + } else { + res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; } return res; } @@ -3795,413 +4330,102 @@ namespace swig { } -#include +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) +# if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL) +# define SWIG_STD_NOITERATOR_TRAITS_STL +# endif +#endif +#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) +#include +#else namespace std { - template <> - struct less - { - bool - operator()(PyObject * v, PyObject *w) const - { - bool res; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; - /* This may fall into a case of inconsistent - eg. ObjA > ObjX > ObjB - but ObjA < ObjB - */ - if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) - { - /* Objects can't be compared, this mostly occurred in Python 3.0 */ - /* Compare their ptr directly for a workaround */ - res = (v < w); - PyErr_Clear(); - } - SWIG_PYTHON_THREAD_END_BLOCK; - return res; - } + template + struct iterator_traits { + typedef ptrdiff_t difference_type; + typedef typename Iterator::value_type value_type; }; - template <> - struct less - { - bool - operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const - { - return std::less()(v, w); - } + template + struct iterator_traits<__reverse_bi_iterator > { + typedef Distance difference_type; + typedef T value_type; }; - template <> - struct less - { - bool - operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const - { - return std::less()(v, w); - } + template + struct iterator_traits { + typedef T value_type; + typedef ptrdiff_t difference_type; }; + template + inline typename iterator_traits<_InputIterator>::difference_type + distance(_InputIterator __first, _InputIterator __last) + { + typename iterator_traits<_InputIterator>::difference_type __n = 0; + while (__first != __last) { + ++__first; ++__n; + } + return __n; + } } +#endif + namespace swig { - template <> struct traits { - typedef value_category category; - static const char* type_name() { return "PyObject *"; } - }; + template + class SwigPyIterator_T : public SwigPyIterator + { + public: + typedef OutIterator out_iterator; + typedef typename std::iterator_traits::value_type value_type; + typedef SwigPyIterator_T self_type; - template <> struct traits_asval { - typedef PyObject * value_type; - static int asval(PyObject *obj, value_type *val) { - if (val) *val = obj; - return SWIG_OK; + SwigPyIterator_T(out_iterator curr, PyObject *seq) + : SwigPyIterator(seq), current(curr) + { } - }; - template <> - struct traits_check { - static bool check(PyObject *) { - return true; + const out_iterator& get_current() const + { + return current; } - }; - template <> struct traits_from { - typedef PyObject * value_type; - static PyObject *from(const value_type& val) { - Py_XINCREF(val); - return val; + + bool equal (const SwigPyIterator &iter) const + { + const self_type *iters = dynamic_cast(&iter); + if (iters) { + return (current == iters->get_current()); + } else { + throw std::invalid_argument("bad iterator type"); + } } + + ptrdiff_t distance(const SwigPyIterator &iter) const + { + const self_type *iters = dynamic_cast(&iter); + if (iters) { + return std::distance(current, iters->get_current()); + } else { + throw std::invalid_argument("bad iterator type"); + } + } + + protected: + out_iterator current; }; -} - -namespace swig { - template - inline size_t - check_index(Difference i, size_t size, bool insert = false) { - if ( i < 0 ) { - if ((size_t) (-i) <= size) - return (size_t) (i + size); - } else if ( (size_t) i < size ) { - return (size_t) i; - } else if (insert && ((size_t) i == size)) { - return size; + template + struct from_oper + { + typedef const ValueType& argument_type; + typedef PyObject *result_type; + result_type operator()(argument_type v) const + { + return swig::from(v); } - throw std::out_of_range("index out of range"); - } - - template - void - slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { - if (step == 0) { - throw std::invalid_argument("slice step cannot be zero"); - } else if (step > 0) { - // Required range: 0 <= i < size, 0 <= j < size, i <= j - if (i < 0) { - ii = 0; - } else if (i < (Difference)size) { - ii = i; - } else if (insert && (i >= (Difference)size)) { - ii = (Difference)size; - } - if (j < 0) { - jj = 0; - } else { - jj = (j < (Difference)size) ? j : (Difference)size; - } - if (jj < ii) - jj = ii; - } else { - // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j - if (i < -1) { - ii = -1; - } else if (i < (Difference) size) { - ii = i; - } else if (i >= (Difference)(size-1)) { - ii = (Difference)(size-1); - } - if (j < -1) { - jj = -1; - } else { - jj = (j < (Difference)size ) ? j : (Difference)(size-1); - } - if (ii < jj) - ii = jj; - } - } - - template - inline typename Sequence::iterator - getpos(Sequence* self, Difference i) { - typename Sequence::iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline typename Sequence::const_iterator - cgetpos(const Sequence* self, Difference i) { - typename Sequence::const_iterator pos = self->begin(); - std::advance(pos, check_index(i,self->size())); - return pos; - } - - template - inline void - erase(Sequence* seq, const typename Sequence::iterator& position) { - seq->erase(position); - } - - template - struct traits_reserve { - static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { - // This should be specialized for types that support reserve - } - }; - - template - inline Sequence* - getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj); - - if (step > 0) { - typename Sequence::const_iterator sb = self->begin(); - typename Sequence::const_iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - if (step == 1) { - return new Sequence(sb, se); - } else { - Sequence *sequence = new Sequence(); - swig::traits_reserve::reserve(*sequence, (jj - ii + step - 1) / step); - typename Sequence::const_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c::reserve(*sequence, (ii - jj - step - 1) / -step); - typename Sequence::const_reverse_iterator sb = self->rbegin(); - typename Sequence::const_reverse_iterator se = self->rbegin(); - std::advance(sb,size-ii-1); - std::advance(se,size-jj-1); - typename Sequence::const_reverse_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c<-step && it!=se; ++c) - it++; - } - return sequence; - } - } - - template - inline void - setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - if (step == 1) { - size_t ssize = jj - ii; - if (ssize <= is.size()) { - // expanding/staying the same size - swig::traits_reserve::reserve(*self, self->size() - ssize + is.size()); - typename Sequence::iterator sb = self->begin(); - typename InputSeq::const_iterator isit = is.begin(); - std::advance(sb,ii); - std::advance(isit, jj - ii); - self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); - } else { - // shrinking - typename Sequence::iterator sb = self->begin(); - typename Sequence::iterator se = self->begin(); - std::advance(sb,ii); - std::advance(se,jj); - self->erase(sb,se); - sb = self->begin(); - std::advance(sb,ii); - self->insert(sb, is.begin(), is.end()); - } - } else { - size_t replacecount = (jj - ii + step - 1) / step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::iterator it = self->begin(); - std::advance(it,ii); - for (size_t rc=0; rcend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - } - } - } else { - size_t replacecount = (ii - jj - step - 1) / -step; - if (is.size() != replacecount) { - char msg[1024]; - sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); - throw std::invalid_argument(msg); - } - typename Sequence::const_iterator isit = is.begin(); - typename Sequence::reverse_iterator it = self->rbegin(); - std::advance(it,size-ii-1); - for (size_t rc=0; rcrend(); ++rc) { - *it++ = *isit++; - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - } - } - } - - template - inline void - delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { - typename Sequence::size_type size = self->size(); - Difference ii = 0; - Difference jj = 0; - swig::slice_adjust(i, j, step, size, ii, jj, true); - if (step > 0) { - typename Sequence::iterator sb = self->begin(); - std::advance(sb,ii); - if (step == 1) { - typename Sequence::iterator se = self->begin(); - std::advance(se,jj); - self->erase(sb,se); - } else { - typename Sequence::iterator it = sb; - size_t delcount = (jj - ii + step - 1) / step; - while (delcount) { - it = self->erase(it); - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) - it++; - delcount--; - } - } - } else { - typename Sequence::reverse_iterator sb = self->rbegin(); - std::advance(sb,size-ii-1); - typename Sequence::reverse_iterator it = sb; - size_t delcount = (ii - jj - step - 1) / -step; - while (delcount) { - it = typename Sequence::reverse_iterator(self->erase((++it).base())); - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - delcount--; - } - } - } -} - - -#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) -# if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL) -# define SWIG_STD_NOITERATOR_TRAITS_STL -# endif -#endif - -#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) -#include -#else -namespace std { - template - struct iterator_traits { - typedef ptrdiff_t difference_type; - typedef typename Iterator::value_type value_type; - }; - - template - struct iterator_traits<__reverse_bi_iterator > { - typedef Distance difference_type; - typedef T value_type; - }; - - template - struct iterator_traits { - typedef T value_type; - typedef ptrdiff_t difference_type; - }; - - template - inline typename iterator_traits<_InputIterator>::difference_type - distance(_InputIterator __first, _InputIterator __last) - { - typename iterator_traits<_InputIterator>::difference_type __n = 0; - while (__first != __last) { - ++__first; ++__n; - } - return __n; - } -} -#endif - - -namespace swig { - template - class SwigPyIterator_T : public SwigPyIterator - { - public: - typedef OutIterator out_iterator; - typedef typename std::iterator_traits::value_type value_type; - typedef SwigPyIterator_T self_type; - - SwigPyIterator_T(out_iterator curr, PyObject *seq) - : SwigPyIterator(seq), current(curr) - { - } - - const out_iterator& get_current() const - { - return current; - } - - - bool equal (const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return (current == iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - ptrdiff_t distance(const SwigPyIterator &iter) const - { - const self_type *iters = dynamic_cast(&iter); - if (iters) { - return std::distance(current, iters->get_current()); - } else { - throw std::invalid_argument("bad iterator type"); - } - } - - protected: - out_iterator current; - }; - - template - struct from_oper - { - typedef const ValueType& argument_type; - typedef PyObject *result_type; - result_type operator()(argument_type v) const - { - return swig::from(v); - } - }; + }; template::value_type, @@ -4375,260 +4599,367 @@ namespace swig { } -namespace swig -{ - template - struct SwigPySequence_Ref - { - SwigPySequence_Ref(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) - { - } - - operator T () const - { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); - try { - return swig::as(item); - } catch (const std::invalid_argument& e) { - char msg[1024]; - sprintf(msg, "in sequence element %d ", (int)_index); - if (!PyErr_Occurred()) { - ::SWIG_Error(SWIG_TypeError, swig::type_name()); - } - SWIG_Python_AddErrorMsg(msg); - SWIG_Python_AddErrorMsg(e.what()); - throw; - } - } + namespace swig { + template <> struct traits< device > { + typedef pointer_category category; + static const char* type_name() { return"device"; } + }; + } - SwigPySequence_Ref& operator=(const T& v) - { - PySequence_SetItem(_seq, _index, swig::from(v)); - return *this; - } - private: - PyObject* _seq; - Py_ssize_t _index; - }; +#include - template - struct SwigPySequence_ArrowProxy +namespace std { + template <> + struct less { - SwigPySequence_ArrowProxy(const T& x): m_value(x) {} - const T* operator->() const { return &m_value; } - operator const T*() const { return &m_value; } - T m_value; + bool + operator()(PyObject * v, PyObject *w) const + { + bool res; + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; + /* This may fall into a case of inconsistent + eg. ObjA > ObjX > ObjB + but ObjA < ObjB + */ + if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) + { + /* Objects can't be compared, this mostly occurred in Python 3.0 */ + /* Compare their ptr directly for a workaround */ + res = (v < w); + PyErr_Clear(); + } + SWIG_PYTHON_THREAD_END_BLOCK; + return res; + } }; - template - struct SwigPySequence_InputIterator + template <> + struct less { - typedef SwigPySequence_InputIterator self; - - typedef std::random_access_iterator_tag iterator_category; - typedef Reference reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - - SwigPySequence_InputIterator() - { - } - - SwigPySequence_InputIterator(PyObject* seq, Py_ssize_t index) - : _seq(seq), _index(index) + bool + operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const { + return std::less()(v, w); } + }; - reference operator*() const + template <> + struct less + { + bool + operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const { - return reference(_seq, _index); - } - - SwigPySequence_ArrowProxy - operator->() const { - return SwigPySequence_ArrowProxy(operator*()); + return std::less()(v, w); } + }; - bool operator==(const self& ri) const - { - return (_index == ri._index) && (_seq == ri._seq); - } +} - bool operator!=(const self& ri) const - { - return !(operator==(ri)); - } +namespace swig { + template <> struct traits { + typedef value_category category; + static const char* type_name() { return "PyObject *"; } + }; - self& operator ++ () - { - ++_index; - return *this; + template <> struct traits_asval { + typedef PyObject * value_type; + static int asval(PyObject *obj, value_type *val) { + if (val) *val = obj; + return SWIG_OK; } + }; - self& operator -- () - { - --_index; - return *this; + template <> + struct traits_check { + static bool check(PyObject *) { + return true; } + }; - self& operator += (difference_type n) - { - _index += n; - return *this; + template <> struct traits_from { + typedef PyObject * value_type; + static PyObject *from(const value_type& val) { + Py_XINCREF(val); + return val; } + }; + +} - self operator +(difference_type n) const - { - return self(_seq, _index + n); +namespace swig { + template + inline size_t + check_index(Difference i, size_t size, bool insert = false) { + if ( i < 0 ) { + if ((size_t) (-i) <= size) + return (size_t) (i + size); + } else if ( (size_t) i < size ) { + return (size_t) i; + } else if (insert && ((size_t) i == size)) { + return size; } + throw std::out_of_range("index out of range"); + } - self& operator -= (difference_type n) - { - _index -= n; - return *this; + template + void + slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { + if (step == 0) { + throw std::invalid_argument("slice step cannot be zero"); + } else if (step > 0) { + // Required range: 0 <= i < size, 0 <= j < size, i <= j + if (i < 0) { + ii = 0; + } else if (i < (Difference)size) { + ii = i; + } else if (insert && (i >= (Difference)size)) { + ii = (Difference)size; + } + if (j < 0) { + jj = 0; + } else { + jj = (j < (Difference)size) ? j : (Difference)size; + } + if (jj < ii) + jj = ii; + } else { + // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j + if (i < -1) { + ii = -1; + } else if (i < (Difference) size) { + ii = i; + } else if (i >= (Difference)(size-1)) { + ii = (Difference)(size-1); + } + if (j < -1) { + jj = -1; + } else { + jj = (j < (Difference)size ) ? j : (Difference)(size-1); + } + if (ii < jj) + ii = jj; } + } - self operator -(difference_type n) const - { - return self(_seq, _index - n); - } + template + inline typename Sequence::iterator + getpos(Sequence* self, Difference i) { + typename Sequence::iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } - difference_type operator - (const self& ri) const - { - return _index - ri._index; - } + template + inline typename Sequence::const_iterator + cgetpos(const Sequence* self, Difference i) { + typename Sequence::const_iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } - bool operator < (const self& ri) const - { - return _index < ri._index; - } + template + inline void + erase(Sequence* seq, const typename Sequence::iterator& position) { + seq->erase(position); + } - reference - operator[](difference_type n) const - { - return reference(_seq, _index + n); + template + struct traits_reserve { + static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { + // This should be specialized for types that support reserve } - - private: - PyObject* _seq; - difference_type _index; }; - // STL container wrapper around a Python sequence - template - struct SwigPySequence_Cont - { - typedef SwigPySequence_Ref reference; - typedef const SwigPySequence_Ref const_reference; - typedef T value_type; - typedef T* pointer; - typedef Py_ssize_t difference_type; - typedef size_t size_type; - typedef const pointer const_pointer; - typedef SwigPySequence_InputIterator iterator; - typedef SwigPySequence_InputIterator const_iterator; - - SwigPySequence_Cont(PyObject* seq) : _seq(0) - { - if (!PySequence_Check(seq)) { - throw std::invalid_argument("a sequence is expected"); - } - _seq = seq; - Py_INCREF(_seq); - } - - ~SwigPySequence_Cont() - { - Py_XDECREF(_seq); - } - - size_type size() const - { - return static_cast(PySequence_Size(_seq)); - } - - bool empty() const - { - return size() == 0; - } - - iterator begin() - { - return iterator(_seq, 0); - } + template + inline Sequence* + getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { + typename Sequence::size_type size = self->size(); + Difference ii = 0; + Difference jj = 0; + swig::slice_adjust(i, j, step, size, ii, jj); - const_iterator begin() const - { - return const_iterator(_seq, 0); + if (step > 0) { + typename Sequence::const_iterator sb = self->begin(); + typename Sequence::const_iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + if (step == 1) { + return new Sequence(sb, se); + } else { + Sequence *sequence = new Sequence(); + swig::traits_reserve::reserve(*sequence, (jj - ii + step - 1) / step); + typename Sequence::const_iterator it = sb; + while (it!=se) { + sequence->push_back(*it); + for (Py_ssize_t c=0; c::reserve(*sequence, (ii - jj - step - 1) / -step); + typename Sequence::const_reverse_iterator sb = self->rbegin(); + typename Sequence::const_reverse_iterator se = self->rbegin(); + std::advance(sb,size-ii-1); + std::advance(se,size-jj-1); + typename Sequence::const_reverse_iterator it = sb; + while (it!=se) { + sequence->push_back(*it); + for (Py_ssize_t c=0; c<-step && it!=se; ++c) + it++; + } + return sequence; } + } - iterator end() - { - return iterator(_seq, size()); + template + inline void + setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { + typename Sequence::size_type size = self->size(); + Difference ii = 0; + Difference jj = 0; + swig::slice_adjust(i, j, step, size, ii, jj, true); + if (step > 0) { + if (step == 1) { + size_t ssize = jj - ii; + if (ssize <= is.size()) { + // expanding/staying the same size + swig::traits_reserve::reserve(*self, self->size() - ssize + is.size()); + typename Sequence::iterator sb = self->begin(); + typename InputSeq::const_iterator isit = is.begin(); + std::advance(sb,ii); + std::advance(isit, jj - ii); + self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); + } else { + // shrinking + typename Sequence::iterator sb = self->begin(); + typename Sequence::iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + self->erase(sb,se); + sb = self->begin(); + std::advance(sb,ii); + self->insert(sb, is.begin(), is.end()); + } + } else { + size_t replacecount = (jj - ii + step - 1) / step; + if (is.size() != replacecount) { + char msg[1024]; + PyOS_snprintf(msg, sizeof(msg), "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); + throw std::invalid_argument(msg); + } + typename Sequence::const_iterator isit = is.begin(); + typename Sequence::iterator it = self->begin(); + std::advance(it,ii); + for (size_t rc=0; rcend(); ++rc) { + *it++ = *isit++; + for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) + it++; + } + } + } else { + size_t replacecount = (ii - jj - step - 1) / -step; + if (is.size() != replacecount) { + char msg[1024]; + PyOS_snprintf(msg, sizeof(msg), "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); + throw std::invalid_argument(msg); + } + typename Sequence::const_iterator isit = is.begin(); + typename Sequence::reverse_iterator it = self->rbegin(); + std::advance(it,size-ii-1); + for (size_t rc=0; rcrend(); ++rc) { + *it++ = *isit++; + for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) + it++; + } } + } - const_iterator end() const - { - return const_iterator(_seq, size()); + template + inline void + delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { + typename Sequence::size_type size = self->size(); + Difference ii = 0; + Difference jj = 0; + swig::slice_adjust(i, j, step, size, ii, jj, true); + if (step > 0) { + typename Sequence::iterator sb = self->begin(); + std::advance(sb,ii); + if (step == 1) { + typename Sequence::iterator se = self->begin(); + std::advance(se,jj); + self->erase(sb,se); + } else { + typename Sequence::iterator it = sb; + size_t delcount = (jj - ii + step - 1) / step; + while (delcount) { + it = self->erase(it); + for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) + it++; + delcount--; + } + } + } else { + typename Sequence::reverse_iterator sb = self->rbegin(); + std::advance(sb,size-ii-1); + typename Sequence::reverse_iterator it = sb; + size_t delcount = (ii - jj - step - 1) / -step; + while (delcount) { + it = typename Sequence::reverse_iterator(self->erase((++it).base())); + for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) + it++; + delcount--; + } } + } +} - reference operator[](difference_type n) - { - return reference(_seq, n); - } - const_reference operator[](difference_type n) const - { - return const_reference(_seq, n); +namespace swig { + template + struct IteratorProtocol { + static void assign(PyObject *obj, Seq *seq) { + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + while (item) { + seq->insert(seq->end(), swig::as(item)); + item = PyIter_Next(iter); + } + } } - bool check() const - { - Py_ssize_t s = size(); - for (Py_ssize_t i = 0; i < s; ++i) { - swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); - if (!swig::check(item)) - return false; + static bool check(PyObject *obj) { + bool ret = false; + SwigVar_PyObject iter = PyObject_GetIter(obj); + if (iter) { + SwigVar_PyObject item = PyIter_Next(iter); + ret = true; + while (item) { + ret = swig::check(item); + item = ret ? PyIter_Next(iter) : 0; + } } - return true; + return ret; } - - private: - PyObject* _seq; }; -} - - - namespace swig { - template <> struct traits< device > { - typedef pointer_category category; - static const char* type_name() { return"device"; } - }; - } - - -namespace swig { - template - inline void - assign(const SwigPySeq& swigpyseq, Seq* seq) { - // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented - typedef typename SwigPySeq::value_type value_type; - typename SwigPySeq::const_iterator it = swigpyseq.begin(); - for (;it != swigpyseq.end(); ++it) { - seq->insert(seq->end(),(value_type)(*it)); - } - } - template struct traits_asptr_stdseq { typedef Seq sequence; typedef T value_type; + static bool is_iterable(PyObject *obj) { + SwigVar_PyObject iter = PyObject_GetIter(obj); + PyErr_Clear(); + return iter != 0; + } + static int asptr(PyObject *obj, sequence **seq) { + int ret = SWIG_ERROR; if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { sequence *p; swig_type_info *descriptor = swig::type_info(); @@ -4636,27 +4967,25 @@ namespace swig { if (seq) *seq = p; return SWIG_OLDOBJ; } - } else if (PySequence_Check(obj)) { + } else if (is_iterable(obj)) { try { - SwigPySequence_Cont swigpyseq(obj); if (seq) { - sequence *pseq = new sequence(); - assign(swigpyseq, pseq); - *seq = pseq; - return SWIG_NEWOBJ; + *seq = new sequence(); + IteratorProtocol::assign(obj, *seq); + if (!PyErr_Occurred()) + return SWIG_NEWOBJ; } else { - return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; + return IteratorProtocol::check(obj) ? SWIG_OK : SWIG_ERROR; } } catch (std::exception& e) { - if (seq) { - if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, e.what()); - } - } - return SWIG_ERROR; + if (seq && !PyErr_Occurred()) + PyErr_SetString(PyExc_TypeError, e.what()); } + if (seq) + delete *seq; + return SWIG_ERROR; } - return SWIG_ERROR; + return ret; } }; @@ -4843,7 +5172,7 @@ namespace swig { struct container_owner { // By default, do not add the back-reference (for value types) // Specialization below will check the reference for pointer types. - static bool back_reference(PyObject* child, PyObject* owner) { + static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) { return false; } }; @@ -4860,8 +5189,7 @@ namespace swig { static bool back_reference(PyObject* child, PyObject* owner) { SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { - PyObject_SetAttr(child, container_owner_attribute(), owner); - return true; + return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1; } return false; } @@ -4916,13 +5244,14 @@ SWIG_AsVal_bool (PyObject *obj, bool *val) #ifdef __cplusplus extern "C" { #endif -SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 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_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); @@ -4930,11 +5259,7 @@ SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -4942,7 +5267,7 @@ SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -4950,6 +5275,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[1] ; PyObject *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); @@ -4958,11 +5284,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -4977,7 +5299,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; @@ -4987,6 +5309,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( int ecode2 = 0 ; swig::SwigPyIterator *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -4999,11 +5322,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( } arg2 = static_cast< size_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)(arg1)->incr(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)(arg1)->incr(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5018,13 +5337,14 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *result = 0 ; + (void)self; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5032,11 +5352,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM( } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)(arg1)->incr(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)(arg1)->incr(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5060,7 +5376,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator_incr", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5069,7 +5385,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5093,7 +5409,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; @@ -5103,6 +5419,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( int ecode2 = 0 ; swig::SwigPyIterator *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5115,11 +5432,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( } arg2 = static_cast< size_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)(arg1)->decr(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)(arg1)->decr(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5134,13 +5447,14 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *result = 0 ; + (void)self; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5148,11 +5462,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM( } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)(arg1)->decr(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)(arg1)->decr(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5176,7 +5486,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator_decr", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5185,7 +5495,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5209,7 +5519,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5220,6 +5530,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self PyObject *swig_obj[2] ; ptrdiff_t result; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator_distance", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5235,11 +5546,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; } @@ -5250,7 +5557,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5261,6 +5568,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[2] ; bool result; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator_equal", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5276,11 +5584,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; } @@ -5291,7 +5595,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5299,6 +5603,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), P PyObject *swig_obj[1] ; swig::SwigPyIterator *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); @@ -5306,11 +5611,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), P SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: @@ -5318,7 +5619,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5326,6 +5627,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), P PyObject *swig_obj[1] ; PyObject *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); @@ -5334,11 +5636,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), P } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)(arg1)->next(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (PyObject *)(arg1)->next(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5353,7 +5651,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5361,6 +5659,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self PyObject *swig_obj[1] ; PyObject *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); @@ -5369,11 +5668,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)(arg1)->__next__(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (PyObject *)(arg1)->__next__(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5388,7 +5683,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5396,6 +5691,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self PyObject *swig_obj[1] ; PyObject *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); @@ -5404,11 +5700,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (PyObject *)(arg1)->previous(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (PyObject *)(arg1)->previous(); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5423,7 +5715,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5434,6 +5726,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self) PyObject *swig_obj[2] ; swig::SwigPyIterator *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator_advance", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5446,11 +5739,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self) } arg2 = static_cast< ptrdiff_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)(arg1)->advance(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)(arg1)->advance(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5465,7 +5754,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5476,6 +5765,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[2] ; bool result; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator___eq__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5490,21 +5780,20 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } -SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5515,6 +5804,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[2] ; bool result; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator___ne__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5529,21 +5819,20 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } -SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5554,6 +5843,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self PyObject *swig_obj[2] ; swig::SwigPyIterator *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator___iadd__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { @@ -5566,11 +5856,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self } arg2 = static_cast< ptrdiff_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5585,7 +5871,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5596,6 +5882,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self PyObject *swig_obj[2] ; swig::SwigPyIterator *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator___isub__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { @@ -5608,11 +5895,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self } arg2 = static_cast< ptrdiff_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5627,7 +5910,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5638,6 +5921,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self) PyObject *swig_obj[2] ; swig::SwigPyIterator *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "SwigPyIterator___add__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5650,11 +5934,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self) } arg2 = static_cast< ptrdiff_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5665,13 +5945,16 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self) resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } -SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5681,6 +5964,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA int ecode2 = 0 ; swig::SwigPyIterator *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5693,11 +5977,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA } arg2 = static_cast< ptrdiff_t >(val2); try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; @@ -5708,13 +5988,16 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } -SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5724,6 +6007,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPA int res2 = 0 ; ptrdiff_t result; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -5738,14 +6022,13 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPA SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); return resultobj; fail: + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) { + return NULL; + } PyErr_Clear(); Py_INCREF(Py_NotImplemented); return Py_NotImplemented; @@ -5761,7 +6044,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator___sub__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5774,7 +6057,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5802,13 +6085,14 @@ SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 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_BTSerialPortBinding, SWIG_POINTER_DISOWN | 0 ); @@ -5818,11 +6102,7 @@ SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(s arg1 = reinterpret_cast< BTSerialPortBinding * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -5848,7 +6128,7 @@ SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; int arg2 ; @@ -5857,6 +6137,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s PyObject *swig_obj[2] ; BTSerialPortBinding *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "BTSerialPortBinding_Create", 2, 2, swig_obj)) SWIG_fail; { std::string *ptr = (std::string *)0; @@ -5874,11 +6155,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s arg2 = static_cast< int >(val2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (BTSerialPortBinding *)BTSerialPortBinding::Create(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (BTSerialPortBinding *)BTSerialPortBinding::Create(SWIG_STD_MOVE(arg1),arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -5904,7 +6181,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -5912,6 +6189,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM( PyObject *swig_obj[1] ; int result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BTSerialPortBinding, 0 | 0 ); @@ -5921,11 +6199,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM( arg1 = reinterpret_cast< BTSerialPortBinding * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)(arg1)->Connect(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (int)(arg1)->Connect(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -5951,13 +6225,14 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 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_BTSerialPortBinding, 0 | 0 ); @@ -5967,11 +6242,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(se arg1 = reinterpret_cast< BTSerialPortBinding * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->Close(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->Close(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -5997,7 +6268,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; char *arg2 = (char *) 0 ; @@ -6010,6 +6281,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(sel int size2 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "BTSerialPortBinding_Read", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BTSerialPortBinding, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -6026,11 +6298,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(sel arg3 = &size2; { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->Read(arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->Read(arg2,arg3); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6059,7 +6327,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; char *arg2 = (char *) 0 ; @@ -6068,6 +6336,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(se int res1 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "BTSerialPortBinding_Write", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BTSerialPortBinding, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -6081,11 +6350,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(se } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->Write((char const *)arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->Write((char const *)arg2,arg3); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6111,7 +6376,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -6119,6 +6384,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *SWIGUNU 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_BTSerialPortBinding, 0 | 0 ); @@ -6128,11 +6394,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *SWIGUNU arg1 = reinterpret_cast< BTSerialPortBinding * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)(arg1)->IsDataAvailable(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)(arg1)->IsDataAvailable(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6165,7 +6427,7 @@ SWIGINTERN PyObject *BTSerialPortBinding_swigregister(PyObject *SWIGUNUSEDPARM(s return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PyObject **arg2 = (PyObject **) 0 ; @@ -6175,20 +6437,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_iterator" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (swig::SwigPyIterator *)std_vector_Sl_device_Sg__iterator(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (swig::SwigPyIterator *)std_vector_Sl_device_Sg__iterator(arg1,arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6214,7 +6473,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6222,20 +6481,17 @@ SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(sel 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___nonzero__" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)std_vector_Sl_device_Sg____nonzero__((std::vector< device > const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)std_vector_Sl_device_Sg____nonzero__((std::vector< device > const *)arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6261,7 +6517,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6269,20 +6525,17 @@ SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___bool__" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)std_vector_Sl_device_Sg____bool__((std::vector< device > const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)std_vector_Sl_device_Sg____bool__((std::vector< device > const *)arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6308,7 +6561,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6316,20 +6569,17 @@ SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[1] ; std::vector< device >::size_type result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___len__" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg____len__((std::vector< device > const *)arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = std_vector_Sl_device_Sg____len__((std::vector< device > const *)arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -6355,7 +6605,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6369,8 +6619,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se PyObject *swig_obj[3] ; std::vector< device,std::allocator< device > > *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice___getslice__", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___getslice__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6388,11 +6639,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_Sg____getslice__(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_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) { @@ -6416,14 +6663,14 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6435,8 +6682,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___setslice__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6454,11 +6702,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setslice____SWIG_0(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_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) { @@ -6489,7 +6733,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE } -SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6503,8 +6747,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSE 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___setslice__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6533,11 +6778,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSE { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setslice____SWIG_1(arg1,arg2,arg3,(std::vector< device,std::allocator< device > > const &)*arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg____setslice____SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(std::vector< device,std::allocator< device > > const &)*arg4); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { @@ -6579,7 +6820,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___setslice__", 0, 4, argv))) SWIG_fail; --argc; if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -6599,7 +6840,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a } } if (argc == 4) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -6632,7 +6873,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a } -SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6645,8 +6886,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se int ecode3 = 0 ; PyObject *swig_obj[3] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice___delslice__", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___delslice__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6664,11 +6906,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____delslice__(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_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) { @@ -6699,7 +6937,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6708,8 +6946,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___delitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6722,11 +6961,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____delitem____SWIG_0(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_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) { @@ -6757,7 +6992,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; @@ -6765,8 +7000,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED int res1 = 0 ; std::vector< device,std::allocator< device > > *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___getitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6780,11 +7016,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_Sg____getitem____SWIG_0(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_Sg____getitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { @@ -6808,14 +7040,14 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; @@ -6824,8 +7056,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___setitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6850,11 +7083,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< device,std::allocator< device > > const &)*arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< device,std::allocator< device > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { @@ -6887,15 +7116,16 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___setitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6909,11 +7139,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setitem____SWIG_1(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg____setitem____SWIG_1(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { @@ -6944,15 +7170,16 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___delitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -6966,11 +7193,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____delitem____SWIG_1(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg____delitem____SWIG_1(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { @@ -7010,7 +7233,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___delitem__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7023,7 +7246,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar } } if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7046,7 +7269,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar } -SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -7056,8 +7279,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSED int ecode2 = 0 ; std::vector< device >::value_type *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___getitem__" "', argument " "1"" of type '" "std::vector< device > const *""'"); } @@ -7070,11 +7294,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device >::value_type *) &std_vector_Sl_device_Sg____getitem____SWIG_1((std::vector< device > const *)arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device >::value_type *) &std_vector_Sl_device_Sg____getitem____SWIG_1((std::vector< device > const *)arg1,SWIG_STD_MOVE(arg2)); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } @@ -7113,7 +7333,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___getitem__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7126,7 +7346,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar } } if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7149,7 +7369,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -7161,8 +7381,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSED void *argp3 = 0 ; int res3 = 0 ; + (void)self; if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice___setitem__" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -7183,11 +7404,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSED { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setitem____SWIG_2(arg1,arg2,(device const &)*arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg____setitem____SWIG_2(arg1,SWIG_STD_MOVE(arg2),(device const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } @@ -7225,7 +7442,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___setitem__", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7238,7 +7455,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7255,7 +7472,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7283,7 +7500,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar } -SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7291,9 +7508,10 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyOb PyObject *swig_obj[1] ; std::vector< device >::value_type result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_pop" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -7301,11 +7519,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyOb { try { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__pop(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = std_vector_Sl_device_Sg__pop(arg1); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } @@ -7327,14 +7541,14 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyOb SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj((new std::vector< device >::value_type(static_cast< const std::vector< device >::value_type& >(result))), SWIGTYPE_p_device, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::vector< device >::value_type(result)), SWIGTYPE_p_device, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::value_type *arg2 = 0 ; @@ -7344,8 +7558,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), P int res2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice_append", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_append" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -7360,11 +7575,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), P arg2 = reinterpret_cast< std::vector< device >::value_type * >(argp2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg__append(arg1,(device const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg__append(arg1,(device const &)*arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7390,18 +7601,15 @@ SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; std::vector< device > *result = 0 ; + (void)self; if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device > *)new std::vector< device >(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device > *)new std::vector< device >(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7420,19 +7628,20 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *SWIGUNUSEDPARM(sel SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = 0 ; int res1 = SWIG_OLDOBJ ; std::vector< device > *result = 0 ; + (void)self; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; { std::vector< device,std::allocator< device > > *ptr = (std::vector< device,std::allocator< device > > *)0; @@ -7447,11 +7656,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(sel } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device > *)new std::vector< device >((std::vector< device > const &)*arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device > *)new std::vector< device >((std::vector< device > const &)*arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7470,7 +7675,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(sel SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_NEW | 0 ); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; fail: @@ -7479,7 +7684,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7487,20 +7692,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), Py 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_empty" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool)((std::vector< device > const *)arg1)->empty(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool)((std::vector< device > const *)arg1)->empty(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7526,7 +7728,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7534,20 +7736,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *swig_obj[1] ; std::vector< device >::size_type result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_size" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((std::vector< device > const *)arg1)->size(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = ((std::vector< device > const *)arg1)->size(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7573,7 +7772,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device > *arg2 = 0 ; @@ -7583,13 +7782,14 @@ SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyO int res2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice_swap", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_swap" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_std__vectorT_device_t, 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "vectordevice_swap" "', argument " "2"" of type '" "std::vector< device > &""'"); } @@ -7599,11 +7799,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyO arg2 = reinterpret_cast< std::vector< device > * >(argp2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->swap(*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->swap(*arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7629,7 +7825,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7637,20 +7833,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), Py PyObject *swig_obj[1] ; std::vector< device >::iterator result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_begin" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->begin(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->begin(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7677,7 +7870,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7685,20 +7878,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyOb PyObject *swig_obj[1] ; std::vector< device >::iterator result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_end" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->end(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->end(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7725,7 +7915,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyOb } -SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7733,20 +7923,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), P PyObject *swig_obj[1] ; std::vector< device >::reverse_iterator result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_rbegin" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->rbegin(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->rbegin(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7773,7 +7960,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7781,20 +7968,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *swig_obj[1] ; std::vector< device >::reverse_iterator result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_rend" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->rend(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->rend(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7821,27 +8005,24 @@ SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_clear" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->clear(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->clear(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7867,7 +8048,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7875,20 +8056,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(s PyObject *swig_obj[1] ; SwigValueWrapper< std::allocator< device > > result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_get_allocator" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((std::vector< device > const *)arg1)->get_allocator(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = ((std::vector< device > const *)arg1)->get_allocator(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7907,20 +8085,21 @@ SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(s SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj((new std::vector< device >::allocator_type(static_cast< const std::vector< device >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_device_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::vector< device >::allocator_type(result)), SWIGTYPE_p_std__allocatorT_device_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device >::size_type arg1 ; size_t val1 ; int ecode1 = 0 ; std::vector< device > *result = 0 ; + (void)self; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { @@ -7929,11 +8108,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(sel arg1 = static_cast< std::vector< device >::size_type >(val1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device > *)new std::vector< device >(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device > *)new std::vector< device >(arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -7952,34 +8127,31 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(sel SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_pop_back" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->pop_back(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->pop_back(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8005,7 +8177,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8014,8 +8186,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM( 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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_resize" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8027,11 +8200,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM( arg2 = static_cast< std::vector< device >::size_type >(val2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->resize(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->resize(arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8057,7 +8226,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8067,8 +8236,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s int res2 ; std::vector< device >::iterator result; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_erase" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8086,11 +8256,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__erase__SWIG_0(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = std_vector_Sl_device_Sg__erase__SWIG_0(arg1,SWIG_STD_MOVE(arg2)); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8117,7 +8283,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8130,8 +8296,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s int res3 ; std::vector< device >::iterator result; + (void)self; if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_erase" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8160,11 +8327,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__erase__SWIG_1(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = std_vector_Sl_device_Sg__erase__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8200,7 +8363,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_erase", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8213,7 +8376,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8240,7 +8403,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device >::size_type arg1 ; std::vector< device >::value_type *arg2 = 0 ; @@ -8250,6 +8413,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(sel int res2 = 0 ; std::vector< device > *result = 0 ; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { @@ -8266,11 +8430,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(sel arg2 = reinterpret_cast< std::vector< device >::value_type * >(argp2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device > *)new std::vector< device >(arg1,(std::vector< device >::value_type const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device > *)new std::vector< device >(arg1,(std::vector< device >::value_type const &)*arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8289,7 +8449,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(sel SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; @@ -8308,7 +8468,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { return _wrap_new_vectordevice__SWIG_0(self, argc, argv); } if (argc == 1) { - int _v; + int _v = 0; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); @@ -8318,7 +8478,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } } if (argc == 1) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8326,7 +8486,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); @@ -8351,7 +8511,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::value_type *arg2 = 0 ; @@ -8361,8 +8521,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self) int res2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice_push_back", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_push_back" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8377,11 +8538,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self) arg2 = reinterpret_cast< std::vector< device >::value_type * >(argp2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->push_back((std::vector< device >::value_type const &)*arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->push_back((std::vector< device >::value_type const &)*arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8407,7 +8564,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8415,20 +8572,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), Py PyObject *swig_obj[1] ; std::vector< device >::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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_front" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device >::value_type *) &((std::vector< device > const *)arg1)->front(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device >::value_type *) &((std::vector< device > const *)arg1)->front(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8455,7 +8609,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8463,20 +8617,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *swig_obj[1] ; std::vector< device >::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_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_back" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device >::value_type *) &((std::vector< device > const *)arg1)->back(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::vector< device >::value_type *) &((std::vector< device > const *)arg1)->back(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8503,7 +8654,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8516,8 +8667,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), P int res3 = 0 ; PyObject *swig_obj[3] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice_assign", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_assign" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8537,11 +8689,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), P arg3 = reinterpret_cast< std::vector< device >::value_type * >(argp3); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->assign(arg2,(std::vector< device >::value_type const &)*arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->assign(arg2,(std::vector< device >::value_type const &)*arg3); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8567,7 +8715,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8579,8 +8727,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *SWIGUNUSEDPARM( void *argp3 = 0 ; int res3 = 0 ; + (void)self; if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_resize" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8600,11 +8749,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *SWIGUNUSEDPARM( arg3 = reinterpret_cast< std::vector< device >::value_type * >(argp3); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->resize(arg2,(std::vector< device >::value_type const &)*arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->resize(arg2,(std::vector< device >::value_type const &)*arg3); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8639,7 +8784,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_resize", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8653,7 +8798,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8680,7 +8825,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8693,8 +8838,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( int res3 = 0 ; std::vector< device >::iterator result; + (void)self; if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_insert" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8720,11 +8866,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( arg3 = reinterpret_cast< std::vector< device >::value_type * >(argp3); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__insert__SWIG_0(arg1,arg2,(device const &)*arg3); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = std_vector_Sl_device_Sg__insert__SWIG_0(arg1,SWIG_STD_MOVE(arg2),(device const &)*arg3); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8751,7 +8893,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8766,8 +8908,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( void *argp4 = 0 ; int res4 = 0 ; + (void)self; if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_insert" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8798,11 +8941,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( arg4 = reinterpret_cast< std::vector< device >::value_type * >(argp4); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg__insert__SWIG_1(arg1,arg2,arg3,(device const &)*arg4); - SWIG_PYTHON_THREAD_END_ALLOW; - } + std_vector_Sl_device_Sg__insert__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(device const &)*arg4); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8837,7 +8976,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_insert", 0, 4, argv))) SWIG_fail; --argc; if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8854,7 +8993,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { } } if (argc == 4) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8886,7 +9025,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8896,8 +9035,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "vectordevice_reserve", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_reserve" "', argument " "1"" of type '" "std::vector< device > *""'"); } @@ -8909,11 +9049,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), arg2 = static_cast< std::vector< device >::size_type >(val2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - (arg1)->reserve(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + (arg1)->reserve(arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8939,7 +9075,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8947,20 +9083,17 @@ SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[1] ; std::vector< device >::size_type result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vectordevice_capacity" "', argument " "1"" of type '" "std::vector< device > const *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((std::vector< device > const *)arg1)->capacity(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = ((std::vector< device > const *)arg1)->capacity(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -8986,27 +9119,24 @@ SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 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_device_std__allocatorT_device_t_t, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_std__vectorT_device_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_vectordevice" "', argument " "1"" of type '" "std::vector< device > *""'"); } arg1 = reinterpret_cast< std::vector< device > * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9035,7 +9165,7 @@ SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *SWIGUNUSEDPARM(self), P SWIGINTERN PyObject *vectordevice_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_device_std__allocatorT_device_t_t, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_device_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -9043,12 +9173,13 @@ SWIGINTERN PyObject *vectordevice_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObj return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_ExploreException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_ExploreException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; PyObject *swig_obj[1] ; ExploreException *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; { @@ -9062,11 +9193,7 @@ SWIGINTERN PyObject *_wrap_new_ExploreException(PyObject *SWIGUNUSEDPARM(self), } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (ExploreException *)new ExploreException(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (ExploreException *)new ExploreException(arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9092,7 +9219,7 @@ SWIGINTERN PyObject *_wrap_new_ExploreException(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_ExploreException_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreException_what(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreException *arg1 = (ExploreException *) 0 ; void *argp1 = 0 ; @@ -9100,6 +9227,7 @@ SWIGINTERN PyObject *_wrap_ExploreException_what(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[1] ; char *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreException, 0 | 0 ); @@ -9109,11 +9237,7 @@ SWIGINTERN PyObject *_wrap_ExploreException_what(PyObject *SWIGUNUSEDPARM(self), arg1 = reinterpret_cast< ExploreException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)((ExploreException const *)arg1)->what(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (char *)((ExploreException const *)arg1)->what(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9139,13 +9263,14 @@ SWIGINTERN PyObject *_wrap_ExploreException_what(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_delete_ExploreException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreException *arg1 = (ExploreException *) 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_ExploreException, SWIG_POINTER_DISOWN | 0 ); @@ -9155,11 +9280,7 @@ SWIGINTERN PyObject *_wrap_delete_ExploreException(PyObject *SWIGUNUSEDPARM(self arg1 = reinterpret_cast< ExploreException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9196,12 +9317,13 @@ SWIGINTERN PyObject *ExploreException_swiginit(PyObject *SWIGUNUSEDPARM(self), P return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_ExploreReadBufferException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_ExploreReadBufferException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; PyObject *swig_obj[1] ; ExploreReadBufferException *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; { @@ -9215,11 +9337,7 @@ SWIGINTERN PyObject *_wrap_new_ExploreReadBufferException(PyObject *SWIGUNUSEDPA } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (ExploreReadBufferException *)new ExploreReadBufferException(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (ExploreReadBufferException *)new ExploreReadBufferException(arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9245,7 +9363,7 @@ SWIGINTERN PyObject *_wrap_new_ExploreReadBufferException(PyObject *SWIGUNUSEDPA } -SWIGINTERN PyObject *_wrap_ExploreReadBufferException_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreReadBufferException_what(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreReadBufferException *arg1 = (ExploreReadBufferException *) 0 ; void *argp1 = 0 ; @@ -9253,20 +9371,161 @@ SWIGINTERN PyObject *_wrap_ExploreReadBufferException_what(PyObject *SWIGUNUSEDP PyObject *swig_obj[1] ; char *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreReadBufferException, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreReadBufferException_what" "', argument " "1"" of type '" "ExploreReadBufferException const *""'"); } - arg1 = reinterpret_cast< ExploreReadBufferException * >(argp1); + arg1 = reinterpret_cast< ExploreReadBufferException * >(argp1); + { + try { + result = (char *)((ExploreReadBufferException const *)arg1)->what(); + } catch(const ExploreException& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + catch(const ExploreReadBufferException& e) { + SWIG_exception(SWIG_MemoryError, e.what()); + } + catch(const ExploreIOException& e) { + SWIG_exception(SWIG_IOError, e.what()); + } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } + catch(const std::exception& e) { + SWIG_exception(SWIG_UnknownError, "Standard exception"); + } catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + } + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_ExploreReadBufferException(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ExploreReadBufferException *arg1 = (ExploreReadBufferException *) 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_ExploreReadBufferException, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreReadBufferException" "', argument " "1"" of type '" "ExploreReadBufferException *""'"); + } + arg1 = reinterpret_cast< ExploreReadBufferException * >(argp1); + { + try { + delete arg1; + } catch(const ExploreException& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + catch(const ExploreReadBufferException& e) { + SWIG_exception(SWIG_MemoryError, e.what()); + } + catch(const ExploreIOException& e) { + SWIG_exception(SWIG_IOError, e.what()); + } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } + catch(const std::exception& e) { + SWIG_exception(SWIG_UnknownError, "Standard exception"); + } catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *ExploreReadBufferException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ExploreReadBufferException, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *ExploreReadBufferException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_new_ExploreBtSocketException(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + std::string arg1 ; + PyObject *swig_obj[1] ; + ExploreBtSocketException *result = 0 ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ExploreBtSocketException" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + try { + result = (ExploreBtSocketException *)new ExploreBtSocketException(arg1); + } catch(const ExploreException& e) { + SWIG_exception(SWIG_ValueError, e.what()); + } + catch(const ExploreReadBufferException& e) { + SWIG_exception(SWIG_MemoryError, e.what()); + } + catch(const ExploreIOException& e) { + SWIG_exception(SWIG_IOError, e.what()); + } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } + catch(const std::exception& e) { + SWIG_exception(SWIG_UnknownError, "Standard exception"); + } catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ExploreBtSocketException, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ExploreBtSocketException_what(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ExploreBtSocketException *arg1 = (ExploreBtSocketException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreBtSocketException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreBtSocketException_what" "', argument " "1"" of type '" "ExploreBtSocketException const *""'"); + } + arg1 = reinterpret_cast< ExploreBtSocketException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)((ExploreReadBufferException const *)arg1)->what(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (char *)((ExploreBtSocketException const *)arg1)->what(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9292,27 +9551,24 @@ SWIGINTERN PyObject *_wrap_ExploreReadBufferException_what(PyObject *SWIGUNUSEDP } -SWIGINTERN PyObject *_wrap_delete_ExploreReadBufferException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreBtSocketException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ExploreReadBufferException *arg1 = (ExploreReadBufferException *) 0 ; + ExploreBtSocketException *arg1 = (ExploreBtSocketException *) 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_ExploreReadBufferException, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreBtSocketException, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreReadBufferException" "', argument " "1"" of type '" "ExploreReadBufferException *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreBtSocketException" "', argument " "1"" of type '" "ExploreBtSocketException *""'"); } - arg1 = reinterpret_cast< ExploreReadBufferException * >(argp1); + arg1 = reinterpret_cast< ExploreBtSocketException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9338,41 +9594,38 @@ SWIGINTERN PyObject *_wrap_delete_ExploreReadBufferException(PyObject *SWIGUNUSE } -SWIGINTERN PyObject *ExploreReadBufferException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreBtSocketException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ExploreReadBufferException, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_ExploreBtSocketException, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *ExploreReadBufferException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreBtSocketException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_ExploreBtSocketException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_ExploreIOException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; PyObject *swig_obj[1] ; - ExploreBtSocketException *result = 0 ; + ExploreIOException *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); if (!SWIG_IsOK(res) || !ptr) { - SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ExploreBtSocketException" "', argument " "1"" of type '" "std::string""'"); + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ExploreIOException" "', argument " "1"" of type '" "std::string""'"); } arg1 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (ExploreBtSocketException *)new ExploreBtSocketException(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (ExploreIOException *)new ExploreIOException(arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9391,35 +9644,32 @@ SWIGINTERN PyObject *_wrap_new_ExploreBtSocketException(PyObject *SWIGUNUSEDPARM SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ExploreBtSocketException, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ExploreIOException, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ExploreBtSocketException_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreIOException_what(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ExploreBtSocketException *arg1 = (ExploreBtSocketException *) 0 ; + ExploreIOException *arg1 = (ExploreIOException *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; char *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreBtSocketException, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreIOException, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreBtSocketException_what" "', argument " "1"" of type '" "ExploreBtSocketException const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreIOException_what" "', argument " "1"" of type '" "ExploreIOException const *""'"); } - arg1 = reinterpret_cast< ExploreBtSocketException * >(argp1); + arg1 = reinterpret_cast< ExploreIOException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)((ExploreBtSocketException const *)arg1)->what(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (char *)((ExploreIOException const *)arg1)->what(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9445,27 +9695,24 @@ SWIGINTERN PyObject *_wrap_ExploreBtSocketException_what(PyObject *SWIGUNUSEDPAR } -SWIGINTERN PyObject *_wrap_delete_ExploreBtSocketException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreIOException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ExploreBtSocketException *arg1 = (ExploreBtSocketException *) 0 ; + ExploreIOException *arg1 = (ExploreIOException *) 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_ExploreBtSocketException, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreIOException, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreBtSocketException" "', argument " "1"" of type '" "ExploreBtSocketException *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreIOException" "', argument " "1"" of type '" "ExploreIOException *""'"); } - arg1 = reinterpret_cast< ExploreBtSocketException * >(argp1); + arg1 = reinterpret_cast< ExploreIOException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9491,41 +9738,38 @@ SWIGINTERN PyObject *_wrap_delete_ExploreBtSocketException(PyObject *SWIGUNUSEDP } -SWIGINTERN PyObject *ExploreBtSocketException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreIOException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ExploreBtSocketException, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_ExploreIOException, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *ExploreBtSocketException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreIOException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_ExploreIOException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_ExploreNoBluetoothException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; PyObject *swig_obj[1] ; - ExploreIOException *result = 0 ; + ExploreNoBluetoothException *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); if (!SWIG_IsOK(res) || !ptr) { - SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ExploreIOException" "', argument " "1"" of type '" "std::string""'"); + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ExploreNoBluetoothException" "', argument " "1"" of type '" "std::string""'"); } arg1 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (ExploreIOException *)new ExploreIOException(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (ExploreNoBluetoothException *)new ExploreNoBluetoothException(arg1); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9544,35 +9788,32 @@ SWIGINTERN PyObject *_wrap_new_ExploreIOException(PyObject *SWIGUNUSEDPARM(self) SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ExploreIOException, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ExploreNoBluetoothException, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ExploreIOException_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreNoBluetoothException_what(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ExploreIOException *arg1 = (ExploreIOException *) 0 ; + ExploreNoBluetoothException *arg1 = (ExploreNoBluetoothException *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; char *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreIOException, 0 | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreNoBluetoothException, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreIOException_what" "', argument " "1"" of type '" "ExploreIOException const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExploreNoBluetoothException_what" "', argument " "1"" of type '" "ExploreNoBluetoothException const *""'"); } - arg1 = reinterpret_cast< ExploreIOException * >(argp1); + arg1 = reinterpret_cast< ExploreNoBluetoothException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (char *)((ExploreIOException const *)arg1)->what(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (char *)((ExploreNoBluetoothException const *)arg1)->what(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9598,27 +9839,24 @@ SWIGINTERN PyObject *_wrap_ExploreIOException_what(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_delete_ExploreIOException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreNoBluetoothException(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ExploreIOException *arg1 = (ExploreIOException *) 0 ; + ExploreNoBluetoothException *arg1 = (ExploreNoBluetoothException *) 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_ExploreIOException, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreNoBluetoothException, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreIOException" "', argument " "1"" of type '" "ExploreIOException *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExploreNoBluetoothException" "', argument " "1"" of type '" "ExploreNoBluetoothException *""'"); } - arg1 = reinterpret_cast< ExploreIOException * >(argp1); + arg1 = reinterpret_cast< ExploreNoBluetoothException * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -9644,18 +9882,18 @@ SWIGINTERN PyObject *_wrap_delete_ExploreIOException(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *ExploreIOException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreNoBluetoothException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ExploreIOException, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_ExploreNoBluetoothException, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *ExploreIOException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *ExploreNoBluetoothException_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_address_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::string *arg2 = 0 ; @@ -9664,6 +9902,7 @@ SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), Py int res2 = SWIG_OLDOBJ ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_address_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -9681,11 +9920,7 @@ SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), Py } arg2 = ptr; } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->address = *arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->address = *arg2; resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; @@ -9695,7 +9930,7 @@ SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_address_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9703,6 +9938,7 @@ SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), Py PyObject *swig_obj[1] ; std::string *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); @@ -9710,11 +9946,7 @@ SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_address_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::string *) & ((arg1)->address); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::string *) & ((arg1)->address); resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: @@ -9722,7 +9954,7 @@ SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_name_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::string *arg2 = 0 ; @@ -9731,6 +9963,7 @@ SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObj int res2 = SWIG_OLDOBJ ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_name_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -9748,11 +9981,7 @@ SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObj } arg2 = ptr; } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->name = *arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->name = *arg2; resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; @@ -9762,7 +9991,7 @@ SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_name_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9770,6 +9999,7 @@ SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObj PyObject *swig_obj[1] ; std::string *result = 0 ; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); @@ -9777,11 +10007,7 @@ SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObj SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_name_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::string *) & ((arg1)->name); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (std::string *) & ((arg1)->name); resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: @@ -9789,7 +10015,7 @@ SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::time_t arg2 ; @@ -9799,6 +10025,7 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), P int res2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_lastSeen_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -9818,11 +10045,7 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), P if (SWIG_IsNewObj(res2)) delete temp; } } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->lastSeen = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->lastSeen = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -9830,7 +10053,7 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9838,6 +10061,7 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *SWIGUNUSEDPARM(self), P PyObject *swig_obj[1] ; std::time_t result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); @@ -9845,19 +10069,15 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *SWIGUNUSEDPARM(self), P SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_lastSeen_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((arg1)->lastSeen); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj((new std::time_t(static_cast< const std::time_t& >(result))), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); + result = ((arg1)->lastSeen); + resultobj = SWIG_NewPointerObj((new std::time_t(result)), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::time_t arg2 ; @@ -9867,6 +10087,7 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), P int res2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_lastUsed_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -9886,11 +10107,7 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), P if (SWIG_IsNewObj(res2)) delete temp; } } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->lastUsed = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->lastUsed = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -9898,7 +10115,7 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9906,6 +10123,7 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *SWIGUNUSEDPARM(self), P PyObject *swig_obj[1] ; std::time_t result; + (void)self; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); @@ -9913,19 +10131,15 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *SWIGUNUSEDPARM(self), P SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_lastUsed_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = ((arg1)->lastUsed); - SWIG_PYTHON_THREAD_END_ALLOW; - } - resultobj = SWIG_NewPointerObj((new std::time_t(static_cast< const std::time_t& >(result))), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); + result = ((arg1)->lastUsed); + resultobj = SWIG_NewPointerObj((new std::time_t(result)), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -9935,6 +10149,7 @@ SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_connected_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -9946,11 +10161,7 @@ SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "device_connected_set" "', argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->connected = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->connected = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -9958,7 +10169,7 @@ SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9966,6 +10177,7 @@ SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), 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_device, 0 | 0 ); @@ -9973,11 +10185,7 @@ SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_connected_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool) ((arg1)->connected); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool) ((arg1)->connected); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -9985,7 +10193,7 @@ SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -9995,6 +10203,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_remembered_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -10006,11 +10215,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "device_remembered_set" "', argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->remembered = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->remembered = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10018,7 +10223,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -10026,6 +10231,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), 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_device, 0 | 0 ); @@ -10033,11 +10239,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_remembered_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool) ((arg1)->remembered); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool) ((arg1)->remembered); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -10045,7 +10247,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -10055,6 +10257,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(sel int ecode2 = 0 ; PyObject *swig_obj[2] ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "device_authenticated_set", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_device, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -10066,11 +10269,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(sel SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "device_authenticated_set" "', argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - if (arg1) (arg1)->authenticated = arg2; - SWIG_PYTHON_THREAD_END_ALLOW; - } + if (arg1) (arg1)->authenticated = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10078,7 +10277,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -10086,6 +10285,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(sel 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_device, 0 | 0 ); @@ -10093,11 +10293,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(sel SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_authenticated_get" "', argument " "1"" of type '" "device *""'"); } arg1 = reinterpret_cast< device * >(argp1); - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (bool) ((arg1)->authenticated); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (bool) ((arg1)->authenticated); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -10105,18 +10301,15 @@ SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_new_device(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_device(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "new_device", 0, 0, 0)) SWIG_fail; { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (device *)new device(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (device *)new device(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10142,13 +10335,14 @@ SWIGINTERN PyObject *_wrap_new_device(PyObject *SWIGUNUSEDPARM(self), PyObject * } -SWIGINTERN PyObject *_wrap_delete_device(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_device(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 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_device, SWIG_POINTER_DISOWN | 0 ); @@ -10158,11 +10352,7 @@ SWIGINTERN PyObject *_wrap_delete_device(PyObject *SWIGUNUSEDPARM(self), PyObjec arg1 = reinterpret_cast< device * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10199,13 +10389,14 @@ SWIGINTERN PyObject *device_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *a return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 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_ExploreSDK, SWIG_POINTER_DISOWN | 0 ); @@ -10215,11 +10406,7 @@ SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyO arg1 = reinterpret_cast< ExploreSDK * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - delete arg1; - SWIG_PYTHON_THREAD_END_ALLOW; - } + delete arg1; } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10245,18 +10432,15 @@ SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *result = 0 ; + (void)self; if (!SWIG_Python_UnpackTuple(args, "ExploreSDK_Create", 0, 0, 0)) SWIG_fail; { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (ExploreSDK *)ExploreSDK::Create(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (ExploreSDK *)ExploreSDK::Create(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10282,7 +10466,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; int arg2 ; @@ -10292,6 +10476,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIG int ecode2 = 0 ; std::vector< device,std::allocator< device > > result; + (void)self; if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreSDK, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -10305,11 +10490,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIG arg2 = static_cast< int >(val2); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->PerformDeviceSearch(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->PerformDeviceSearch(arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10335,13 +10516,14 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIG } -SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::vector< device,std::allocator< device > > result; + (void)self; if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreSDK, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -10350,11 +10532,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *SWIG arg1 = reinterpret_cast< ExploreSDK * >(argp1); { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (arg1)->PerformDeviceSearch(); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (arg1)->PerformDeviceSearch(); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10389,7 +10567,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje if (!(argc = SWIG_Python_UnpackTuple(args, "ExploreSDK_PerformDeviceSearch", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ExploreSDK, 0); _v = SWIG_CheckState(res); @@ -10398,7 +10576,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ExploreSDK, 0); _v = SWIG_CheckState(res); @@ -10422,7 +10600,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje } -SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; std::string arg2 ; @@ -10431,6 +10609,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *swig_obj[2] ; int result; + (void)self; if (!SWIG_Python_UnpackTuple(args, "ExploreSDK_SdpSearch", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ExploreSDK, 0 | 0 ); if (!SWIG_IsOK(res1)) { @@ -10448,11 +10627,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *SWIGUNUSEDPARM(self), } { try { - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)(arg1)->SdpSearch(arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (int)(arg1)->SdpSearch(arg2); } catch(const ExploreException& e) { SWIG_exception(SWIG_ValueError, e.what()); } @@ -10486,7 +10661,6 @@ SWIGINTERN PyObject *ExploreSDK_swigregister(PyObject *SWIGUNUSEDPARM(self), PyO } static PyMethodDef SwigMethods[] = { - { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, { "delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_O, NULL}, { "SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_O, NULL}, { "SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL}, @@ -10568,6 +10742,11 @@ static PyMethodDef SwigMethods[] = { { "delete_ExploreIOException", _wrap_delete_ExploreIOException, METH_O, NULL}, { "ExploreIOException_swigregister", ExploreIOException_swigregister, METH_O, NULL}, { "ExploreIOException_swiginit", ExploreIOException_swiginit, METH_VARARGS, NULL}, + { "new_ExploreNoBluetoothException", _wrap_new_ExploreNoBluetoothException, METH_O, NULL}, + { "ExploreNoBluetoothException_what", _wrap_ExploreNoBluetoothException_what, METH_O, NULL}, + { "delete_ExploreNoBluetoothException", _wrap_delete_ExploreNoBluetoothException, METH_O, NULL}, + { "ExploreNoBluetoothException_swigregister", ExploreNoBluetoothException_swigregister, METH_O, NULL}, + { "ExploreNoBluetoothException_swiginit", ExploreNoBluetoothException_swiginit, METH_VARARGS, NULL}, { "device_address_set", _wrap_device_address_set, METH_VARARGS, NULL}, { "device_address_get", _wrap_device_address_get, METH_O, NULL}, { "device_name_set", _wrap_device_name_set, METH_VARARGS, NULL}, @@ -10594,29 +10773,29 @@ static PyMethodDef SwigMethods[] = { { NULL, NULL, 0, NULL } }; -static PyMethodDef SwigMethods_proxydocs[] = { - { NULL, NULL, 0, NULL } -}; - /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ -static void *_p_ExploreExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((std::exception *) ((ExploreException *) x)); -} -static void *_p_ExploreReadBufferExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((std::exception *) ((ExploreReadBufferException *) x)); -} static void *_p_ExploreBtSocketExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((std::exception *) ((ExploreBtSocketException *) x)); } +static void *_p_ExploreExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((std::exception *) ((ExploreException *) x)); +} static void *_p_ExploreIOExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((std::exception *) ((ExploreIOException *) x)); } +static void *_p_ExploreNoBluetoothExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((std::exception *) ((ExploreNoBluetoothException *) x)); +} +static void *_p_ExploreReadBufferExceptionTo_p_std__exception(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((std::exception *) ((ExploreReadBufferException *) x)); +} static swig_type_info _swigt__p_BTSerialPortBinding = {"_p_BTSerialPortBinding", "BTSerialPortBinding *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ExploreBtSocketException = {"_p_ExploreBtSocketException", "ExploreBtSocketException *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ExploreException = {"_p_ExploreException", "ExploreException *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ExploreIOException = {"_p_ExploreIOException", "ExploreIOException *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ExploreNoBluetoothException = {"_p_ExploreNoBluetoothException", "ExploreNoBluetoothException *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ExploreReadBufferException = {"_p_ExploreReadBufferException", "ExploreReadBufferException *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ExploreSDK = {"_p_ExploreSDK", "ExploreSDK *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0}; @@ -10630,7 +10809,7 @@ static swig_type_info _swigt__p_std__allocatorT_device_t = {"_p_std__allocatorT_ static swig_type_info _swigt__p_std__exception = {"_p_std__exception", "std::exception *", 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__time_t = {"_p_std__time_t", "std::time_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_device_std__allocatorT_device_t_t = {"_p_std__vectorT_device_std__allocatorT_device_t_t", "std::vector< device,std::allocator< device > > *|std::vector< device > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_device_t = {"_p_std__vectorT_device_t", "std::vector< device,std::allocator< device > > *|std::vector< device > *", 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_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0}; @@ -10639,6 +10818,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_ExploreBtSocketException, &_swigt__p_ExploreException, &_swigt__p_ExploreIOException, + &_swigt__p_ExploreNoBluetoothException, &_swigt__p_ExploreReadBufferException, &_swigt__p_ExploreSDK, &_swigt__p_allocator_type, @@ -10652,7 +10832,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_std__exception, &_swigt__p_std__invalid_argument, &_swigt__p_std__time_t, - &_swigt__p_std__vectorT_device_std__allocatorT_device_t_t, + &_swigt__p_std__vectorT_device_t, &_swigt__p_swig__SwigPyIterator, &_swigt__p_value_type, }; @@ -10661,6 +10841,7 @@ static swig_cast_info _swigc__p_BTSerialPortBinding[] = { {&_swigt__p_BTSerialP static swig_cast_info _swigc__p_ExploreBtSocketException[] = { {&_swigt__p_ExploreBtSocketException, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExploreException[] = { {&_swigt__p_ExploreException, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExploreIOException[] = { {&_swigt__p_ExploreIOException, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ExploreNoBluetoothException[] = { {&_swigt__p_ExploreNoBluetoothException, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExploreReadBufferException[] = { {&_swigt__p_ExploreReadBufferException, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ExploreSDK[] = { {&_swigt__p_ExploreSDK, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}}; @@ -10671,10 +10852,10 @@ static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0 static swig_cast_info _swigc__p_p_PyObject[] = { {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__allocatorT_device_t[] = { {&_swigt__p_std__allocatorT_device_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__exception[] = { {&_swigt__p_std__exception, 0, 0, 0}, {&_swigt__p_ExploreException, _p_ExploreExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreReadBufferException, _p_ExploreReadBufferExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreBtSocketException, _p_ExploreBtSocketExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreIOException, _p_ExploreIOExceptionTo_p_std__exception, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__exception[] = { {&_swigt__p_std__exception, 0, 0, 0}, {&_swigt__p_ExploreBtSocketException, _p_ExploreBtSocketExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreException, _p_ExploreExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreIOException, _p_ExploreIOExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreNoBluetoothException, _p_ExploreNoBluetoothExceptionTo_p_std__exception, 0, 0}, {&_swigt__p_ExploreReadBufferException, _p_ExploreReadBufferExceptionTo_p_std__exception, 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__time_t[] = { {&_swigt__p_std__time_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_device_std__allocatorT_device_t_t[] = { {&_swigt__p_std__vectorT_device_std__allocatorT_device_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_device_t[] = { {&_swigt__p_std__vectorT_device_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_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}}; @@ -10683,6 +10864,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_ExploreBtSocketException, _swigc__p_ExploreException, _swigc__p_ExploreIOException, + _swigc__p_ExploreNoBluetoothException, _swigc__p_ExploreReadBufferException, _swigc__p_ExploreSDK, _swigc__p_allocator_type, @@ -10696,7 +10878,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_std__exception, _swigc__p_std__invalid_argument, _swigc__p_std__time_t, - _swigc__p_std__vectorT_device_std__allocatorT_device_t_t, + _swigc__p_std__vectorT_device_t, _swigc__p_swig__SwigPyIterator, _swigc__p_value_type, }; @@ -10762,9 +10944,12 @@ extern "C" { #define SWIGRUNTIME_DEBUG #endif +#ifndef SWIG_INIT_CLIENT_DATA_TYPE +#define SWIG_INIT_CLIENT_DATA_TYPE void * +#endif SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { +SWIG_InitializeModule(SWIG_INIT_CLIENT_DATA_TYPE clientdata) { size_t i; swig_module_info *module_head, *iter; int init; @@ -10947,214 +11132,6 @@ SWIG_PropagateClientData(void) { extern "C" { #endif - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; - if (PyType_Ready(&varlink_type) < 0) - return NULL; - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - memcpy(gv->name, name, size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *globals = 0; - if (!globals) { - globals = SWIG_newvarlink(); - } - return globals; - } - /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ @@ -11183,15 +11160,12 @@ extern "C" { } } - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ + /* ----------------------------------------------------------------------------- + * Patch %callback methods' docstrings to hold the callback ptrs + * -----------------------------------------------------------------------------*/ SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { + SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; @@ -11199,7 +11173,7 @@ extern "C" { c = strstr(c, "swig_ptr: "); if (c) { int j; - swig_const_info *ci = 0; + const swig_const_info *ci = 0; const char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, @@ -11231,68 +11205,13 @@ extern "C" { } } - /* ----------------------------------------------------------------------------- - * Method creation and docstring support functions - * ----------------------------------------------------------------------------- */ - - /* ----------------------------------------------------------------------------- - * Function to find the method definition with the correct docstring for the - * proxy module as opposed to the low-level API - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { - /* Find the function in the modified method table */ - size_t offset = 0; - int found = 0; - while (SwigMethods_proxydocs[offset].ml_meth != NULL) { - if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { - found = 1; - break; - } - offset++; - } - /* Use the copy with the modified docstring if available */ - return found ? &SwigMethods_proxydocs[offset] : NULL; - } - - /* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif - } - - /* ----------------------------------------------------------------------------- - * Wrapper of PyStaticMethod_New() - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } - return PyStaticMethod_New(func); - } - #ifdef __cplusplus } #endif + + + /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ @@ -11432,9 +11351,6 @@ SWIG_init(void) { // thread safe initialization swig::container_owner_attribute(); - - /* Initialize threading */ - SWIG_PYTHON_INITIALIZE_THREADS; #if PY_VERSION_HEX >= 0x03000000 return m; #else diff --git a/lib/mac/_exploresdk.so b/lib/mac/_exploresdk.so old mode 100644 new mode 100755 index 97e302fb..6c79daae Binary files a/lib/mac/_exploresdk.so and b/lib/mac/_exploresdk.so differ diff --git a/lib/mac/create_shared_lib.sh b/lib/mac/create_shared_lib.sh old mode 100644 new mode 100755 index 606269cd..951a8dd6 --- a/lib/mac/create_shared_lib.sh +++ b/lib/mac/create_shared_lib.sh @@ -27,22 +27,40 @@ #ln -s -f /usr/local/bin/python3.7 /usr/local/bin/python #python can be found at: #/Library/Frameworks/Python.framework/Versions/3.7/ - +#For Sonoma OS: +#/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers swig -python -c++ -py3 -extranative -threads -debug-classes swig_interface.i -# for windows: use the -threads option +# for windows: use the -threads option #swig -python -c++ -py3 -extranative -debug-classes swig_interface.i -c++ -c -fpic swig_interface_wrap.cxx -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ -ObjC++ -std=c++11 +c++ -c -fpic swig_interface_wrap.cxx -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -ObjC++ -std=c++11 + +c++ -c -fpic BluetoothDeviceResources.mm -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -ObjC++ -std=c++11 + +c++ -c -fpic BluetoothWorker.mm -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -ObjC++ -std=c++11 + +c++ -c -fpic BTSerialPortBinding.mm -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -ObjC++ -std=c++11 + +c++ -c -fpic -std=c++11 DeviceINQ.mm -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -ObjC++ -std=c++11 -c++ -c -fpic BluetoothDeviceResources.mm -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ -ObjC++ -std=c++11 +gcc -c -fpic pipe.c -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c++ -c -fpic BluetoothWorker.mm -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ -ObjC++ -std=c++11 +# Get the architecture +architecture=$(arch) -c++ -c -fpic BTSerialPortBinding.mm -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ -ObjC++ -std=c++11 +# Base command +base_command="c++ -shared -flat_namespace" -c++ -c -fpic -std=c++11 DeviceINQ.mm -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ -ObjC++ -std=c++11 +# Add architecture-specific flag if architecture is arm64 +if [ "$architecture" == "arm64" ]; then + arch_flag="-arch arm64" +else + arch_flag="" +fi -gcc -c -fpic pipe.c -I/usr/local/Cellar/python@3.7/3.7.11/Frameworks/Python.framework/Versions/3.7/include/python3.7m/ +# Complete command with other flags and files +complete_command="$base_command $arch_flag -undefined suppress BTSerialPortBinding.o DeviceINQ.o BluetoothDeviceResources.o BluetoothWorker.o pipe.o swig_interface_wrap.o -std=c++11 -framework foundation -framework IOBluetooth -o _exploresdk.so" -c++ -shared -flat_namespace -undefined suppress BTSerialPortBinding.o DeviceINQ.o BluetoothDeviceResources.o BluetoothWorker.o pipe.o swig_interface_wrap.o -std=c++11 -framework foundation -framework IOBluetooth -o _exploresdk.so +# Execute the complete command +$complete_command rm -rf *.o diff --git a/lib/mac/exploresdk.py b/lib/mac/exploresdk.py index 96d5aaf8..7d91b5e0 100644 --- a/lib/mac/exploresdk.py +++ b/lib/mac/exploresdk.py @@ -1,13 +1,10 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.2 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") - # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _exploresdk @@ -29,10 +26,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -61,7 +58,11 @@ class _SwigNonDynamicMeta(type): __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) -import collections.abc +if _swig_python_version_info[0:2] >= (3, 3): + import collections.abc +else: + import collections + class SwigPyIterator(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -70,59 +71,58 @@ def __init__(self, *args, **kwargs): __repr__ = _swig_repr __swig_destroy__ = _exploresdk.delete_SwigPyIterator - def value(self) -> "PyObject *": + def value(self): return _exploresdk.SwigPyIterator_value(self) - def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + def incr(self, n=1): return _exploresdk.SwigPyIterator_incr(self, n) - def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + def decr(self, n=1): return _exploresdk.SwigPyIterator_decr(self, n) - def distance(self, x: "SwigPyIterator") -> "ptrdiff_t": + def distance(self, x): return _exploresdk.SwigPyIterator_distance(self, x) - def equal(self, x: "SwigPyIterator") -> "bool": + def equal(self, x): return _exploresdk.SwigPyIterator_equal(self, x) - def copy(self) -> "swig::SwigPyIterator *": + def copy(self): return _exploresdk.SwigPyIterator_copy(self) - def next(self) -> "PyObject *": + def next(self): return _exploresdk.SwigPyIterator_next(self) - def __next__(self) -> "PyObject *": + def __next__(self): return _exploresdk.SwigPyIterator___next__(self) - def previous(self) -> "PyObject *": + def previous(self): return _exploresdk.SwigPyIterator_previous(self) - def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + def advance(self, n): return _exploresdk.SwigPyIterator_advance(self, n) - def __eq__(self, x: "SwigPyIterator") -> "bool": + def __eq__(self, x): return _exploresdk.SwigPyIterator___eq__(self, x) - def __ne__(self, x: "SwigPyIterator") -> "bool": + def __ne__(self, x): return _exploresdk.SwigPyIterator___ne__(self, x) - def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + def __iadd__(self, n): return _exploresdk.SwigPyIterator___iadd__(self, n) - def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + def __isub__(self, n): return _exploresdk.SwigPyIterator___isub__(self, n) - def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + def __add__(self, n): return _exploresdk.SwigPyIterator___add__(self, n) - def __sub__(self, *args) -> "ptrdiff_t": + def __sub__(self, *args): return _exploresdk.SwigPyIterator___sub__(self, *args) def __iter__(self): return self # Register SwigPyIterator in _exploresdk: _exploresdk.SwigPyIterator_swigregister(SwigPyIterator) - class BTSerialPortBinding(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -132,136 +132,131 @@ def __init__(self, *args, **kwargs): __swig_destroy__ = _exploresdk.delete_BTSerialPortBinding @staticmethod - def Create(address: "std::string", channelID: "int") -> "BTSerialPortBinding *": + def Create(address, channelID): return _exploresdk.BTSerialPortBinding_Create(address, channelID) - def Connect(self) -> "int": + def Connect(self): return _exploresdk.BTSerialPortBinding_Connect(self) - def Close(self) -> "void": + def Close(self): return _exploresdk.BTSerialPortBinding_Close(self) - def Read(self, bt_buffer: "char *") -> "void": + def Read(self, bt_buffer): return _exploresdk.BTSerialPortBinding_Read(self, bt_buffer) - def Write(self, write_buffer: "char const *") -> "void": + def Write(self, write_buffer): return _exploresdk.BTSerialPortBinding_Write(self, write_buffer) - def IsDataAvailable(self) -> "bool": + def IsDataAvailable(self): return _exploresdk.BTSerialPortBinding_IsDataAvailable(self) # Register BTSerialPortBinding in _exploresdk: _exploresdk.BTSerialPortBinding_swigregister(BTSerialPortBinding) - -def BTSerialPortBinding_Create(address: "std::string", channelID: "int") -> "BTSerialPortBinding *": - return _exploresdk.BTSerialPortBinding_Create(address, channelID) - -class vectordevice(collections.abc.MutableSequence): +class vectordevice(collections.abc.MutableSequence if _swig_python_version_info >= (3, 3) else collections.MutableSequence): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def iterator(self) -> "swig::SwigPyIterator *": + def iterator(self): return _exploresdk.vectordevice_iterator(self) def __iter__(self): return self.iterator() - def __nonzero__(self) -> "bool": + def __nonzero__(self): return _exploresdk.vectordevice___nonzero__(self) - def __bool__(self) -> "bool": + def __bool__(self): return _exploresdk.vectordevice___bool__(self) - def __len__(self) -> "std::vector< device >::size_type": + def __len__(self): return _exploresdk.vectordevice___len__(self) - def __getslice__(self, i: "std::vector< device >::difference_type", j: "std::vector< device >::difference_type") -> "std::vector< device,std::allocator< device > > *": + def __getslice__(self, i, j): return _exploresdk.vectordevice___getslice__(self, i, j) - def __setslice__(self, *args) -> "void": + def __setslice__(self, *args): return _exploresdk.vectordevice___setslice__(self, *args) - def __delslice__(self, i: "std::vector< device >::difference_type", j: "std::vector< device >::difference_type") -> "void": + def __delslice__(self, i, j): return _exploresdk.vectordevice___delslice__(self, i, j) - def __delitem__(self, *args) -> "void": + def __delitem__(self, *args): return _exploresdk.vectordevice___delitem__(self, *args) - def __getitem__(self, *args) -> "std::vector< device >::value_type const &": + def __getitem__(self, *args): return _exploresdk.vectordevice___getitem__(self, *args) - def __setitem__(self, *args) -> "void": + def __setitem__(self, *args): return _exploresdk.vectordevice___setitem__(self, *args) - def pop(self) -> "std::vector< device >::value_type": + def pop(self): return _exploresdk.vectordevice_pop(self) - def append(self, x: "device") -> "void": + def append(self, x): return _exploresdk.vectordevice_append(self, x) - def empty(self) -> "bool": + def empty(self): return _exploresdk.vectordevice_empty(self) - def size(self) -> "std::vector< device >::size_type": + def size(self): return _exploresdk.vectordevice_size(self) - def swap(self, v: "vectordevice") -> "void": + def swap(self, v): return _exploresdk.vectordevice_swap(self, v) - def begin(self) -> "std::vector< device >::iterator": + def begin(self): return _exploresdk.vectordevice_begin(self) - def end(self) -> "std::vector< device >::iterator": + def end(self): return _exploresdk.vectordevice_end(self) - def rbegin(self) -> "std::vector< device >::reverse_iterator": + def rbegin(self): return _exploresdk.vectordevice_rbegin(self) - def rend(self) -> "std::vector< device >::reverse_iterator": + def rend(self): return _exploresdk.vectordevice_rend(self) - def clear(self) -> "void": + def clear(self): return _exploresdk.vectordevice_clear(self) - def get_allocator(self) -> "std::vector< device >::allocator_type": + def get_allocator(self): return _exploresdk.vectordevice_get_allocator(self) - def pop_back(self) -> "void": + def pop_back(self): return _exploresdk.vectordevice_pop_back(self) - def erase(self, *args) -> "std::vector< device >::iterator": + def erase(self, *args): return _exploresdk.vectordevice_erase(self, *args) def __init__(self, *args): _exploresdk.vectordevice_swiginit(self, _exploresdk.new_vectordevice(*args)) - def push_back(self, x: "device") -> "void": + def push_back(self, x): return _exploresdk.vectordevice_push_back(self, x) - def front(self) -> "std::vector< device >::value_type const &": + def front(self): return _exploresdk.vectordevice_front(self) - def back(self) -> "std::vector< device >::value_type const &": + def back(self): return _exploresdk.vectordevice_back(self) - def assign(self, n: "std::vector< device >::size_type", x: "device") -> "void": + def assign(self, n, x): return _exploresdk.vectordevice_assign(self, n, x) - def resize(self, *args) -> "void": + def resize(self, *args): return _exploresdk.vectordevice_resize(self, *args) - def insert(self, *args) -> "void": + def insert(self, *args): return _exploresdk.vectordevice_insert(self, *args) - def reserve(self, n: "std::vector< device >::size_type") -> "void": + def reserve(self, n): return _exploresdk.vectordevice_reserve(self, n) - def capacity(self) -> "std::vector< device >::size_type": + def capacity(self): return _exploresdk.vectordevice_capacity(self) __swig_destroy__ = _exploresdk.delete_vectordevice # Register vectordevice in _exploresdk: _exploresdk.vectordevice_swigregister(vectordevice) - class device(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -279,7 +274,6 @@ def __init__(self): # Register device in _exploresdk: _exploresdk.device_swigregister(device) - class ExploreSDK(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -289,20 +283,15 @@ def __init__(self, *args, **kwargs): __swig_destroy__ = _exploresdk.delete_ExploreSDK @staticmethod - def Create() -> "ExploreSDK *": + def Create(): return _exploresdk.ExploreSDK_Create() - def PerformDeviceSearch(self, length: "int"=8) -> "std::vector< device,std::allocator< device > >": + def PerformDeviceSearch(self, length=8): return _exploresdk.ExploreSDK_PerformDeviceSearch(self, length) - def SdpSearch(self, address: "std::string") -> "int": + def SdpSearch(self, address): return _exploresdk.ExploreSDK_SdpSearch(self, address) # Register ExploreSDK in _exploresdk: _exploresdk.ExploreSDK_swigregister(ExploreSDK) -def ExploreSDK_Create() -> "ExploreSDK *": - return _exploresdk.ExploreSDK_Create() - - - diff --git a/lib/mac/swig_interface_wrap.cxx b/lib/mac/swig_interface_wrap.cxx index 695a4b86..88de37f4 100644 --- a/lib/mac/swig_interface_wrap.cxx +++ b/lib/mac/swig_interface_wrap.cxx @@ -1,46 +1,18 @@ /* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.2 + * This file was automatically generated by SWIG (https://www.swig.org). + * Version 4.1.1 * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. + * Do not make changes to this file unless you know what you are doing - modify + * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ -#ifndef SWIGPYTHON +#define SWIG_VERSION 0x040101 #define SWIGPYTHON -#endif - #define SWIG_PYTHON_THREADS #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #define SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -171,8 +143,26 @@ template T SwigValueInit() { # include #endif +#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) +#define PY_SSIZE_T_CLEAN +#endif + +#if __GNUC__ >= 7 +#pragma GCC diagnostic push +#if defined(__cplusplus) && __cplusplus >=201703L +#pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */ +#endif +#endif + #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ + +#if defined(_MSC_VER) && _MSC_VER >= 1929 +/* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later + * See https://github.com/swig/swig/issues/2090 */ +# include +#endif + # undef _DEBUG # include # define _DEBUG 1 @@ -180,6 +170,10 @@ template T SwigValueInit() { # include #endif +#if __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif + /* ----------------------------------------------------------------------------- * swigrun.swg * @@ -226,6 +220,8 @@ template T SwigValueInit() { #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 #define SWIG_POINTER_NO_NULL 0x4 +#define SWIG_POINTER_CLEAR 0x8 +#define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN) /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,7 +293,7 @@ template T SwigValueInit() { SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this + allows returning the 'cast rank', for example, if you have this int food(double) int fooi(int); @@ -311,7 +307,13 @@ template T SwigValueInit() { */ #define SWIG_OK (0) +/* Runtime errors are < 0 */ #define SWIG_ERROR (-1) +/* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */ +/* Errors in range -100 to -199 are language specific errors defined in *errors.swg */ +/* Errors < -200 are generic runtime specific errors */ +#define SWIG_ERROR_RELEASE_NOT_OWNED (-200) + #define SWIG_IsOK(r) (r >= 0) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) @@ -326,7 +328,7 @@ template T SwigValueInit() { #define SWIG_OLDOBJ (SWIG_OK) #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ +/* Check, add and del object mask methods */ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) @@ -472,7 +474,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { +SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { @@ -532,9 +534,9 @@ SWIG_TypeName(const swig_type_info *ty) { SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ + type, separated by vertical-bar characters. Choose the last + name. It should be the most specific; a fully resolved name + but not necessarily with default template parameters expanded. */ if (!type) return NULL; if (type->str != NULL) { const char *last_name = type->str; @@ -754,7 +756,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { } #endif -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -770,7 +772,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define SWIG_NullReferenceError -13 - /* Compatibility macros for Python 3 */ #if PY_VERSION_HEX >= 0x03000000 @@ -786,7 +787,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define PyString_Size(str) PyBytes_Size(str) #define PyString_InternFromString(key) PyUnicode_InternFromString(key) #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) #endif @@ -804,38 +804,19 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #endif -/* Warning: This function will allocate a new string in Python 3, - * so please call SWIG_Python_str_DelForPy3(x) to free the space. - */ SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { #if PY_VERSION_HEX >= 0x03030000 return (char *)PyUnicode_AsUTF8(str); -#elif PY_VERSION_HEX >= 0x03000000 - char *newstr = 0; - str = PyUnicode_AsUTF8String(str); - if (str) { - char *cstr; - Py_ssize_t len; - if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { - newstr = (char *) malloc(len+1); - if (newstr) - memcpy(newstr, cstr, len+1); - } - Py_XDECREF(str); - } - return newstr; #else return PyString_AsString(str); #endif } -#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 -# define SWIG_Python_str_DelForPy3(x) -#else -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) -#endif +/* Was useful for Python 3.0.x-3.2.x - now provided only for compatibility + * with any uses in user interface files. */ +#define SWIG_Python_str_DelForPy3(x) SWIGINTERN PyObject* @@ -852,10 +833,14 @@ SWIG_Python_str_FromChar(const char *c) # define PyObject_DEL PyObject_Del #endif -// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user -// interface files check for it. +/* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */ # define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) +#ifdef SWIGPYTHON_BUILTIN +# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME +#else +# define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME +#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME) #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) @@ -929,7 +914,6 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyErr_Format(type, "%s %s", tmp, mesg); else PyErr_Format(type, "%s", mesg); - SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -960,8 +944,12 @@ SWIG_Python_RaiseOrModifyTypeError(const char *message) #else newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); #endif - Py_XDECREF(value); - PyErr_Restore(type, newvalue, traceback); + if (newvalue) { + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + PyErr_Restore(type, value, traceback); + } } else { /* Raise TypeError using given message */ PyErr_SetString(PyExc_TypeError, message); @@ -978,8 +966,12 @@ SWIG_Python_RaiseOrModifyTypeError(const char *message) # define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# if PY_VERSION_HEX < 0x03070000 +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# else +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif # endif # ifdef __cplusplus /* C++ code */ class SWIG_Python_Thread_Block { @@ -1077,8 +1069,8 @@ typedef struct swig_const_info { # error "This version of SWIG only supports Python >= 2.7" #endif -#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 -# error "This version of SWIG only supports Python 3 >= 3.2" +#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000 +# error "This version of SWIG only supports Python 3 >= 3.3" #endif /* Common SWIG API */ @@ -1193,7 +1185,12 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { if (!PyList_Check(result)) { PyObject *o2 = result; result = PyList_New(1); - PyList_SetItem(result, 0, o2); + if (result) { + PyList_SET_ITEM(result, 0, o2); + } else { + Py_DECREF(obj); + return o2; + } } PyList_Append(result,obj); Py_DECREF(obj); @@ -1275,6 +1272,238 @@ SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var #endif +#ifdef __cplusplus +extern "C" { +#endif + +/* Python-specific SWIG API */ +#define SWIG_newvarlink() SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) + +/* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + +typedef struct swig_globalvar { + char *name; /* Name of global variable */ + PyObject *(*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject *); /* Set the value */ + struct swig_globalvar *next; +} swig_globalvar; + +typedef struct swig_varlinkobject { + PyObject_HEAD + swig_globalvar *vars; +} swig_varlinkobject; + +SWIGINTERN PyObject * +swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else + return PyString_FromString(""); +#endif +} + +SWIGINTERN PyObject * +swig_varlink_str(PyObject *o) { + swig_varlinkobject *v = (swig_varlinkobject *) o; +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else + PyObject *str = PyString_FromString("("); + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + PyString_ConcatAndDel(&str,PyString_FromString(var->name)); + if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); + } + PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif + return str; +} + +SWIGINTERN void +swig_varlink_dealloc(PyObject *o) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + swig_globalvar *var = v->vars; + while (var) { + swig_globalvar *n = var->next; + free(var->name); + free(var); + var = n; + } +} + +SWIGINTERN PyObject * +swig_varlink_getattr(PyObject *o, char *n) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + PyObject *res = NULL; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->get_attr)(); + break; + } + var = var->next; + } + if (res == NULL && !PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN int +swig_varlink_setattr(PyObject *o, char *n, PyObject *p) { + swig_varlinkobject *v = (swig_varlinkobject *) o; + int res = 1; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->set_attr)(p); + break; + } + var = var->next; + } + if (res == 1 && !PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN PyTypeObject* +swig_varlink_type(void) { + static char varlink__doc__[] = "Swig var link object"; + static PyTypeObject varlink_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) swig_varlink_dealloc, /* tp_dealloc */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif + (getattrfunc) swig_varlink_getattr, /* tp_getattr */ + (setattrfunc) swig_varlink_setattr, /* tp_setattr */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) swig_varlink_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + varlink__doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; + if (PyType_Ready(&varlink_type) < 0) + return NULL; + } + return &varlink_type; +} + +/* Create a variable linking object for use later */ +SWIGINTERN PyObject * +SWIG_Python_newvarlink(void) { + swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); + if (result) { + result->vars = 0; + } + return ((PyObject*) result); +} + +SWIGINTERN void +SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + swig_varlinkobject *v = (swig_varlinkobject *) p; + swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); + if (gv) { + size_t size = strlen(name)+1; + gv->name = (char *)malloc(size); + if (gv->name) { + memcpy(gv->name, name, size); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + } + } + v->vars = gv; +} + + +static PyObject *Swig_Globals_global = NULL; + +SWIGINTERN PyObject * +SWIG_globals(void) { + if (Swig_Globals_global == NULL) { + Swig_Globals_global = SWIG_newvarlink(); + } + return Swig_Globals_global; +} + +#ifdef __cplusplus +} +#endif + /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ @@ -1345,18 +1574,25 @@ SwigPyClientData_New(PyObject* obj) /* the newraw method and newargs arguments used to create a new raw instance */ if (PyClass_Check(obj)) { data->newraw = 0; - data->newargs = obj; Py_INCREF(obj); + data->newargs = obj; } else { data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); + data->newargs = PyTuple_New(1); + if (data->newargs) { + Py_INCREF(obj); + PyTuple_SET_ITEM(data->newargs, 0, obj); + } else { + Py_DECREF(data->newraw); + Py_DECREF(data->klass); + free(data); + return 0; + } } else { - data->newargs = obj; + Py_INCREF(obj); + data->newargs = obj; } - Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); @@ -1365,10 +1601,7 @@ SwigPyClientData_New(PyObject* obj) data->destroy = 0; } if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); - data->delargs = !(flags & (METH_O)); + data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O); } else { data->delargs = 0; } @@ -1379,10 +1612,13 @@ SwigPyClientData_New(PyObject* obj) } SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { +SwigPyClientData_Del(SwigPyClientData *data) +{ + Py_XDECREF(data->klass); Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); + free(data); } /* =============== SwigPyObject =====================*/ @@ -1409,7 +1645,7 @@ SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) if (!sobj->dict) sobj->dict = PyDict_New(); - Py_INCREF(sobj->dict); + Py_XINCREF(sobj->dict); return sobj->dict; } @@ -1427,18 +1663,21 @@ SwigPyObject_format(const char* fmt, SwigPyObject *v) PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { - PyObject *ofmt = SWIG_Python_str_FromChar(fmt); + PyObject *val = SwigPyObject_long(v); + if (val) { + PyObject *ofmt; + PyTuple_SET_ITEM(args, 0, val); + ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { #if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); + res = PyUnicode_Format(ofmt,args); #else - res = PyString_Format(ofmt,args); + res = PyString_Format(ofmt,args); #endif - Py_DECREF(ofmt); + Py_DECREF(ofmt); } - Py_DECREF(args); } + Py_DECREF(args); } return res; } @@ -1460,18 +1699,23 @@ SwigPyObject_repr(SwigPyObject *v) { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { + if (repr && v->next) { PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); + if (nrep) { # if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; # else - PyString_ConcatAndDel(&repr,nrep); + PyString_ConcatAndDel(&repr,nrep); # endif + } else { + Py_DecRef(repr); + repr = NULL; + } } - return repr; + return repr; } /* We need a version taking two PyObject* parameters so it's a valid @@ -1541,6 +1785,8 @@ SwigPyObject_Check(PyObject *op) { SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own); +static PyObject* Swig_Capsule_global = NULL; + SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v) { @@ -1567,8 +1813,12 @@ SwigPyObject_dealloc(PyObject *v) if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); + if (tmp) { + res = SWIG_Python_CallFunctor(destroy, tmp); + } else { + res = 0; + } + Py_XDECREF(tmp); } else { PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); PyObject *mself = PyCFunction_GET_SELF(destroy); @@ -1587,8 +1837,12 @@ SwigPyObject_dealloc(PyObject *v) printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); } #endif - } + Py_XDECREF(Swig_Capsule_global); + } Py_XDECREF(next); +#ifdef SWIGPYTHON_BUILTIN + Py_XDECREF(sobj->dict); +#endif PyObject_DEL(v); } @@ -1600,6 +1854,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; } + ((SwigPyObject *)next)->next = sobj->next; sobj->next = next; Py_INCREF(next); return SWIG_Py_Void(); @@ -1644,9 +1899,9 @@ SwigPyObject_own(PyObject *v, PyObject *args) PyObject *obj = PyBool_FromLong(sobj->own); if (val) { if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); + Py_DECREF(SwigPyObject_acquire(v,args)); } else { - SwigPyObject_disown(v,args); + Py_DECREF(SwigPyObject_disown(v,args)); } } return obj; @@ -1726,7 +1981,11 @@ SwigPyObject_TypeOnce(void) { sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 @@ -1791,7 +2050,7 @@ SwigPyObject_TypeOnce(void) { }; swigpyobject_type = tmp; type_init = 1; - if (PyType_Ready(&swigpyobject_type) < 0) + if (PyType_Ready(&swigpyobject_type) != 0) return NULL; } return &swigpyobject_type; @@ -1806,6 +2065,15 @@ SwigPyObject_New(void *ptr, swig_type_info *ty, int own) sobj->ty = ty; sobj->own = own; sobj->next = 0; +#ifdef SWIGPYTHON_BUILTIN + sobj->dict = 0; +#endif + if (own == SWIG_POINTER_OWN) { + /* Obtain a reference to the Python capsule wrapping the module information, so that the + * module information is correctly destroyed after all SWIG python objects have been freed + * by the GC (and corresponding destructors invoked) */ + Py_XINCREF(Swig_Capsule_global); + } } return (PyObject *)sobj; } @@ -1893,7 +2161,11 @@ SwigPyPacked_TypeOnce(void) { sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - 0, /* tp_print */ +#if PY_VERSION_HEX < 0x030800b4 + (printfunc)0, /*tp_print*/ +#else + (Py_ssize_t)0, /*tp_vectorcall_offset*/ +#endif (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -1958,7 +2230,7 @@ SwigPyPacked_TypeOnce(void) { }; swigpypacked_type = tmp; type_init = 1; - if (PyType_Ready(&swigpypacked_type) < 0) + if (PyType_Ready(&swigpypacked_type) != 0) return NULL; } return &swigpypacked_type; @@ -2148,12 +2420,19 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; + if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) { + res = SWIG_ERROR_RELEASE_NOT_OWNED; + } else { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + if (flags & SWIG_POINTER_CLEAR) { + sobj->ptr = 0; + } + res = SWIG_OK; } - res = SWIG_OK; } else { if (implicit_conv) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; @@ -2266,12 +2545,17 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + } else{ + Py_DECREF(inst); + inst = 0; + } } #else if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { @@ -2293,7 +2577,7 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) Py_DECREF(inst); inst = 0; } else { - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + PyType_Modified(Py_TYPE(inst)); } } } @@ -2322,7 +2606,11 @@ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) dict = PyDict_New(); *dictptr = dict; } - return PyDict_SetItem(dict, SWIG_This(), swig_this); + if (dict) { + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } else{ + return -1; + } } #endif return PyObject_SetAttr(inst, SWIG_This(), swig_this); @@ -2337,7 +2625,7 @@ SWIG_Python_InitShadowInstance(PyObject *args) { } else { SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); + Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1])); } else { if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) return NULL; @@ -2376,7 +2664,9 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); #ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; + if (newobj) { + newobj->dict = 0; + } #endif } if (newobj) { @@ -2415,39 +2705,61 @@ SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { void *SWIG_ReturnGlobalTypeList(void *); #endif +static PyObject *Swig_TypeCache_global = NULL; + +/* The python cached type query */ +SWIGRUNTIME PyObject * +SWIG_Python_TypeCache(void) { + if (Swig_TypeCache_global == NULL) { + Swig_TypeCache_global = PyDict_New(); + } + return Swig_TypeCache_global; +} + SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { +#ifdef SWIG_LINK_RUNTIME static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); + } #else - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif + void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; } +#endif return (swig_module_info *) type_pointer; } + +static int interpreter_counter = 0; // how many (sub-)interpreters are using swig_module's types + SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj) { swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); swig_type_info **types = swig_module->types; size_t i; + if (--interpreter_counter != 0) // another sub-interpreter may still be using the swig_module's types + return; for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + ty->clientdata = 0; if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); Swig_This_global = NULL; + Py_DECREF(SWIG_globals()); + Swig_Globals_global = NULL; + Py_DECREF(SWIG_Python_TypeCache()); + Swig_TypeCache_global = NULL; + Swig_Capsule_global = NULL; } SWIGRUNTIME void @@ -2461,19 +2773,17 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { #endif PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { - PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) { + ++interpreter_counter; + Swig_Capsule_global = pointer; + } else { + Py_DECREF(pointer); + } } else { Py_XDECREF(pointer); } } -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { @@ -2488,8 +2798,10 @@ SWIG_Python_TypeQuery(const char *type) descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { obj = PyCapsule_New((void*) descriptor, NULL, NULL); - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); + if (obj) { + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } } } Py_DECREF(key); @@ -2522,7 +2834,6 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) } else { PyErr_Format(type, "%s %s", errmesg, mesg); } - SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2574,7 +2885,6 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); - SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2596,12 +2906,6 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(arg void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); -#if SWIG_POINTER_EXCEPTION - if (flags) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } -#endif } return result; } @@ -2632,7 +2936,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { } if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) + if (PyType_Ready(tp) != 0) goto done; } @@ -2647,7 +2951,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { } else { encoded_name = PyUnicode_AsUTF8String(name); if (!encoded_name) - return -1; + goto done; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2670,23 +2974,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Method creation and docstring support functions */ +#define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0) -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); - -#ifdef __cplusplus -} -#endif #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) @@ -2733,8 +3022,52 @@ static swig_module_info swig_module = {swig_types, 15, 0, 0, 0, 0}; #endif #define SWIG_name "_exploresdk" -#define SWIGVERSION 0x040002 -#define SWIG_VERSION SWIGVERSION +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } + static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); } +}; + +/* + * SwigValueInit() is a generic initialisation solution as the following approach: + * + * T c_result = T(); + * + * doesn't compile for all types for example: + * + * unsigned int c_result = unsigned int(); + */ +template T SwigValueInit() { + return T(); +} + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) @@ -2817,9 +3150,9 @@ namespace swig { #include #if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj)) +# define SWIGPY_SLICEOBJECT PyObject #else -# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj)) +# define SWIGPY_SLICEOBJECT PySliceObject #endif @@ -4827,46 +5160,46 @@ SWIGINTERN void std_vector_Sl_device_Sg____delslice__(std::vector< device > *sel SWIGINTERN void std_vector_Sl_device_Sg____delitem____SWIG_0(std::vector< device > *self,std::vector< device >::difference_type i){ swig::erase(self, swig::getpos(self, i)); } -SWIGINTERN std::vector< device,std::allocator< device > > *std_vector_Sl_device_Sg____getitem____SWIG_0(std::vector< device > *self,PySliceObject *slice){ +SWIGINTERN std::vector< device,std::allocator< device > > *std_vector_Sl_device_Sg____getitem____SWIG_0(std::vector< device > *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(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); std::vector< device,std::allocator< device > >::difference_type id = i; std::vector< device,std::allocator< device > >::difference_type jd = j; return swig::getslice(self, id, jd, step); } -SWIGINTERN void std_vector_Sl_device_Sg____setitem____SWIG_0(std::vector< device > *self,PySliceObject *slice,std::vector< device,std::allocator< device > > const &v){ +SWIGINTERN void std_vector_Sl_device_Sg____setitem____SWIG_0(std::vector< device > *self,SWIGPY_SLICEOBJECT *slice,std::vector< device,std::allocator< device > > const &v){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } - PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); std::vector< device,std::allocator< device > >::difference_type id = i; std::vector< device,std::allocator< device > >::difference_type jd = j; swig::setslice(self, id, jd, step, v); } -SWIGINTERN void std_vector_Sl_device_Sg____setitem____SWIG_1(std::vector< device > *self,PySliceObject *slice){ +SWIGINTERN void std_vector_Sl_device_Sg____setitem____SWIG_1(std::vector< device > *self,SWIGPY_SLICEOBJECT *slice){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } - PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); std::vector< device,std::allocator< device > >::difference_type id = i; std::vector< device,std::allocator< device > >::difference_type jd = j; swig::delslice(self, id, jd, step); } -SWIGINTERN void std_vector_Sl_device_Sg____delitem____SWIG_1(std::vector< device > *self,PySliceObject *slice){ +SWIGINTERN void std_vector_Sl_device_Sg____delitem____SWIG_1(std::vector< device > *self,SWIGPY_SLICEOBJECT *slice){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } - PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); + PySlice_GetIndices(slice, (Py_ssize_t)self->size(), &i, &j, &step); std::vector< device,std::allocator< device > >::difference_type id = i; std::vector< device,std::allocator< device > >::difference_type jd = j; swig::delslice(self, id, jd, step); @@ -4950,7 +5283,7 @@ SWIG_AsVal_bool (PyObject *obj, bool *val) #ifdef __cplusplus extern "C" { #endif -SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -4976,7 +5309,7 @@ SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5011,7 +5344,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; @@ -5052,7 +5385,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5094,7 +5427,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator_incr", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5103,7 +5436,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5127,7 +5460,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; @@ -5168,7 +5501,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5210,7 +5543,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator_decr", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5219,7 +5552,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5243,7 +5576,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5284,7 +5617,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5325,7 +5658,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5352,7 +5685,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5387,7 +5720,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5422,7 +5755,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; @@ -5457,7 +5790,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5499,7 +5832,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5538,7 +5871,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5577,7 +5910,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5619,7 +5952,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5661,7 +5994,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5705,7 +6038,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; @@ -5748,7 +6081,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA } -SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; @@ -5795,7 +6128,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args if (!(argc = SWIG_Python_UnpackTuple(args, "SwigPyIterator___sub__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5808,7 +6141,7 @@ SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); @@ -5836,7 +6169,7 @@ SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -5866,6 +6199,9 @@ SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(s catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -5880,7 +6216,7 @@ SWIGINTERN PyObject *_wrap_delete_BTSerialPortBinding(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::string arg1 ; int arg2 ; @@ -5908,7 +6244,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (BTSerialPortBinding *)BTSerialPortBinding::Create(arg1,arg2); + result = (BTSerialPortBinding *)BTSerialPortBinding::Create(SWIG_STD_MOVE(arg1),arg2); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(const ExploreException& e) { @@ -5920,6 +6256,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -5934,7 +6273,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Create(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -5965,6 +6304,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM( catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -5979,7 +6321,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Connect(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -6009,6 +6351,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(se catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6023,7 +6368,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Close(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; char *arg2 = (char *) 0 ; @@ -6066,6 +6411,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6083,7 +6431,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Read(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; char *arg2 = (char *) 0 ; @@ -6119,6 +6467,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(se catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6133,7 +6484,7 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_Write(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BTSerialPortBinding *arg1 = (BTSerialPortBinding *) 0 ; void *argp1 = 0 ; @@ -6164,6 +6515,9 @@ SWIGINTERN PyObject *_wrap_BTSerialPortBinding_IsDataAvailable(PyObject *SWIGUNU catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6185,7 +6539,7 @@ SWIGINTERN PyObject *BTSerialPortBinding_swigregister(PyObject *SWIGUNUSEDPARM(s return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; PyObject **arg2 = (PyObject **) 0 ; @@ -6218,6 +6572,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6232,7 +6589,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_iterator(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6263,6 +6620,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6277,7 +6637,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___nonzero__(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6308,6 +6668,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6322,7 +6685,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___bool__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -6353,6 +6716,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6367,7 +6733,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___len__(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6402,7 +6768,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_Sg____getslice__(arg1,arg2,arg3); + result = (std::vector< device,std::allocator< device > > *)std_vector_Sl_device_Sg____getslice__(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -6419,6 +6785,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6433,7 +6802,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getslice__(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6466,7 +6835,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setslice____SWIG_0(arg1,arg2,arg3); + std_vector_Sl_device_Sg____setslice____SWIG_0(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -6483,6 +6852,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6497,7 +6869,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_0(PyObject *SWIGUNUSE } -SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6543,7 +6915,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSE try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setslice____SWIG_1(arg1,arg2,arg3,(std::vector< device,std::allocator< device > > const &)*arg4); + std_vector_Sl_device_Sg____setslice____SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(std::vector< device,std::allocator< device > > const &)*arg4); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -6560,6 +6932,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice____SWIG_1(PyObject *SWIGUNUSE catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6585,7 +6960,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___setslice__", 0, 4, argv))) SWIG_fail; --argc; if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -6605,7 +6980,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a } } if (argc == 4) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -6638,7 +7013,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setslice__(PyObject *self, PyObject *a } -SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6672,7 +7047,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____delslice__(arg1,arg2,arg3); + std_vector_Sl_device_Sg____delslice__(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -6689,6 +7064,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6703,7 +7081,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delslice__(PyObject *SWIGUNUSEDPARM(se } -SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -6728,7 +7106,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____delitem____SWIG_0(arg1,arg2); + std_vector_Sl_device_Sg____delitem____SWIG_0(arg1,SWIG_STD_MOVE(arg2)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -6745,6 +7123,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6759,10 +7140,10 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_0(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; - PySliceObject *arg2 = (PySliceObject *) 0 ; + SWIGPY_SLICEOBJECT *arg2 = (SWIGPY_SLICEOBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::vector< device,std::allocator< device > > *result = 0 ; @@ -6775,9 +7156,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED arg1 = reinterpret_cast< std::vector< device > * >(argp1); { if (!PySlice_Check(swig_obj[1])) { - SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___getitem__" "', argument " "2"" of type '" "PySliceObject *""'"); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___getitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); } - arg2 = (PySliceObject *) swig_obj[1]; + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; } { try { @@ -6801,6 +7182,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6815,10 +7199,10 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_0(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; - PySliceObject *arg2 = (PySliceObject *) 0 ; + SWIGPY_SLICEOBJECT *arg2 = (SWIGPY_SLICEOBJECT *) 0 ; std::vector< device,std::allocator< device > > *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -6832,9 +7216,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED arg1 = reinterpret_cast< std::vector< device > * >(argp1); { if (!PySlice_Check(swig_obj[1])) { - SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___setitem__" "', argument " "2"" of type '" "PySliceObject *""'"); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___setitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); } - arg2 = (PySliceObject *) swig_obj[1]; + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; } { std::vector< device,std::allocator< device > > *ptr = (std::vector< device,std::allocator< device > > *)0; @@ -6869,6 +7253,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6885,10 +7272,10 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_0(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; - PySliceObject *arg2 = (PySliceObject *) 0 ; + SWIGPY_SLICEOBJECT *arg2 = (SWIGPY_SLICEOBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -6900,9 +7287,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSED arg1 = reinterpret_cast< std::vector< device > * >(argp1); { if (!PySlice_Check(swig_obj[1])) { - SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___setitem__" "', argument " "2"" of type '" "PySliceObject *""'"); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___setitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); } - arg2 = (PySliceObject *) swig_obj[1]; + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; } { try { @@ -6926,6 +7313,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -6940,10 +7330,10 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_1(PyObject *SWIGUNUSED } -SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; - PySliceObject *arg2 = (PySliceObject *) 0 ; + SWIGPY_SLICEOBJECT *arg2 = (SWIGPY_SLICEOBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -6955,9 +7345,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *SWIGUNUSED arg1 = reinterpret_cast< std::vector< device > * >(argp1); { if (!PySlice_Check(swig_obj[1])) { - SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___delitem__" "', argument " "2"" of type '" "PySliceObject *""'"); + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "vectordevice___delitem__" "', argument " "2"" of type '" "SWIGPY_SLICEOBJECT *""'"); } - arg2 = (PySliceObject *) swig_obj[1]; + arg2 = (SWIGPY_SLICEOBJECT *) swig_obj[1]; } { try { @@ -6981,6 +7371,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem____SWIG_1(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7004,7 +7397,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___delitem__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7017,7 +7410,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar } } if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7035,12 +7428,12 @@ SWIGINTERN PyObject *_wrap_vectordevice___delitem__(PyObject *self, PyObject *ar SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'vectordevice___delitem__'.\n" " Possible C/C++ prototypes are:\n" " std::vector< device >::__delitem__(std::vector< device >::difference_type)\n" - " std::vector< device >::__delitem__(PySliceObject *)\n"); + " std::vector< device >::__delitem__(SWIGPY_SLICEOBJECT *)\n"); return 0; } -SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -7066,7 +7459,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSED try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (std::vector< device >::value_type *) &std_vector_Sl_device_Sg____getitem____SWIG_1((std::vector< device > const *)arg1,arg2); + result = (std::vector< device >::value_type *) &std_vector_Sl_device_Sg____getitem____SWIG_1((std::vector< device > const *)arg1,SWIG_STD_MOVE(arg2)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -7081,6 +7474,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem____SWIG_1(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7105,7 +7501,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___getitem__", 0, 2, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7118,7 +7514,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar } } if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7135,13 +7531,13 @@ SWIGINTERN PyObject *_wrap_vectordevice___getitem__(PyObject *self, PyObject *ar fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'vectordevice___getitem__'.\n" " Possible C/C++ prototypes are:\n" - " std::vector< device >::__getitem__(PySliceObject *)\n" + " std::vector< device >::__getitem__(SWIGPY_SLICEOBJECT *)\n" " std::vector< device >::__getitem__(std::vector< device >::difference_type) const\n"); return 0; } -SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::difference_type arg2 ; @@ -7177,7 +7573,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSED try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg____setitem____SWIG_2(arg1,arg2,(device const &)*arg3); + std_vector_Sl_device_Sg____setitem____SWIG_2(arg1,SWIG_STD_MOVE(arg2),(device const &)*arg3); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(std::out_of_range &_e) { @@ -7192,6 +7588,9 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem____SWIG_2(PyObject *SWIGUNUSED catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7215,7 +7614,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice___setitem__", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7228,7 +7627,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7245,7 +7644,7 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -7266,14 +7665,14 @@ SWIGINTERN PyObject *_wrap_vectordevice___setitem__(PyObject *self, PyObject *ar fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'vectordevice___setitem__'.\n" " Possible C/C++ prototypes are:\n" - " std::vector< device >::__setitem__(PySliceObject *,std::vector< device,std::allocator< device > > const &)\n" - " std::vector< device >::__setitem__(PySliceObject *)\n" + " std::vector< device >::__setitem__(SWIGPY_SLICEOBJECT *,std::vector< device,std::allocator< device > > const &)\n" + " std::vector< device >::__setitem__(SWIGPY_SLICEOBJECT *)\n" " std::vector< device >::__setitem__(std::vector< device >::difference_type,std::vector< device >::value_type const &)\n"); return 0; } -SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7308,6 +7707,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyOb catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7315,14 +7717,14 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop(PyObject *SWIGUNUSEDPARM(self), PyOb SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj((new std::vector< device >::value_type(static_cast< const std::vector< device >::value_type& >(result))), SWIGTYPE_p_device, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::vector< device >::value_type(result)), SWIGTYPE_p_device, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::value_type *arg2 = 0 ; @@ -7362,6 +7764,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), P catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7376,7 +7781,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_append(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; std::vector< device > *result = 0 ; @@ -7397,6 +7802,9 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7411,7 +7819,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_0(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = 0 ; int res1 = SWIG_OLDOBJ ; @@ -7445,6 +7853,9 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7461,7 +7872,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_1(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7492,6 +7903,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), Py catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7506,7 +7920,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_empty(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7537,6 +7951,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7551,7 +7968,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_size(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device > *arg2 = 0 ; @@ -7591,6 +8008,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7605,7 +8025,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_swap(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7636,6 +8056,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), Py catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7651,7 +8074,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_begin(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7682,6 +8105,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyOb catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7697,7 +8123,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_end(PyObject *SWIGUNUSEDPARM(self), PyOb } -SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7728,6 +8154,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), P catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7743,7 +8172,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_rbegin(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7774,6 +8203,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7789,7 +8221,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_rend(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7819,6 +8251,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *SWIGUNUSEDPARM(self), Py catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7833,7 +8268,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_clear(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7864,6 +8299,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(s catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7871,14 +8309,14 @@ SWIGINTERN PyObject *_wrap_vectordevice_get_allocator(PyObject *SWIGUNUSEDPARM(s SWIG_exception(SWIG_RuntimeError, "Unknown exception"); } } - resultobj = SWIG_NewPointerObj((new std::vector< device >::allocator_type(static_cast< const std::vector< device >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_device_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::vector< device >::allocator_type(result)), SWIGTYPE_p_std__allocatorT_device_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device >::size_type arg1 ; size_t val1 ; @@ -7907,6 +8345,9 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7921,7 +8362,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_2(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -7951,6 +8392,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -7965,7 +8409,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_pop_back(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8001,6 +8445,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM( catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8015,7 +8462,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8046,7 +8493,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__erase__SWIG_0(arg1,arg2); + result = std_vector_Sl_device_Sg__erase__SWIG_0(arg1,SWIG_STD_MOVE(arg2)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(const ExploreException& e) { @@ -8058,6 +8505,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8073,7 +8523,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s } -SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8118,7 +8568,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__erase__SWIG_1(arg1,arg2,arg3); + result = std_vector_Sl_device_Sg__erase__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3)); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(const ExploreException& e) { @@ -8130,6 +8580,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8154,7 +8607,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_erase", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8167,7 +8620,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8194,7 +8647,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_erase(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device >::size_type arg1 ; std::vector< device >::value_type *arg2 = 0 ; @@ -8234,6 +8687,9 @@ SWIGINTERN PyObject *_wrap_new_vectordevice__SWIG_3(PyObject *SWIGUNUSEDPARM(sel catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8260,7 +8716,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { return _wrap_new_vectordevice__SWIG_0(self, argc, argv); } if (argc == 1) { - int _v; + int _v = 0; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); @@ -8270,7 +8726,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } } if (argc == 1) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8278,7 +8734,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } } if (argc == 2) { - int _v; + int _v = 0; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); @@ -8303,7 +8759,7 @@ SWIGINTERN PyObject *_wrap_new_vectordevice(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::value_type *arg2 = 0 ; @@ -8343,6 +8799,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self) catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8357,7 +8816,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_push_back(PyObject *SWIGUNUSEDPARM(self) } -SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8388,6 +8847,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), Py catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8403,7 +8865,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_front(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8434,6 +8896,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8449,7 +8914,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_back(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8497,6 +8962,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), P catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8511,7 +8979,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_assign(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8558,6 +9026,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize__SWIG_1(PyObject *SWIGUNUSEDPARM( catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8581,7 +9052,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_resize", 0, 3, argv))) SWIG_fail; --argc; if (argc == 2) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8595,7 +9066,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { } } if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8622,7 +9093,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_resize(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8664,7 +9135,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = std_vector_Sl_device_Sg__insert__SWIG_0(arg1,arg2,(device const &)*arg3); + result = std_vector_Sl_device_Sg__insert__SWIG_0(arg1,SWIG_STD_MOVE(arg2),(device const &)*arg3); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(const ExploreException& e) { @@ -8676,6 +9147,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8691,7 +9165,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( } -SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::iterator arg2 ; @@ -8740,7 +9214,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( try { { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - std_vector_Sl_device_Sg__insert__SWIG_1(arg1,arg2,arg3,(device const &)*arg4); + std_vector_Sl_device_Sg__insert__SWIG_1(arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),(device const &)*arg4); SWIG_PYTHON_THREAD_END_ALLOW; } } catch(const ExploreException& e) { @@ -8752,6 +9226,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8775,7 +9252,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { if (!(argc = SWIG_Python_UnpackTuple(args, "vectordevice_insert", 0, 4, argv))) SWIG_fail; --argc; if (argc == 3) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8792,7 +9269,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { } } if (argc == 4) { - int _v; + int _v = 0; int res = swig::asptr(argv[0], (std::vector< device,std::allocator< device > >**)(0)); _v = SWIG_CheckState(res); if (_v) { @@ -8824,7 +9301,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_insert(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; std::vector< device >::size_type arg2 ; @@ -8861,6 +9338,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8875,7 +9355,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_reserve(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8906,6 +9386,9 @@ SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8920,7 +9403,7 @@ SWIGINTERN PyObject *_wrap_vectordevice_capacity(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *self, PyObject *args) { PyObject *resultobj = 0; std::vector< device > *arg1 = (std::vector< device > *) 0 ; void *argp1 = 0 ; @@ -8950,6 +9433,9 @@ SWIGINTERN PyObject *_wrap_delete_vectordevice(PyObject *SWIGUNUSEDPARM(self), P catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -8975,7 +9461,7 @@ SWIGINTERN PyObject *vectordevice_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObj return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_address_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::string *arg2 = 0 ; @@ -9015,7 +9501,7 @@ SWIGINTERN PyObject *_wrap_device_address_set(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_address_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9042,7 +9528,7 @@ SWIGINTERN PyObject *_wrap_device_address_get(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_name_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::string *arg2 = 0 ; @@ -9082,7 +9568,7 @@ SWIGINTERN PyObject *_wrap_device_name_set(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_name_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9109,7 +9595,7 @@ SWIGINTERN PyObject *_wrap_device_name_get(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::time_t arg2 ; @@ -9150,7 +9636,7 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_set(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9170,14 +9656,14 @@ SWIGINTERN PyObject *_wrap_device_lastSeen_get(PyObject *SWIGUNUSEDPARM(self), P result = ((arg1)->lastSeen); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj((new std::time_t(static_cast< const std::time_t& >(result))), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::time_t(result)), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; std::time_t arg2 ; @@ -9218,7 +9704,7 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_set(PyObject *SWIGUNUSEDPARM(self), P } -SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9238,14 +9724,14 @@ SWIGINTERN PyObject *_wrap_device_lastUsed_get(PyObject *SWIGUNUSEDPARM(self), P result = ((arg1)->lastUsed); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_NewPointerObj((new std::time_t(static_cast< const std::time_t& >(result))), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::time_t(result)), SWIGTYPE_p_std__time_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -9278,7 +9764,7 @@ SWIGINTERN PyObject *_wrap_device_connected_set(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9305,7 +9791,7 @@ SWIGINTERN PyObject *_wrap_device_connected_get(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -9338,7 +9824,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_set(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9365,7 +9851,7 @@ SWIGINTERN PyObject *_wrap_device_remembered_get(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; bool arg2 ; @@ -9398,7 +9884,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_set(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9425,7 +9911,7 @@ SWIGINTERN PyObject *_wrap_device_authenticated_get(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_new_device(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_device(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *result = 0 ; @@ -9446,6 +9932,9 @@ SWIGINTERN PyObject *_wrap_new_device(PyObject *SWIGUNUSEDPARM(self), PyObject * catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9460,7 +9949,7 @@ SWIGINTERN PyObject *_wrap_new_device(PyObject *SWIGUNUSEDPARM(self), PyObject * } -SWIGINTERN PyObject *_wrap_delete_device(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_device(PyObject *self, PyObject *args) { PyObject *resultobj = 0; device *arg1 = (device *) 0 ; void *argp1 = 0 ; @@ -9490,6 +9979,9 @@ SWIGINTERN PyObject *_wrap_delete_device(PyObject *SWIGUNUSEDPARM(self), PyObjec catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9515,7 +10007,7 @@ SWIGINTERN PyObject *device_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *a return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; void *argp1 = 0 ; @@ -9545,6 +10037,9 @@ SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9559,7 +10054,7 @@ SWIGINTERN PyObject *_wrap_delete_ExploreSDK(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *result = 0 ; @@ -9580,6 +10075,9 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *SWIGUNUSEDPARM(self), PyO catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9594,7 +10092,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_Create(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; int arg2 ; @@ -9631,6 +10129,9 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIG catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9645,7 +10146,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_0(PyObject *SWIG } -SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; void *argp1 = 0 ; @@ -9674,6 +10175,9 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch__SWIG_1(PyObject *SWIG catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9697,7 +10201,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje if (!(argc = SWIG_Python_UnpackTuple(args, "ExploreSDK_PerformDeviceSearch", 0, 2, argv))) SWIG_fail; --argc; if (argc == 1) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ExploreSDK, 0); _v = SWIG_CheckState(res); @@ -9706,7 +10210,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje } } if (argc == 2) { - int _v; + int _v = 0; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ExploreSDK, 0); _v = SWIG_CheckState(res); @@ -9730,7 +10234,7 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_PerformDeviceSearch(PyObject *self, PyObje } -SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ExploreSDK *arg1 = (ExploreSDK *) 0 ; std::string arg2 ; @@ -9770,6 +10274,9 @@ SWIGINTERN PyObject *_wrap_ExploreSDK_SdpSearch(PyObject *SWIGUNUSEDPARM(self), catch(const ExploreIOException& e) { SWIG_exception(SWIG_IOError, e.what()); } + catch(const ExploreBtSocketException& e) { + SWIG_exception(SWIG_TypeError, e.what()); + } catch(const std::exception& e) { SWIG_exception(SWIG_UnknownError, "Standard exception"); } @@ -9792,7 +10299,6 @@ SWIGINTERN PyObject *ExploreSDK_swigregister(PyObject *SWIGUNUSEDPARM(self), PyO } static PyMethodDef SwigMethods[] = { - { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, { "delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_O, NULL}, { "SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_O, NULL}, { "SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL}, @@ -9880,10 +10386,6 @@ static PyMethodDef SwigMethods[] = { { NULL, NULL, 0, NULL } }; -static PyMethodDef SwigMethods_proxydocs[] = { - { NULL, NULL, 0, NULL } -}; - /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ @@ -10016,9 +10518,12 @@ extern "C" { #define SWIGRUNTIME_DEBUG #endif +#ifndef SWIG_INIT_CLIENT_DATA_TYPE +#define SWIG_INIT_CLIENT_DATA_TYPE void * +#endif SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { +SWIG_InitializeModule(SWIG_INIT_CLIENT_DATA_TYPE clientdata) { size_t i; swig_module_info *module_head, *iter; int init; @@ -10201,220 +10706,6 @@ SWIG_PropagateClientData(void) { extern "C" { #endif - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - "swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#if PY_VERSION_HEX >= 0x03080000 - 0, /* tp_vectorcall */ -#endif -#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) - 0, /* tp_print */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ - 0, /* tp_prev */ - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; - if (PyType_Ready(&varlink_type) < 0) - return NULL; - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - memcpy(gv->name, name, size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *globals = 0; - if (!globals) { - globals = SWIG_newvarlink(); - } - return globals; - } - /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ @@ -10443,15 +10734,12 @@ extern "C" { } } - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ + /* ----------------------------------------------------------------------------- + * Patch %callback methods' docstrings to hold the callback ptrs + * -----------------------------------------------------------------------------*/ SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { + SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; @@ -10459,7 +10747,7 @@ extern "C" { c = strstr(c, "swig_ptr: "); if (c) { int j; - swig_const_info *ci = 0; + const swig_const_info *ci = 0; const char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, @@ -10491,68 +10779,13 @@ extern "C" { } } - /* ----------------------------------------------------------------------------- - * Method creation and docstring support functions - * ----------------------------------------------------------------------------- */ - - /* ----------------------------------------------------------------------------- - * Function to find the method definition with the correct docstring for the - * proxy module as opposed to the low-level API - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { - /* Find the function in the modified method table */ - size_t offset = 0; - int found = 0; - while (SwigMethods_proxydocs[offset].ml_meth != NULL) { - if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { - found = 1; - break; - } - offset++; - } - /* Use the copy with the modified docstring if available */ - return found ? &SwigMethods_proxydocs[offset] : NULL; - } - - /* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return PyMethod_New(func, NULL, NULL); -#endif - } - - /* ----------------------------------------------------------------------------- - * Wrapper of PyStaticMethod_New() - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ - - SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { - if (PyCFunction_Check(func)) { - PyCFunctionObject *funcobj = (PyCFunctionObject *)func; - PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); - if (ml) - func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); - } - return PyStaticMethod_New(func); - } - #ifdef __cplusplus } #endif + + + /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ diff --git a/setup.py b/setup.py index 66315158..d28f6e4a 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,19 @@ def read(*names, **kwargs): return fh.read() -my_req = ['numpy', 'scipy', 'pyedflib', 'click==7.1.2', 'appdirs==1.4.3', 'sentry_sdk==1.19.1', 'mne', 'eeglabio', 'pandas'] # noqa: E501 +my_req = ['numpy', + 'scipy', + 'pyedflib', + 'click==7.1.2', + 'appdirs==1.4.3', + 'sentry_sdk==1.19.1', + 'mne', + 'eeglabio', + 'pandas', + 'pyserial', + 'pyyaml', + 'bleak'] # noqa: E501 + test_requirements = ["pytest==6.2.5", "pytest-mock==3.10.0", "pytest-html==3.2.0", @@ -45,8 +57,6 @@ def read(*names, **kwargs): if not os.environ.get('READTHEDOCS'): my_req.append('pylsl') - my_req.append('Jinja2==3.0.0') - my_req.append('bokeh==2.2.3') libPath = "lib" if current_platform == 'win32' or current_platform == 'win64': windows_lib_path = os.path.join(libPath, 'windows') @@ -71,18 +81,12 @@ def read(*names, **kwargs): swig_opts=['-c++'] )) else: - if sys.version_info >= (3, 6): - my_req.append('pyobjc-core>=6') - my_req.append('pyobjc-framework-Cocoa>=6') - else: - my_req.append('pyobjc-core>=3.1,<6') - my_req.append('pyobjc-framework-Cocoa>=3.1,<6') + # Handle Mac OSX setup os.system('cp lib/mac/_exploresdk.so src/explorepy') - os.system('cp lib/mac/btScan src/explorepy') os.system('cp lib/mac/exploresdk.py src/explorepy') setup( name='explorepy', - version='1.8.2', + version='2.0.0', license='MIT license', description='Python API for Mentalab biosignal aquisition devices', long_description_content_type="text/markdown", @@ -108,11 +112,9 @@ def read(*names, **kwargs): 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Education', 'Topic :: Scientific/Engineering :: Medical Science Apps.', 'Topic :: Scientific/Engineering :: Visualization' diff --git a/src/explorepy/__init__.py b/src/explorepy/__init__.py index bcb25135..96feec82 100644 --- a/src/explorepy/__init__.py +++ b/src/explorepy/__init__.py @@ -14,19 +14,18 @@ from . import ( # noqa ignore E402 command, - exploresdk, tools ) -from .dashboard.dashboard import Dashboard # noqa from .explore import Explore # noqa -__all__ = ["Explore", "Dashboard", "command", "exploresdk", "tools", "log_config"] -__version__ = '1.8.2' +__all__ = ["Explore", "command", "exploresdk", "tools", "log_config"] +__version__ = '2.0.0' this = sys.modules[__name__] -this._bt_interface = 'sdk' -list_sdk = ['sdk', 'mock'] +# TODO appropriate library +bt_interface_list = ['sdk', 'ble', 'mock', 'pyserial'] +this._bt_interface = 'ble' if not sys.version_info >= (3, 6): raise EnvironmentError("Explorepy requires python versions 3.6 or newer!") @@ -42,8 +41,7 @@ def set_bt_interface(bt_interface): bt_interface (str): Bluetooth interface type. Options:'sdk' """ - - if bt_interface not in list_sdk: + if bt_interface not in bt_interface_list: raise ValueError(("Invalid Bluetooth interface: " + bt_interface)) this._bt_interface = bt_interface diff --git a/src/explorepy/_exceptions.py b/src/explorepy/_exceptions.py index adf7d88a..cab5aba1 100644 --- a/src/explorepy/_exceptions.py +++ b/src/explorepy/_exceptions.py @@ -34,6 +34,13 @@ class FletcherError(Exception): pass +class ReconnectionFlowError(Exception): + """ + Reconnection flow error, only thrown when device is reconnecting + """ + pass + + if sys.platform == "darwin": class BluetoothError(Exception): """ diff --git a/src/explorepy/btcpp.py b/src/explorepy/btcpp.py index 9a0b25c7..7a0a6693 100644 --- a/src/explorepy/btcpp.py +++ b/src/explorepy/btcpp.py @@ -1,7 +1,18 @@ # -*- coding: utf-8 -*- """A module for bluetooth connection""" +import abc +import asyncio +import atexit import logging +import queue +import threading import time +from queue import Queue + +from bleak import ( + BleakClient, + BleakScanner +) from explorepy import ( exploresdk, @@ -12,12 +23,71 @@ InputError ) - logger = logging.getLogger(__name__) -class SDKBtClient: +class BTClient(abc.ABC): + @abc.abstractmethod + def __init__(self, device_name=None, mac_address=None): + if (mac_address is None) and (device_name is None): + raise InputError("Either name or address options must be provided!") + self.is_connected = False + self.mac_address = mac_address + self.device_name = device_name + self.bt_serial_port_manager = None + self.device_manager = None + + @abc.abstractmethod + def connect(self): + """Connect to the device and return the socket + + Returns: + socket (bluetooth.socket) + """ + + @abc.abstractmethod + def reconnect(self): + """Reconnect to the last used bluetooth socket. + + This function reconnects to the last bluetooth socket. If after 1 minute the connection doesn't succeed, + program will end. + """ + + @abc.abstractmethod + def disconnect(self): + """Disconnect from the device""" + + @abc.abstractmethod + def _find_mac_address(self): + pass + + @abc.abstractmethod + def read(self, n_bytes): + """Read n_bytes from the socket + + Args: + n_bytes (int): number of bytes to be read + + Returns: + list of bytes + """ + + @abc.abstractmethod + def send(self, data): + """Send data to the device + + Args: + data (bytearray): Data to be sent + """ + + @staticmethod + def _check_mac_address(device_name, mac_address): + return (device_name[-4:-2] == mac_address[-5:-3]) and (device_name[-2:] == mac_address[-2:]) + + +class SDKBtClient(BTClient): """ Responsible for Connecting and reconnecting explore devices via bluetooth""" + def __init__(self, device_name=None, mac_address=None): """Initialize Bluetooth connection @@ -51,7 +121,7 @@ def connect(self): for _ in range(5): try: - self.bt_serial_port_manager = exploresdk.BTSerialPortBinding_Create(self.mac_address, 5) + self.bt_serial_port_manager = exploresdk.BTSerialPortBinding.Create(self.mac_address, 5) return_code = self.bt_serial_port_manager.Connect() logger.debug("Return code for connection attempt is : {}".format(return_code)) @@ -84,7 +154,8 @@ def connect(self): self.is_connected = False raise DeviceNotFoundError( - "Could not find the device! Please make sure the device is on and in advertising mode." + "Could not find the device! Please make sure bluetooth is turned on in your computer and the Explore " + "device is in advertising mode. " ) def reconnect(self): @@ -95,7 +166,7 @@ def reconnect(self): """ self.is_connected = False for _ in range(5): - self.bt_serial_port_manager = exploresdk.BTSerialPortBinding_Create(self.mac_address, 5) + self.bt_serial_port_manager = exploresdk.BTSerialPortBinding.Create(self.mac_address, 5) connection_error_code = self.bt_serial_port_manager.Connect() logger.debug("Got an exception while connecting to the device: {}".format(connection_error_code)) if connection_error_code == 0: @@ -170,6 +241,226 @@ def send(self, data): """ self.bt_serial_port_manager.Write(data) - @staticmethod - def _check_mac_address(device_name, mac_address): - return (device_name[-4:-2] == mac_address[-5:-3]) and (device_name[-2:] == mac_address[-2:]) + +class BLEClient(BTClient): + """ Responsible for Connecting and reconnecting explore devices via bluetooth""" + + def __init__(self, device_name=None, mac_address=None): + """Initialize Bluetooth connection + + Args: + device_name(str): Name of the device (either device_name or device address should be given) + mac_address(str): Devices MAC address + """ + super().__init__(device_name=device_name, mac_address=mac_address) + + self.client = None + self.ble_device = None + self.eeg_service_uuid = "FFFE0001-B5A3-F393-E0A9-E50E24DCCA9E" + self.eeg_tx_char_uuid = "FFFE0003-B5A3-F393-E0A9-E50E24DCCA9E" + self.eeg_rx_char_uuid = "FFFE0002-B5A3-F393-E0A9-E50E24DCCA9E" + self.rx_char = None + self.buffer = Queue() + self.try_disconnect = asyncio.Event() + self.notification_thread = None + self.copy_buffer = bytearray() + self.read_event = asyncio.Event() + self.data = None + self.connection_attempt_counter = 0 + self.result_queue = Queue() + + async def stream(self): + while True: + if not self.is_connected: + break + if self.try_disconnect.is_set(): + logger.info("scanning for device") + device = await BleakScanner.find_device_by_name(self.device_name, timeout=5) + + if device is None: + logger.debug("no device found, wait then scan again") + await asyncio.sleep(2) + if self.connection_attempt_counter <= 5: + self.connection_attempt_counter += 1 + continue + else: + self.disconnect() + self.connection_attempt_counter = 0 + + def disconnection_callback(_: BleakClient): + logger.debug("Device sent disconnection callback") + # cancelling all tasks effectively ends the program + if self.is_connected: + self.try_disconnect.set() + self.read_event.set() + + self.client = BleakClient(self.ble_device, disconnected_callback=disconnection_callback) + loop = asyncio.get_running_loop() + connect_task = loop.create_task(self.client.connect()) + await connect_task + + # async with BleakClient(self.ble_device) as client: + def handle_packet(sender, bt_byte_array): + # write packet to buffer + self.buffer.put(bt_byte_array) + + loop = asyncio.get_running_loop() + self.notify_task = loop.create_task(self.client.start_notify(self.eeg_tx_char_uuid, handle_packet)) + try: + await self.notify_task + except asyncio.CancelledError: + print("Notify task is cancelled now") + + self.rx_char = self.client.services.get_service(self.eeg_service_uuid).get_characteristic( + self.eeg_rx_char_uuid) + while True: + loop = asyncio.get_running_loop() + try: + loop.run_in_executor(None, await self.read_event.wait()) + except Exception: + print('Got exception while waiting for read event in BLE thread') + if self.data is None: + if self.try_disconnect.is_set() and self.is_connected: + logger.debug('Closing write thread, will attempt reconnection') + self.read_event.clear() + break + logger.debug('Client disconnection requested') + self.is_connected = False + await self.client.disconnect() + break + await self.client.write_gatt_char(self.rx_char, self.data, response=False) + self.data = None + self.read_event.clear() + + def connect(self): + """Connect to the device and return the socket + + Returns: + socket (bluetooth.socket) + """ + self.is_connected = True + self.notification_thread = threading.Thread(target=self.start_read_loop, daemon=True) + self.notification_thread.start() + print('waiting for BLE device to show up..') + self.result_queue.get() + + if self.ble_device is None: + logger.info('No device found!!') + raise DeviceNotFoundError('Could not find device') + else: + logger.info('Device is connected') + self.is_connected = True + + atexit.register(self.disconnect) + + def start_read_loop(self): + try: + asyncio.run(self.ble_manager()) + except RuntimeError as error: + logger.info('Shutting down BLE stream loop with error {}'.format(error)) + except asyncio.exceptions.CancelledError as error: + logger.debug('asyncio.exceptions.CancelledError from BLE stream thread {}'.format(error)) + + def stop_read_loop(self): + logger.debug('Stopping BLE stream loop') + + self.stream_task.cancel() + self.notification_thread.join() + + async def ble_manager(self): + try: + discovery_task = asyncio.create_task(self._discover_device()) + await discovery_task + logger.debug('Finished device discovery..') + self.result_queue.put(True) + self.stream_task = asyncio.create_task(self.stream()) + await self.stream_task + except DeviceNotFoundError: + self.result_queue.put(False) + logger.debug('No matching device found') + except Exception as error: + print('got an error with the message{}'.format(error)) + + async def _discover_device(self): + if self.mac_address: + self.ble_device = await BleakScanner.find_device_by_address(self.mac_address) + else: + logger.info('Commencing device discovery') + self.ble_device = await BleakScanner.find_device_by_name(self.device_name, timeout=15) + if self.ble_device: + logger.debug('found device!!!!') + if self.ble_device is None: + logger.debug('No device found!!!!!') + raise DeviceNotFoundError( + "Could not discover the device! Please make sure the device is on and in advertising mode." + ) + + def reconnect(self): + """Reconnect to the last used bluetooth socket. + + This function reconnects to the last bluetooth socket. If after 1 minute the connection doesn't succeed, + program will end. + """ + self.is_connected = False + for _ in range(5): + try: + logger.info('reconnection called from parser') + return 0 + except DeviceNotFoundError: + self.is_connected = False + logger.warning("Couldn't connect to the device. Trying to reconnect...") + time.sleep(2) + logger.error("Could not reconnect after 5 attempts. Closing the socket.") + return None + + def disconnect(self): + """Disconnect from the device""" + self.is_connected = False + self.notify_task.cancel() + self.read_event.set() + time.sleep(1) + self.stop_read_loop() + + def _find_mac_address(self): + raise NotImplementedError + + def read(self, n_bytes): + """Read n_bytes from the socket + + Args: + n_bytes (int): number of bytes to be read + + Returns: + list of bytes + """ + try: + if len(self.copy_buffer) < n_bytes: + get_item = self.buffer.get(timeout=10) + self.copy_buffer.extend(get_item) + ret = self.copy_buffer[:n_bytes] + self.copy_buffer = self.copy_buffer[n_bytes:] + if len(ret) < n_bytes: + logger.info('data size mismatch in buffer, raising connection aborted error when trying to read {}' + 'bytes'.format(n_bytes)) + raise ConnectionAbortedError('Error reading data from BLE stream, too many bytes requested') + self.try_disconnect.clear() + return ret + except queue.Empty: + if self.try_disconnect.is_set(): + logger.debug('No item in bluetooth buffer, initiating next read() call') + return self.read(n_bytes) + else: + logger.info('disconnection flag is not set, continuing') + except Exception as error: + logger.error('Unknown error reading data from BLE stream') + raise ConnectionAbortedError(str(error)) + + def send(self, data): + """Send data to the device + + Args: + data (bytearray): Data to be sent + """ + self.data = data + logger.debug('sending data to device') + self.read_event.set() diff --git a/src/explorepy/cli.py b/src/explorepy/cli.py index 55bd4fe7..b616c746 100644 --- a/src/explorepy/cli.py +++ b/src/explorepy/cli.py @@ -52,6 +52,7 @@ def wrapper(ctx, *args, **kwargs): logger.warning("Invalid device mac address! Please check the MAC address and try again.") sys.exit() return ctx.invoke(func, *args, **kwargs) + return update_wrapper(wrapper, func) @@ -124,31 +125,6 @@ def bin2edf(filename, overwrite): explore.convert_bin(bin_file=filename, do_overwrite=overwrite, file_type='edf') -@cli.command() -@click.option("--address", "-a", type=str, help="Explore device's MAC address") -@click.option("--name", "-n", type=str, help="Name of the device") -@click.option("-nf", "--notchfreq", type=click.Choice(['50', '60']), help="Frequency of notch filter.", default='50') -@click.option("-lf", "--lowfreq", type=float, help="Low cutoff frequency of bandpass/highpass filter.") -@click.option("-hf", "--highfreq", type=float, help="High cutoff frequency of bandpass/lowpass filter.") -@verify_inputs -def visualize(address, name, notchfreq, lowfreq, highfreq): - """Visualizing signal in a browser-based dashboard""" - explore = explorepy.explore.Explore() - explore.connect(mac_address=address, device_name=name) - explore.visualize(notch_freq=int(notchfreq), bp_freq=(lowfreq, highfreq)) - - -@cli.command() -@click.option("--address", "-a", type=str, help="Explore device's MAC address") -@click.option("--name", "-n", type=str, help="Name of the device") -@verify_inputs -def impedance(address, name): - """Impedance measurement in a browser-based dashboard""" - explore = explorepy.explore.Explore() - explore.connect(mac_address=address, device_name=name) - explore.measure_imp() - - @cli.command() @click.option("--address", "-a", type=str, help="Explore device's MAC address") @click.option("--name", "-n", type=str, help="Name of the device") diff --git a/src/explorepy/command.py b/src/explorepy/command.py index bb2ea67b..6096dc88 100644 --- a/src/explorepy/command.py +++ b/src/explorepy/command.py @@ -215,6 +215,14 @@ def __init__(self, sps_rate): self.param = b'\x02' elif sps_rate == 1000: self.param = b'\x03' + elif sps_rate == 2000: + self.param = b'\x04' + elif sps_rate == 4000: + self.param = b'\x05' + elif sps_rate == 8000: + self.param = b'\x06' + elif sps_rate == 16000: + self.param = b'\x07' else: raise ValueError("Invalid input") diff --git a/src/explorepy/dashboard/__init__.py b/src/explorepy/dashboard/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/explorepy/dashboard/dashboard.py b/src/explorepy/dashboard/dashboard.py deleted file mode 100644 index c736fccc..00000000 --- a/src/explorepy/dashboard/dashboard.py +++ /dev/null @@ -1,761 +0,0 @@ -# -*- coding: utf-8 -*- -"""Dashboard module""" -import logging -import os -from datetime import datetime -from functools import partial - -import numpy as np -from bokeh.core.property.validation import ( - validate, - without_property_validation -) -from bokeh.layouts import ( - Spacer, - column, - row, - widgetbox -) -from bokeh.models import ( - BoxZoomTool, - Button, - CheckboxGroup, - ColumnDataSource, - Div, - Panel, - RadioGroup, - ResetTool, - SingleIntervalTicker, - Tabs, - TextInput, - Toggle, - widgets -) -from bokeh.palettes import Category20 -from bokeh.plotting import figure -from bokeh.server.server import Server -from bokeh.themes import Theme -from bokeh.transform import dodge -from jinja2 import Template -from scipy.ndimage import gaussian_filter1d -from tornado import gen - -from explorepy.stream_processor import TOPICS -from explorepy.tools import ( - HeartRateEstimator, - find_free_port -) - - -logger = logging.getLogger(__name__) -ORN_SRATE = 20 # Hz -EXG_VIS_SRATE = 125 -WIN_LENGTH = 10 # Seconds -MODE_LIST = ['EEG', 'ECG'] -CHAN_LIST = ['Ch1', 'Ch2', 'Ch3', 'Ch4', 'Ch5', 'Ch6', 'Ch7', 'Ch8'] -DEFAULT_SCALE = 10 ** 3 # Volt -BATTERY_N_MOVING_AVERAGE = 60 -V_TH = [10, 5 * 10 ** 3] # Noise threshold for ECG (microVolt) -ORN_LIST = ['accX', 'accY', 'accZ', 'gyroX', 'gyroY', 'gyroZ', 'magX', 'magY', 'magZ'] - -SCALE_MENU = {"1 uV": 0, "5 uV": -0.66667, "10 uV": -1, "100 uV": -2, "200 uV": -2.33333, "500 uV": -2.66667, - "1 mV": -3, "5 mV": -3.66667, "10 mV": -4, "100 mV": -5} -TIME_RANGE_MENU = {"10 s": 10., "5 s": 5., "20 s": 20.} - -LINE_COLORS = ['green', '#42C4F7', 'red'] -FFT_COLORS = Category20[8] - - -class Dashboard: - """Explorepy dashboard class""" - - def __init__(self, explore=None, mode='signal'): - """ - Args: - stream_processor (explorepy.stream_processor.StreamProcessor): Stream processor object - """ - logger.debug(f"Initializing dashboard in {mode} mode") - self.explore = explore - self.stream_processor = self.explore.stream_processor - self.n_chan = self.stream_processor.device_info['adc_mask'].count(1) - self.y_unit = DEFAULT_SCALE - self.offsets = np.arange(1, self.n_chan + 1)[:, np.newaxis].astype(float) - self.chan_key_list = [CHAN_LIST[i] - for i, mask in enumerate(reversed(self.stream_processor.device_info['adc_mask'])) if - mask == 1] - self.exg_mode = 'EEG' - self.rr_estimator = None - self.win_length = WIN_LENGTH - self.mode = mode - self.exg_fs = self.stream_processor.device_info['sampling_rate'] - self._vis_time_offset = None - self._baseline_corrector = {"MA_length": 1.5 * EXG_VIS_SRATE, - "baseline": 0} - - # Init ExG data source - exg_temp = np.zeros((self.n_chan, 2)) - exg_temp[:, 0] = self.offsets[:, 0] - exg_temp[:, 1] = np.nan - init_data = dict(zip(self.chan_key_list, exg_temp)) - self._exg_source_orig = ColumnDataSource(data=init_data) - init_data['t'] = np.array([0., 0.]) - self._exg_source_ds = ColumnDataSource(data=init_data) # Downsampled ExG data for visualization purposes - - # Init ECG R-peak source - init_data = dict(zip(['r_peak', 't'], [np.array([None], dtype=np.double), np.array([None], dtype=np.double)])) - self._r_peak_source = ColumnDataSource(data=init_data) - - # Init marker source - init_data = dict(zip(['marker', 't'], [np.array([None], dtype=np.double), np.array([None], dtype=np.double)])) - self._marker_source = ColumnDataSource(data=init_data) - - # Init ORN data source - init_data = dict(zip(ORN_LIST, np.zeros((9, 1)))) - init_data['t'] = [0.] - self._orn_source = ColumnDataSource(data=init_data) - - # Init table sources - self._heart_rate_source = ColumnDataSource(data={'heart_rate': ['NA']}) - self._firmware_source = ColumnDataSource( - data={'firmware_version': [self.stream_processor.device_info['firmware_version']]} - ) - self._battery_source = ColumnDataSource(data={'battery': ['NA']}) - self.temperature_source = ColumnDataSource(data={'temperature': ['NA']}) - self.light_source = ColumnDataSource(data={'light': ['NA']}) - self.battery_percent_list = [] - self.server = None - - # Init fft data source - init_data = dict(zip(self.chan_key_list, np.zeros((self.n_chan, 1)))) - init_data['f'] = np.array([0.]) - self.fft_source = ColumnDataSource(data=init_data) - - # Init impedance measurement source - init_data = {'channel': self.chan_key_list, - 'impedance': ['NA' for i in range(self.n_chan)], - 'row': ['1' for i in range(self.n_chan)], - 'color': ['black' for i in range(self.n_chan)]} - self.imp_source = ColumnDataSource(data=init_data) - - # Init timer source - self._timer_source = ColumnDataSource(data={'timer': ['00:00:00']}) - - def start_server(self): - """Start bokeh server""" - validate(False) - logger.debug("Starting bokeh server...") - port_number = find_free_port() - logger.info("Opening the dashboard on port: %i", port_number) - self.server = Server({'/': self._init_doc}, num_procs=1, port=port_number) - self.server.start() - - def start_loop(self): - """Start io loop and show the dashboard""" - logger.debug("Starting bokeh io_loop...") - self.server.io_loop.add_callback(self.server.show, "/") - try: - self.server.io_loop.start() - except KeyboardInterrupt: - if self.mode == 'signal': - logger.info("Got Keyboard Interrupt. The program exits ...") - self.explore.stop_lsl() - self.explore.stop_recording() - os._exit(0) - else: - logger.info("Got Keyboard Interrupt. The program exits after disabling the impedance mode ...") - raise KeyboardInterrupt - - def exg_callback(self, packet): - """ - Update ExG data in the visualization - - Args: - packet (explorepy.packet.EEG): Received ExG packet - - """ - time_vector, exg = packet.get_data(self.exg_fs) - if self._vis_time_offset is None: - self._vis_time_offset = time_vector[0] - time_vector -= self._vis_time_offset - self._exg_source_orig.stream(dict(zip(self.chan_key_list, exg)), rollover=int(self.exg_fs * self.win_length)) - - if self.mode == 'signal': - # Downsampling - exg = exg[:, ::int(self.exg_fs / EXG_VIS_SRATE)] - time_vector = time_vector[::int(self.exg_fs / EXG_VIS_SRATE)] - - # Baseline correction - if self.baseline_widget.active: - samples_avg = exg.mean(axis=1) - baseline = self._baseline_corrector["baseline"] - ma_len = self._baseline_corrector["MA_length"] - if baseline is None: - self._baseline_corrector["baseline"] = samples_avg - else: - self._baseline_corrector["baseline"] -= ((baseline - samples_avg) / ma_len * exg.shape[1]) - exg -= self._baseline_corrector["baseline"][:, np.newaxis] - else: - self._baseline_corrector["baseline"] = None - - # Update ExG unit - exg = self.offsets + exg / self.y_unit - new_data = dict(zip(self.chan_key_list, exg)) - new_data['t'] = time_vector - self.doc.add_next_tick_callback(partial(self._update_exg, new_data=new_data)) - - def orn_callback(self, packet): - """Update orientation data - - Args: - packet (explorepy.packet.Orientation): Orientation packet - """ - if self.tabs.active != 1: - return - timestamp, orn_data = packet.get_data() - if self._vis_time_offset is None: - self._vis_time_offset = timestamp[0] - timestamp -= self._vis_time_offset - new_data = dict(zip(ORN_LIST, np.array(orn_data)[:, np.newaxis])) - new_data['t'] = timestamp - self.doc.add_next_tick_callback(partial(self._update_orn, new_data=new_data)) - - def info_callback(self, packet): - """Update device information in the dashboard - - Args: - packet (explorepy.packet.Environment): Environment/DeviceInfo packet - - """ - new_info = packet.get_data() - for key in new_info.keys(): - data = {key: new_info[key]} - if key == 'firmware_version': - self.doc.add_next_tick_callback(partial(self._update_fw_version, new_data=data)) - elif key == 'battery': - self.battery_percent_list.append(new_info[key][0]) - if len(self.battery_percent_list) > BATTERY_N_MOVING_AVERAGE: - del self.battery_percent_list[0] - value = int(np.mean(self.battery_percent_list) / 5) * 5 - if value < 1: - value = 1 - self.doc.add_next_tick_callback(partial(self._update_battery, new_data={key: [value]})) - elif key == 'temperature': - self.doc.add_next_tick_callback(partial(self._update_temperature, new_data=data)) - elif key == 'light': - data[key] = [int(data[key][0])] - self.doc.add_next_tick_callback(partial(self._update_light, new_data=data)) - else: - logger.warning("There is no field named: " + key) - - def marker_callback(self, packet): - """Update markers - Args: - packet (explorepy.packet.EventMarker): Event marker packet - """ - if self.mode == "impedance": - return - timestamp, _ = packet.get_data() - if self._vis_time_offset is None: - self._vis_time_offset = timestamp[0] - timestamp -= self._vis_time_offset - new_data = dict(zip(['marker', 't', 'code'], [np.array([0.01, self.n_chan + 0.99, None], dtype=np.double), - np.array([timestamp[0], timestamp[0], None], dtype=np.double)])) - self.doc.add_next_tick_callback(partial(self._update_marker, new_data=new_data)) - - def impedance_callback(self, packet): - """Update impedances - - Args: - packet (explorepy.packet.EEG): ExG packet - """ - if self.mode == "impedance": - imp = packet.get_impedances() / 2 - color = [] - imp_status = [] - for value in imp: - if value > 250: - color.append("black") - imp_status.append("Open") - elif value > 50: - color.append("black") - imp_status.append(str(round(value, 0)) + " K\u03A9") - elif value > 30: - color.append("red") - imp_status.append(str(round(value, 0)) + " K\u03A9") - elif value > 20: - color.append("orange") - imp_status.append(str(round(value, 0)) + " K\u03A9") - elif value > 10: - color.append("yellow") - imp_status.append(str(round(value, 0)) + " K\u03A9") - elif value > 5: - imp_status.append(str(round(value, 0)) + " K\u03A9") - color.append("green") - else: - color.append("green") - imp_status.append("<5K\u03A9") # As the ADS is not precise in low values. - - data = {"impedance": imp_status, - 'channel': self.chan_key_list, - 'row': ['1' for i in range(self.n_chan)], - 'color': color - } - self.doc.add_next_tick_callback(partial(self._update_imp, new_data=data)) - else: - raise RuntimeError("Trying to compute impedances while the dashboard is not in Impedance mode!") - - @gen.coroutine - @without_property_validation - def _update_exg(self, new_data): - self._exg_source_ds.stream(new_data, rollover=int(2 * EXG_VIS_SRATE * WIN_LENGTH)) - - @gen.coroutine - @without_property_validation - def _update_orn(self, new_data): - self._orn_source.stream(new_data, rollover=int(2 * WIN_LENGTH * ORN_SRATE)) - - @gen.coroutine - @without_property_validation - def _update_fw_version(self, new_data): - self._firmware_source.stream(new_data, rollover=1) - - @gen.coroutine - @without_property_validation - def _update_battery(self, new_data): - self._battery_source.stream(new_data, rollover=1) - - @gen.coroutine - @without_property_validation - def _update_temperature(self, new_data): - self.temperature_source.stream(new_data, rollover=1) - - @gen.coroutine - @without_property_validation - def _update_light(self, new_data): - self.light_source.stream(new_data, rollover=1) - - @gen.coroutine - @without_property_validation - def _update_marker(self, new_data): - self._marker_source.stream(new_data=new_data, rollover=100) - - @gen.coroutine - @without_property_validation - def _update_imp(self, new_data): - self.imp_source.stream(new_data, rollover=self.n_chan) - - @gen.coroutine - @without_property_validation - def _update_fft(self): - """ Update spectral frequency analysis plot""" - # Check if the tab is active and if EEG mode is active - if (self.tabs.active != 2) or (self.exg_mode != 'EEG'): - return - - exg_data = np.array([self._exg_source_orig.data[key] for key in self.chan_key_list]) - - if exg_data.shape[1] < self.exg_fs * 5: - return - fft_content, freq = get_fft(exg_data, self.exg_fs) - data = dict(zip(self.chan_key_list, fft_content)) - data['f'] = freq - self.fft_source.data = data - - @gen.coroutine - @without_property_validation - def _update_heart_rate(self): - """Detect R-peaks and update the plot and heart rate""" - if self.exg_mode == 'EEG': - self._heart_rate_source.stream({'heart_rate': ['NA']}, rollover=1) - return - if CHAN_LIST[0] not in self.chan_key_list: - logger.warning('Heart rate estimation works only when channel 1 is enabled.') - return - if self.rr_estimator is None: - self.rr_estimator = HeartRateEstimator(fs=self.exg_fs) - # Init R-peaks plot - self.exg_plot.circle(x='t', y='r_peak', source=self._r_peak_source, - fill_color="red", size=8) - - ecg_data = (np.array(self._exg_source_ds.data['Ch1'])[-2 * EXG_VIS_SRATE:] - self.offsets[0]) * self.y_unit - time_vector = np.array(self._exg_source_ds.data['t'])[-2 * EXG_VIS_SRATE:] - - # Check if the peak2peak value is bigger than threshold - if (np.ptp(ecg_data) < V_TH[0]) or (np.ptp(ecg_data) > V_TH[1]): - logger.warning("P2P value larger or less than threshold. Cannot compute heart rate!") - return - - peaks_time, peaks_val = self.rr_estimator.estimate(ecg_data, time_vector) - peaks_val = (np.array(peaks_val) / self.y_unit) + self.offsets[0] - if peaks_time: - data = dict(zip(['r_peak', 't'], [peaks_val, peaks_time])) - self._r_peak_source.stream(data, rollover=50) - - # Update heart rate cell - estimated_heart_rate = self.rr_estimator.heart_rate - data = {'heart_rate': [estimated_heart_rate]} - self._heart_rate_source.stream(data, rollover=1) - - @gen.coroutine - @without_property_validation - def _change_scale(self, attr, old, new): - """Change y-scale of ExG plot""" - logger.debug(f"ExG scale has been changed from {old} to {new}") - new, old = SCALE_MENU[new], SCALE_MENU[old] - old_unit = 10 ** (-old) - self.y_unit = 10 ** (-new) - - for chan, value in self._exg_source_ds.data.items(): - if chan in self.chan_key_list: - temp_offset = self.offsets[self.chan_key_list.index(chan)] - self._exg_source_ds.data[chan] = (value - temp_offset) * (old_unit / self.y_unit) + temp_offset - self._r_peak_source.data['r_peak'] = (np.array(self._r_peak_source.data['r_peak']) - self.offsets[0]) * \ - (old_unit / self.y_unit) + self.offsets[0] - - @gen.coroutine - @without_property_validation - def _change_t_range(self, attr, old, new): - """Change time range""" - logger.debug(f"Time scale has been changed from {old} to {new}") - self._set_t_range(TIME_RANGE_MENU[new]) - - @gen.coroutine - def _change_mode(self, attr, old, new): - """Set EEG or ECG mode""" - logger.debug(f"ExG mode has been changed to {new}") - self.exg_mode = new - - def _init_doc(self, doc): - self.doc = doc - self.doc.title = "Explore Dashboard" - with open(os.path.join(os.path.dirname(__file__), 'templates', 'index.html')) as f: - index_template = Template(f.read()) - doc.template = index_template - self.doc.theme = Theme(os.path.join(os.path.dirname(__file__), 'theme.yaml')) - self._init_plots() - m_widgetbox = self._init_controls() - - # Create tabs - if self.mode == "signal": - exg_tab = Panel(child=self.exg_plot, title="ExG Signal") - orn_tab = Panel(child=column([self.acc_plot, self.gyro_plot, self.mag_plot], sizing_mode='scale_width'), - title="Orientation") - fft_tab = Panel(child=self.fft_plot, title="Spectral analysis") - self.tabs = Tabs(tabs=[exg_tab, orn_tab, fft_tab], width=400, sizing_mode='scale_width') - self.recorder_widget = self._init_recorder() - self.push2lsl_widget = self._init_push2lsl() - self.set_marker_widget = self._init_set_marker() - self.baseline_widget = CheckboxGroup(labels=['Baseline correction'], active=[0]) - - elif self.mode == "impedance": - imp_tab = Panel(child=self.imp_plot, title="Impedance") - self.tabs = Tabs(tabs=[imp_tab], width=500, sizing_mode='scale_width') - banner = Div(text=""" Mentalab""", - width=1500, height=50, css_classes=["banner"], align='center', sizing_mode="stretch_width") - heading = Div(text=""" """, height=2, sizing_mode="stretch_width") - if self.mode == 'signal': - layout = column([heading, - banner, - row(m_widgetbox, - Spacer(width=10, height=300), - self.tabs, - Spacer(width=10, height=300), - column(Spacer(width=170, height=50), self.baseline_widget, self.recorder_widget, - self.set_marker_widget, self.push2lsl_widget), - Spacer(width=50, height=300)), - ], - sizing_mode="stretch_both") - - elif self.mode == 'impedance': - layout = column(banner, - Spacer(width=600, height=20), - row([m_widgetbox, Spacer(width=25, height=500), self.tabs]) - ) - self.doc.add_root(layout) - self.doc.add_periodic_callback(self._update_fft, 2000) - self.doc.add_periodic_callback(self._update_heart_rate, 2000) - if self.stream_processor: - self.stream_processor.subscribe(topic=TOPICS.filtered_ExG, callback=self.exg_callback) - self.stream_processor.subscribe(topic=TOPICS.raw_orn, callback=self.orn_callback) - self.stream_processor.subscribe(topic=TOPICS.device_info, callback=self.info_callback) - self.stream_processor.subscribe(topic=TOPICS.marker, callback=self.marker_callback) - self.stream_processor.subscribe(topic=TOPICS.env, callback=self.info_callback) - self.stream_processor.subscribe(topic=TOPICS.imp, callback=self.impedance_callback) - - def _init_plots(self): - """Initialize all plots in the dashboard""" - self.exg_plot = figure(y_range=(0.01, self.n_chan + 1 - 0.01), y_axis_label='Voltage', x_axis_label='Time (s)', - title="ExG signal", - plot_height=250, plot_width=500, - y_minor_ticks=int(10), - tools=[ResetTool()], active_scroll=None, active_drag=None, - active_inspect=None, active_tap=None, sizing_mode="scale_width") - - self.mag_plot = figure(y_axis_label='Mag [mgauss/LSB]', x_axis_label='Time (s)', - plot_height=100, plot_width=500, - tools=[ResetTool()], active_scroll=None, active_drag=None, - active_inspect=None, active_tap=None, sizing_mode="scale_width") - self.acc_plot = figure(y_axis_label='Acc [mg/LSB]', - plot_height=75, plot_width=500, - tools=[ResetTool()], active_scroll=None, active_drag=None, - active_inspect=None, active_tap=None, sizing_mode="scale_width") - self.acc_plot.xaxis.visible = False - self.gyro_plot = figure(y_axis_label='Gyro [mdps/LSB]', - plot_height=75, plot_width=500, - tools=[ResetTool()], active_scroll=None, active_drag=None, - active_inspect=None, active_tap=None, sizing_mode="scale_width") - self.gyro_plot.xaxis.visible = False - - self.fft_plot = figure(y_axis_label='Amplitude (uV)', x_axis_label='Frequency (Hz)', title="FFT", - x_range=(0, 70), plot_height=250, plot_width=500, y_axis_type="log", - tools=[BoxZoomTool(), ResetTool()], active_scroll=None, active_drag=None, - active_tap=None, - sizing_mode="scale_width") - - self.imp_plot = self._init_imp_plot() - - # Set yaxis properties - self.exg_plot.yaxis.ticker = SingleIntervalTicker(interval=1, num_minor_ticks=0) - - # Initial plot line - for i in range(self.n_chan): - self.exg_plot.line(x='t', y=self.chan_key_list[i], source=self._exg_source_ds, - line_width=1.0, alpha=.9, line_color="#42C4F7") - self.fft_plot.line(x='f', y=self.chan_key_list[i], source=self.fft_source, - legend_label=self.chan_key_list[i] + " ", - line_width=1.5, alpha=.9, line_color=FFT_COLORS[i]) - self.fft_plot.yaxis.axis_label_text_font_style = 'normal' - self.exg_plot.line(x='t', y='marker', source=self._marker_source, - line_width=1, alpha=.8, line_color='#7AB904', line_dash="4 4") - - for i in range(3): - self.acc_plot.line(x='t', y=ORN_LIST[i], source=self._orn_source, legend_label=ORN_LIST[i] + " ", - line_width=1.5, line_color=LINE_COLORS[i], alpha=.9) - self.gyro_plot.line(x='t', y=ORN_LIST[i + 3], source=self._orn_source, legend_label=ORN_LIST[i + 3] + " ", - line_width=1.5, line_color=LINE_COLORS[i], alpha=.9) - self.mag_plot.line(x='t', y=ORN_LIST[i + 6], source=self._orn_source, legend_label=ORN_LIST[i + 6] + " ", - line_width=1.5, line_color=LINE_COLORS[i], alpha=.9) - - # Set x_range - self.plot_list = [self.exg_plot, self.acc_plot, self.gyro_plot, self.mag_plot] - self._set_t_range(WIN_LENGTH) - - # Set the formatting of yaxis ticks' labels - self.exg_plot.yaxis.major_label_overrides = dict(zip(range(1, self.n_chan + 1), self.chan_key_list)) - for plot in self.plot_list: - plot.toolbar.autohide = True - plot.yaxis.axis_label_text_font_style = 'normal' - if len(plot.legend) != 0: - plot.legend.location = "bottom_left" - plot.legend.orientation = "horizontal" - plot.legend.padding = 2 - - def _init_imp_plot(self): - plot = figure(plot_width=600, plot_height=200, x_range=self.chan_key_list[0:self.n_chan], - y_range=[str(1)], toolbar_location=None, sizing_mode="scale_width") - - plot.circle(x='channel', y="row", size=50, source=self.imp_source, fill_alpha=0.6, color="color", - line_color='color', line_width=2) - - text_props = {"source": self.imp_source, "text_align": "center", - "text_color": "white", "text_baseline": "middle", "text_font": "helvetica", - "text_font_style": "bold"} - - x = dodge("channel", -0.1, range=plot.x_range) - - plot.text(x=x, y=dodge('row', -.35, range=plot.y_range), - text="impedance", **text_props).glyph.text_font_size = "10pt" - plot.text(x=x, y=dodge('row', -.25, range=plot.y_range), text="channel", - **text_props).glyph.text_font_size = "12pt" - - plot.outline_line_color = None - plot.grid.grid_line_color = None - plot.axis.axis_line_color = None - plot.axis.major_tick_line_color = None - plot.axis.major_label_standoff = 0 - plot.axis.visible = False - return plot - - def _init_controls(self): - """Initialize all controls in the dashboard""" - # EEG/ECG Radio button - self.mode_control = widgets.Select(title="Signal", value='EEG', options=MODE_LIST, width=170, height=50) - self.mode_control.on_change('value', self._change_mode) - - self.t_range = widgets.Select(title="Time window", value="10 s", options=list(TIME_RANGE_MENU.keys()), - width=170, height=50) - self.t_range.on_change('value', self._change_t_range) - self.y_scale = widgets.Select(title="Y-axis Scale", value="1 mV", options=list(SCALE_MENU.keys()), - width=170, height=50) - self.y_scale.on_change('value', self._change_scale) - - # Create device info tables - columns = [widgets.TableColumn(field='heart_rate', title="Heart Rate (bpm)")] - self.heart_rate = widgets.DataTable(source=self._heart_rate_source, index_position=None, sortable=False, - reorderable=False, - columns=columns, width=170, height=50) - - columns = [widgets.TableColumn(field='firmware_version', title="Firmware Version")] - self.firmware = widgets.DataTable(source=self._firmware_source, index_position=None, sortable=False, - reorderable=False, - columns=columns, width=170, height=50) - - columns = [widgets.TableColumn(field='battery', title="Battery (%)")] - self.battery = widgets.DataTable(source=self._battery_source, index_position=None, sortable=False, - reorderable=False, - columns=columns, width=170, height=50) - - columns = [widgets.TableColumn(field='temperature', title="Device temperature (C)")] - self.temperature = widgets.DataTable(source=self.temperature_source, index_position=None, sortable=False, - reorderable=False, columns=columns, width=170, height=50) - - columns = [widgets.TableColumn(field='light', title="Light (Lux)")] - self.light = widgets.DataTable(source=self.light_source, index_position=None, sortable=False, reorderable=False, - columns=columns, width=170, height=50) - if self.mode == 'signal': - widget_list = [Spacer(width=170, height=30), self.mode_control, self.y_scale, self.t_range, self.heart_rate, - self.battery, self.temperature, self.firmware] - elif self.mode == 'impedance': - widget_list = [Spacer(width=170, height=40), self.battery, self.temperature, self.firmware] - - widget_box = widgetbox(widget_list, width=175, height=450, sizing_mode='fixed') - return widget_box - - def _init_recorder(self): - self.rec_button = Toggle(label=u"\u25CF Record", button_type="default", active=False, - width=170, height=35) - self.file_name_widget = TextInput(value="test_file", title="File name:", width=170, height=50) - self.file_type_widget = RadioGroup(labels=["EDF (BDF+)", "CSV"], active=0, width=170, height=50) - - columns = [widgets.TableColumn(field='timer', title="Record time", - formatter=widgets.StringFormatter(text_align='center'))] - self.timer = widgets.DataTable(source=self._timer_source, index_position=None, sortable=False, - reorderable=False, - header_row=False, columns=columns, - width=170, height=50, css_classes=["timer_widget"]) - - self.rec_button.on_click(self._toggle_rec) - return column([Spacer(width=170, height=5), self.file_name_widget, self.file_type_widget, self.rec_button, - self.timer], width=170, height=200, sizing_mode='fixed') - - def _toggle_rec(self, active): - logger.debug(f"Pressed record button -> {active}") - if active: - self.event_code_input.disabled = False - self.marker_button.disabled = False - if self.explore.is_connected: - self.explore.record_data(file_name=self.file_name_widget.value, - file_type=['edf', 'csv'][self.file_type_widget.active], - do_overwrite=True) - self.rec_button.label = u"\u25A0 Stop" - self.rec_start_time = datetime.now() - self.rec_timer_id = self.doc.add_periodic_callback(self._timer_callback, 1000) - else: - self.rec_button.active = False - self.doc.remove_periodic_callback(self.rec_timer_id) - self.doc.add_next_tick_callback(partial(self._update_rec_timer, new_data={'timer': '00:00:00'})) - else: - self.explore.stop_recording() - self.rec_button.label = u"\u25CF Record" - self.doc.add_next_tick_callback(partial(self._update_rec_timer, new_data={'timer': '00:00:00'})) - self.doc.remove_periodic_callback(self.rec_timer_id) - if not self.push2lsl_button.active: - self.event_code_input.disabled = True - self.marker_button.disabled = True - - def _timer_callback(self): - t_delta = (datetime.now() - self.rec_start_time).seconds - timer_text = ':'.join([str(int(t_delta / 3600)).zfill(2), str(int(t_delta / 60) % 60).zfill(2), - str(int(t_delta % 60)).zfill(2)]) - data = {'timer': timer_text} - self.doc.add_next_tick_callback(partial(self._update_rec_timer, new_data=data)) - - def _init_push2lsl(self): - push2lsl_title = Div(text="""Push to LSL""", width=170, height=10) - self.push2lsl_button = Toggle(label=u"\u25CF Start", button_type="default", active=False, - width=170, height=35) - self.push2lsl_button.on_click(self._toggle_push2lsl) - return column([Spacer(width=170, height=30), push2lsl_title, self.push2lsl_button], - width=170, height=200, sizing_mode='fixed') - - def _toggle_push2lsl(self, active): - logger.debug(f"Pressed push2lsl button -> {active}") - if active: - self.event_code_input.disabled = False - self.marker_button.disabled = False - if self.explore.is_connected: - self.explore.push2lsl() - self.push2lsl_button.label = u"\u25A0 Stop" - else: - self.push2lsl_button.active = False - else: - self.explore.stop_lsl() - self.push2lsl_button.label = u"\u25CF Start" - if not self.rec_button.active: - self.event_code_input.disabled = True - self.marker_button.disabled = True - - def _init_set_marker(self): - self.marker_button = Button(label=u"Set", button_type="default", width=80, height=31, disabled=True) - self.event_code_input = TextInput(value="0", title="Event code:", width=80, disabled=True) - self.event_code_input.on_change('value', self._check_marker_value) - self.marker_button.on_click(self._set_marker) - return column([Spacer(width=170, height=5), - row([self.event_code_input, - column(Spacer(width=50, height=19), self.marker_button)], height=50, width=170)], - width=170, height=50, sizing_mode='fixed' - ) - - def _set_marker(self): - code = self.event_code_input.value - self.stream_processor.set_marker(int(code)) - - def _check_marker_value(self, attr, old, new): - try: - code = int(self.event_code_input.value) - if code < 0 or code > 65535: - raise ValueError('Value must be an integer between 0 and 65535') - except ValueError: - self.event_code_input.value = "0<=val<=65535" - - @gen.coroutine - @without_property_validation - def _update_rec_timer(self, new_data): - self._timer_source.stream(new_data, rollover=1) - - def _set_t_range(self, t_length): - """Change time range of ExG and orientation plots""" - for plot in self.plot_list: - self.win_length = int(t_length) - plot.x_range.follow = "end" - plot.x_range.follow_interval = t_length - plot.x_range.range_padding = 0. - plot.x_range.min_interval = t_length - - -def get_fft(exg, s_rate): - """Compute FFT""" - n_point = 1024 - exg -= exg.mean(axis=1)[:, np.newaxis] - freq = s_rate * np.arange(int(n_point / 2)) / n_point - fft_content = np.fft.fft(exg, n=n_point) / n_point - fft_content = np.abs(fft_content[:, range(int(n_point / 2))]) - fft_content = gaussian_filter1d(fft_content, 1) - return fft_content[:, 1:], freq[1:] - - -if __name__ == '__main__': - from explorepy import Explore - from explorepy.stream_processor import StreamProcessor - - explore = Explore() - explore.stream_processor = StreamProcessor() - explore.stream_processor.device_info = {'firmware_version': '0.0.0', - 'adc_mask': [1 for i in range(8)], - 'sampling_rate': 250} - - dashboard = Dashboard(explore=explore) - dashboard.start_server() - dashboard.start_loop() diff --git a/src/explorepy/dashboard/templates/index.html b/src/explorepy/dashboard/templates/index.html deleted file mode 100644 index 73f4526e..00000000 --- a/src/explorepy/dashboard/templates/index.html +++ /dev/null @@ -1,117 +0,0 @@ -{% extends base %} - -{% block title %}Explorepy dashboard style{% endblock %} - -{% block preamble %} - -{% endblock %} - -{% block contents %} -
- {{ super() }} -
-{% endblock %} diff --git a/src/explorepy/dashboard/theme.yaml b/src/explorepy/dashboard/theme.yaml deleted file mode 100644 index 2ffa8200..00000000 --- a/src/explorepy/dashboard/theme.yaml +++ /dev/null @@ -1,21 +0,0 @@ -attrs: - Figure: - background_fill_color: '#0F1328' - border_fill_color: '#0F1328' - outline_line_color: '#444444' - Axis: - axis_line_color: "white" - axis_label_text_color: "white" - major_label_text_color: "white" - major_tick_line_color: "white" - minor_tick_line_color: "white" - Grid: - grid_line_dash: [6, 4] - grid_line_alpha: .1 - Title: - text_color: "white" - Legend: - background_fill_color: "white" - background_fill_alpha: 0.2 - label_text_color: "white" - diff --git a/src/explorepy/explore.py b/src/explorepy/explore.py index 269cc2b6..2447c8cb 100644 --- a/src/explorepy/explore.py +++ b/src/explorepy/explore.py @@ -19,10 +19,10 @@ import time from threading import Timer +import explorepy import numpy as np from appdirs import user_cache_dir -import explorepy from explorepy.command import ( MemoryFormat, ModuleDisable, @@ -85,17 +85,17 @@ def connect(self, device_name=None, mac_address=None): self.stream_processor = StreamProcessor(debug=True if self.debug else False) self.stream_processor.start(device_name=device_name, mac_address=mac_address) cnt = 0 + cnt_limit = 20 if self.debug else 15 while "adc_mask" not in self.stream_processor.device_info: logger.info("Waiting for device info packet...") time.sleep(1) - if cnt >= 10: + if cnt >= cnt_limit: raise ConnectionAbortedError("Could not get info packet from the device") cnt += 1 logger.info('Device info packet has been received. Connection has been established. Streaming...') logger.info("Device info: " + str(self.stream_processor.device_info)) self.is_connected = True - self.stream_processor.send_timestamp() if self.debug: self.stream_processor.subscribe(callback=self.debug.process_bin, topic=TOPICS.packet_bin) @@ -258,6 +258,8 @@ def convert_bin(self, bin_file, out_dir='', file_type='edf', do_overwrite=False, self.mask = [1 for _ in range(0, 32)] if 'PCB_305_801_XXX' in self.stream_processor.device_info['board_id']: self.mask = [1 for _ in range(0, 16)] + if 'PCB_304_801p2_X' in self.stream_processor.device_info['board_id']: + self.mask = [1 for _ in range(0, 32)] self.recorders['exg'] = create_exg_recorder(filename=exg_out_file, file_type=self.recorders['file_type'], @@ -286,6 +288,11 @@ def convert_bin(self, bin_file, out_dir='', file_type='edf', do_overwrite=False, def device_info_callback(packet): new_device_info = packet.get_info() + # TODO add 16 channel board id and refactor + # setting correct device interface + if 'max_online_sps' not in new_device_info: + logger.debug('setting bt interface to sdk') + explorepy.set_bt_interface('sdk') if not self.stream_processor.compare_device_info(new_device_info): new_file_name = exg_out_file[:-4] + "_" + str(np.round(packet.timestamp, 0)) + '_ExG' new_meta_name = meta_out_file[:-4] + "_" + str(np.round(packet.timestamp, 0)) + '_Meta' @@ -363,52 +370,11 @@ def stop_lsl(self): if self.lsl['timer'].is_alive(): self.lsl['timer'].cancel() self.lsl = {} + logger.info("Push2lsl has been stopped.") else: logger.debug("Tried to stop LSL while no LSL server is running!") - def visualize(self, bp_freq=(1, 30), notch_freq=50): - r"""Visualization of the signal in the dashboard: only works for 4 and 8 channel devices - - Args: - bp_freq (tuple): Bandpass filter cut-off frequencies (low_cutoff_freq, high_cutoff_freq), No bandpass filter - if it is None. - notch_freq (int): Line frequency for notch filter (50 or 60 Hz), No notch filter if it is None - """ - self._check_connection() - - if notch_freq: - self.stream_processor.add_filter(cutoff_freq=notch_freq, filter_type='notch') - - if bp_freq: - if bp_freq[0] and bp_freq[1]: - self.stream_processor.add_filter(cutoff_freq=bp_freq, filter_type='bandpass') - elif bp_freq[0]: - self.stream_processor.add_filter(cutoff_freq=bp_freq[0], filter_type='highpass') - elif bp_freq[1]: - self.stream_processor.add_filter(cutoff_freq=bp_freq[1], filter_type='lowpass') - - dashboard = explorepy.Dashboard(explore=self) - dashboard.start_server() - dashboard.start_loop() - - def measure_imp(self): - """ - Visualization of the electrode impedance - """ - self._check_connection() - assert self.stream_processor.device_info['sampling_rate'] == 250, \ - "Impedance mode only works at 250 Hz sampling rate. Please set the sampling rate to 250Hz." - - self.stream_processor.imp_initialize(notch_freq=50) - - try: - dashboard = explorepy.Dashboard(explore=self, mode='impedance') - dashboard.start_server() - dashboard.start_loop() - except KeyboardInterrupt: - self.stream_processor.disable_imp() - def set_marker(self, code): """Sets a digital event marker while streaming @@ -419,7 +385,7 @@ def set_marker(self, code): self._check_connection() self.stream_processor.set_marker(code=code) - def set_external_marker(self, time_lsl, marker_string): + def set_external_marker(self, marker_string, time_lsl=None): """Sets a digital event marker while streaming Args: @@ -427,7 +393,7 @@ def set_external_marker(self, time_lsl, marker_string): marker_string (string): string to save as experiment marker) """ self._check_connection() - self.stream_processor.set_ext_marker(time_lsl, marker_string) + self.stream_processor.set_ext_marker(marker_string=marker_string) def format_memory(self): """Format memory of the device @@ -449,8 +415,8 @@ def set_sampling_rate(self, sampling_rate): bool: True for success, False otherwise """ self._check_connection() - if sampling_rate not in [250, 500, 1000]: - raise ValueError("Sampling rate must be 250, 500 or 1000.") + if sampling_rate not in [250, 500, 1000, 2000, 4000, 8000, 16000]: + raise ValueError("Sampling rate must be 250, 500, 2000, 4000, 8000 or 16000.") cmd = SetSPS(sampling_rate) if self.stream_processor.configure_device(cmd): SettingsManager(self.device_name).set_sampling_rate(sampling_rate) diff --git a/src/explorepy/exploresdk.py b/src/explorepy/exploresdk.py index 5df28eee..e13c341c 100644 --- a/src/explorepy/exploresdk.py +++ b/src/explorepy/exploresdk.py @@ -5,8 +5,6 @@ # the SWIG interface file instead. from sys import version_info as _swig_python_version_info - - if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -64,8 +62,6 @@ class _SwigNonDynamicMeta(type): import collections.abc - - class SwigPyIterator(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -322,6 +318,20 @@ def what(self) -> "char const *": # Register ExploreBtSocketException in _exploresdk: _exploresdk.ExploreBtSocketException_swigregister(ExploreBtSocketException) +class ExploreNoBluetoothException(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, message: "std::string"): + _exploresdk.ExploreNoBluetoothException_swiginit(self, _exploresdk.new_ExploreNoBluetoothException(message)) + + def what(self) -> "char const *": + return _exploresdk.ExploreNoBluetoothException_what(self) + __swig_destroy__ = _exploresdk.delete_ExploreNoBluetoothException + +# Register ExploreNoBluetoothException in _exploresdk: +_exploresdk.ExploreNoBluetoothException_swigregister(ExploreNoBluetoothException) + class device(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr diff --git a/src/explorepy/packet.py b/src/explorepy/packet.py index 8d44ffc6..c77ed572 100644 --- a/src/explorepy/packet.py +++ b/src/explorepy/packet.py @@ -6,15 +6,13 @@ import struct from enum import IntEnum +import explorepy.tools import numpy as np from explorepy._exceptions import FletcherError - logger = logging.getLogger(__name__) -TIMESTAMP_SCALE = 10000 - class PACKET_ID(IntEnum): """Packet ID enum""" @@ -23,6 +21,8 @@ class PACKET_ID(IntEnum): ENV = 19 TS = 27 DISCONNECT = 111 + # Info packet from BLE devices, applies to Explore Pro + INFO_BLE = 98 # New info packet containing memory and board ID: this applies to all Explore+ systems INFO_V2 = 97 INFO = 99 @@ -30,6 +30,9 @@ class PACKET_ID(IntEnum): EEG98 = 146 EEG32 = 148 EEG98_USBC = 150 + EEG98_BLE = 151 + EEG32_BLE = 152 + EEG16_BLE = 153 EEG99 = 62 EEG94R = 208 EEG98R = 210 @@ -47,6 +50,7 @@ class PACKET_ID(IntEnum): class Packet(abc.ABC): """An abstract base class for Explore packet""" + def __init__(self, timestamp, payload, time_offset=0): """Gets the timestamp and payload and initializes the packet object @@ -56,7 +60,7 @@ def __init__(self, timestamp, payload, time_offset=0): time_offset (double): Time offset defined by parser. It will be the timestamp of the first packet when streaming in realtime. It will be zero while converting a binary file. """ - self.timestamp = timestamp / TIMESTAMP_SCALE + time_offset + self.timestamp = timestamp + time_offset self._convert(payload[:-4]) self._check_fletcher(payload[-4:]) @@ -73,18 +77,18 @@ def __str__(self): """Print the data/info""" @staticmethod - def int24to32(bin_data): + def int24to32(bin_data, byteorder_data='little'): """Converts binary data to int32 Args: bin_data (list): list of bytes with the structure of int24 - + byteorder_data(string): decoder byteorder- big or little endien Returns: np.ndarray of int values """ assert len(bin_data) % 3 == 0, "Packet length error!" return np.asarray([ - int.from_bytes(bin_data[x:x + 3], byteorder="little", signed=True) + int.from_bytes(bin_data[x:x + 3], byteorder=byteorder_data, signed=True) for x in range(0, len(bin_data), 3) ]) @@ -95,6 +99,7 @@ class PacketBIN(Packet): parser for each incoming packet, dispatched by the stream_processor with topic TOPICS.packet_bin and used in the Debug class. """ + def __init__(self, raw_data): self.bin_data = raw_data @@ -115,15 +120,22 @@ def __init__(self, timestamp, payload, time_offset=0, v_ref=None, n_packet=None) self.n_packet = n_packet self.data = None self.imp_data = None + if not isinstance(self, EEG_BLE): + self.byteorder_data = 'little' super().__init__(timestamp, payload, time_offset) def _convert(self, bin_data): if not self.v_ref or not self.n_packet: raise ValueError("v_ref or n_packet cannot be null for conversion!") - data = Packet.int24to32(bin_data) + data = Packet.int24to32(bin_data, self.byteorder_data) n_chan = -1 data = data.reshape((self.n_packet, n_chan)).astype(float).T gain = EXG_UNIT * ((2 ** 23) - 1) * 6.0 + + if isinstance(self, EEG_BLE): + self.data = np.round(data * self.v_ref / gain, 2) + return + # legacy code for devices other than BLE self.data = np.round(data[1:, :] * self.v_ref / gain, 2) # EEG32: status bits will change in future releases as we need to use 4 bytes for 32 channel status self.status = self.int32_to_status(data[0, :]) @@ -178,8 +190,7 @@ def get_ptp(self): return np.ptp(self.data, axis=1) def __str__(self): - return "EEG: " + str(self.data[:, -1]) + "\tEEG STATUS: ADS: " +\ - str(self.status['ads'][-1]) + ", SR: " + str(self.status['sr'][-1]) + return "EEG: " + str(self.data[:, -1]) class EEG94(EEG): @@ -203,6 +214,37 @@ def __init__(self, timestamp, payload, time_offset=0): super().__init__(timestamp, payload, time_offset, v_ref=2.4, n_packet=16) +class EEG_BLE(EEG): + def __init__(self, timestamp, payload, time_offset=0): + self.byteorder_data = 'big' + self.channel_order = [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 23, 22, 21, 20, 19, 18, 17, 16, + 31, 30, 29, 28, 27, 26, 25, 24] + super().__init__(timestamp, payload, time_offset, v_ref=2.4, n_packet=1) + data_length = len(self.data) + self.data = self.data[self.channel_order[:data_length]] + + +class EEG98_BLE(EEG_BLE): + """EEG packet for 8 channel device""" + + def __init__(self, timestamp, payload, time_offset=0): + super().__init__(timestamp, payload, time_offset) + + +class EEG32_BLE(EEG_BLE): + """EEG packet for 32 channel BLE device""" + + def __init__(self, timestamp, payload, time_offset=0): + super().__init__(timestamp, payload, time_offset) + + +class EEG16_BLE(EEG_BLE): + """EEG packet for 16 channel BLE device""" + + def __init__(self, timestamp, payload, time_offset=0): + super().__init__(timestamp, payload, time_offset) + + class EEG99(EEG): """EEG packet for 8 channel device""" @@ -260,6 +302,7 @@ def compute_angle(self, matrix=None): class Environment(Packet): """Environment data packet""" + def _convert(self, bin_data): self.temperature = bin_data[0] self.light = (1000 / 4095) * np.frombuffer( @@ -267,7 +310,12 @@ def _convert(self, bin_data): np.uint16).newbyteorder("<")) # Unit Lux self.battery = ((16.8 / 6.8) * (1.8 / 2457) * np.frombuffer( bin_data[3:5], dtype=np.dtype(np.uint16).newbyteorder("<"))) # Unit Volt - self.battery_percentage = self._volt_to_percent(self.battery) + + max_voltage = 4.1 # constant, measured in recording, actually 4.2, but let's say 4.10 is better + min_voltage = 3.45 # constant , measured in recording + voltage_span = max_voltage - min_voltage + percent = int(((self.battery - min_voltage) / voltage_span) * 100) + self.battery_percentage = max(0, min(percent, 100)) def __str__(self): return "Temperature: " + str(self.temperature) + "\tLight: " + str( @@ -306,6 +354,7 @@ def _volt_to_percent(voltage): class TimeStamp(Packet): """Time stamp data packet""" + def _convert(self, bin_data): self.host_timestamp = np.frombuffer(bin_data, dtype=np.dtype( @@ -381,7 +430,7 @@ def create(local_time, code): SoftwareMarker """ return SoftwareMarker( - local_time * TIMESTAMP_SCALE, + local_time * 10000, payload=bytearray(struct.pack(" 16 or len(marker_string) < 1: - raise ValueError("Marker label must be between 1 and 16 characters long") + if len(marker_string) > 7 or len(marker_string) < 1: + raise ValueError("Marker label length must be between 1 and 7 characters") byte_array = bytes(marker_string, 'utf-8') return ExternalMarker( lsl_time, @@ -430,7 +479,8 @@ def _convert(self, bin_data): dtype=np.dtype(np.uint32).newbyteorder("<"), count=1, offset=0)) - self.timestamp = precise_ts / TIMESTAMP_SCALE + self._time_offset + scale = 100000 if explorepy.tools.is_ble_device() else 10000 + self.timestamp = precise_ts / scale + self._time_offset code = np.ndarray.item( np.frombuffer(bin_data, dtype=np.dtype(np.uint16).newbyteorder("<"), @@ -462,6 +512,7 @@ def __init__(self, timestamp, payload, time_offset=0): class Disconnect(Packet): """Disconnect packet""" + def _convert(self, bin_data): """Disconnect packet has no data""" pass @@ -478,7 +529,7 @@ def _convert(self, bin_data): offset=0) self.firmware_version = ".".join([char for char in str(fw_num)[1:-1]]) - self.sampling_rate = 16000 / (2 ** bin_data[2]) + self.sampling_rate = int(16000 / (2 ** bin_data[2])) self.adc_mask = [int(bit) for bit in format(bin_data[3], "#010b")[2:]] def get_info(self): @@ -507,8 +558,26 @@ def get_info(self): return as_dict +class DeviceInfoBLE(DeviceInfoV2): + def _convert(self, bin_data): + super()._convert(bin_data) + # basic binary conversion shows up binary number with leading zeroes cut off + # here we format the raw byte to full 8 bits + # https://stackoverflow.com/questions/10411085/converting-integer-to-binary-in-python + self.sps_info = '{0:08b}'.format(bin_data[21]) + self.max_online_sps = 250 * pow(2, 6 - int(self.sps_info[4:], 2)) + self.max_offline_sps = 250 * pow(2, 6 - int(self.sps_info[:4], 2)) + + def get_info(self): + as_dict = super().get_info() + as_dict['max_online_sps'] = self.max_online_sps + as_dict['max_offline_sps'] = self.max_offline_sps + return as_dict + + class CommandRCV(Packet): """Command Status packet""" + def _convert(self, bin_data): self.opcode = bin_data[0] @@ -519,6 +588,7 @@ def __str__(self): class CommandStatus(Packet): """Command Status packet""" + def _convert(self, bin_data): self.opcode = bin_data[0] self.status = bin_data[5] @@ -559,6 +629,25 @@ def _convert(self, bin_data): super()._convert(bin_data, offset_multiplier=0.01) +class BleImpedancePacket(EEG98_USBC): + + def __init__(self, timestamp, payload, time_offset=0): + self.timestamp = timestamp + + def _convert(self, bin_data): + pass + + def populate_packet_with_data(self, ble_packet_list): + data_array = None + for i in range(len(ble_packet_list)): + _, data = ble_packet_list[i].get_data() + if data_array is None: + data_array = data + else: + data_array = np.concatenate((data_array, data), axis=1) + self.data = data_array + + PACKET_CLASS_DICT = { PACKET_ID.ORN: Orientation, PACKET_ID.ENV: Environment, @@ -566,12 +655,16 @@ def _convert(self, bin_data): PACKET_ID.DISCONNECT: Disconnect, PACKET_ID.INFO: DeviceInfo, PACKET_ID.INFO_V2: DeviceInfoV2, + PACKET_ID.INFO_BLE: DeviceInfoBLE, PACKET_ID.EEG94: EEG94, PACKET_ID.EEG98: EEG98, PACKET_ID.EEG99: EEG99, PACKET_ID.EEG94R: EEG94, PACKET_ID.EEG98R: EEG98, PACKET_ID.EEG98_USBC: EEG98_USBC, + PACKET_ID.EEG98_BLE: EEG98_BLE, + PACKET_ID.EEG32_BLE: EEG32_BLE, + PACKET_ID.EEG16_BLE: EEG16_BLE, PACKET_ID.EEG32: EEG32, PACKET_ID.CMDRCV: CommandRCV, PACKET_ID.CMDSTAT: CommandStatus, diff --git a/src/explorepy/parser.py b/src/explorepy/parser.py index 12798400..34ff2647 100644 --- a/src/explorepy/parser.py +++ b/src/explorepy/parser.py @@ -1,26 +1,27 @@ # -*- coding: utf-8 -*- """Parser module""" import asyncio +import binascii import logging import struct from threading import Thread import explorepy -from explorepy._exceptions import FletcherError +from explorepy._exceptions import FletcherError, ReconnectionFlowError from explorepy.packet import ( PACKET_CLASS_DICT, - TIMESTAMP_SCALE, + DeviceInfo, PacketBIN ) from explorepy.settings_manager import SettingsManager -from explorepy.tools import get_local_time - - +from explorepy.tools import get_local_time, is_ble_device, TIMESTAMP_SCALE_BLE, TIMESTAMP_SCALE +import sys logger = logging.getLogger(__name__) class Parser: """Data parser class""" + def __init__(self, callback, mode='device', debug=True): """ Args: @@ -43,16 +44,26 @@ def __init__(self, callback, mode='device', debug=True): self.is_waiting = False self._stream_thread = None self._is_reconnecting = False + self.seek_new_pid = asyncio.Event() def start_streaming(self, device_name, mac_address): """Start streaming data from Explore device""" self.device_name = device_name + if not device_name[-4:].isalpha(): + interface = 'pyserial' if sys.platform == "darwin" else 'sdk' + explorepy.set_bt_interface(interface) if explorepy.get_bt_interface() == 'sdk': from explorepy.btcpp import SDKBtClient self.stream_interface = SDKBtClient(device_name=device_name, mac_address=mac_address) + elif is_ble_device(): + from explorepy.btcpp import BLEClient + self.stream_interface = BLEClient(device_name=device_name, mac_address=mac_address) elif explorepy.get_bt_interface() == 'mock': from explorepy.bt_mock_client import MockBtClient self.stream_interface = MockBtClient(device_name=device_name, mac_address=mac_address) + elif explorepy.get_bt_interface() == 'pyserial': + from explorepy.serial_client import SerialClient + self.stream_interface = SerialClient(device_name=device_name) else: raise ValueError("Invalid Bluetooth interface: " + explorepy.get_bt_interface()) self.stream_interface.connect() @@ -77,8 +88,11 @@ def read_device_info(self, filename): self.stream_interface = FileHandler(filename) packet = None try: - packet = self._generate_packet() - self.callback(packet=packet) + while True: + packet = self._generate_packet() + if isinstance(packet, DeviceInfo): + self.callback(packet=packet) + break except (IOError, ValueError, FletcherError) as error: logger.error('Conversion ended incomplete. The binary file is corrupted.') raise error @@ -103,6 +117,9 @@ def _stream_loop(self): try: packet = self._generate_packet() self.callback(packet=packet) + except ReconnectionFlowError: + logger.info('Got exception in reconnection flow, normal operation continues') + pass except ConnectionAbortedError as error: logger.debug(f"Got this error while streaming: {error}") logger.warning("Device has been disconnected! Scanning for the last connected device...") @@ -115,7 +132,7 @@ def _stream_loop(self): self.stop_streaming() print("Press Ctrl+c to exit...") self._is_reconnecting = False - except (IOError, ValueError, MemoryError, FletcherError) as error: + except (IOError, ValueError, MemoryError) as error: logger.debug(f"Got this error while streaming: {error}") if self.mode == 'device': if str(error) != 'connection has been closed': @@ -126,6 +143,16 @@ def _stream_loop(self): else: logger.warning('The binary file is corrupted. Conversion has ended incompletely.') self.stop_streaming() + except FletcherError: + if is_ble_device(): + logger.warning('Incomplete packet received, parsing will continue.') + self.seek_new_pid.set() + else: + if self.mode == 'file': + logger.debug('Got Fletcher error in parsing BIN file, will continue') + self.seek_new_pid.set() + else: + self.stop_streaming() except EOFError: logger.info('End of file') self.stop_streaming() @@ -140,25 +167,45 @@ def _generate_packet(self): Returns: packet object """ + while self.seek_new_pid.is_set(): + if self._is_reconnecting: + raise ReconnectionFlowError() + bytes_out = binascii.hexlify(bytearray(self.stream_interface.read(1))) + if bytes_out == b'af' and binascii.hexlify(bytearray(self.stream_interface.read(3))) == b'beadde': + self.seek_new_pid.clear() + break raw_header = self.stream_interface.read(8) + try: + pid = raw_header[0] + raw_payload = raw_header[2:4] + raw_timestamp = raw_header[4:8] - pid = raw_header[0] - raw_payload = raw_header[2:4] - raw_timestamp = raw_header[4:8] + except: + raise FletcherError # pid = struct.unpack('B', raw_pid)[0] payload = struct.unpack(' 550: + logger.debug('Got exception in payload determination, raising fletcher error') + timestamp = struct.unpack(' 4 else 4 + if self.channel_name_key not in self.settings_dict: + self.settings_dict[self.channel_name_key] = [f'ch{i + 1}' for i in + range(self.settings_dict[self.channel_count_key])] self.write_settings() def set_sampling_rate(self, value): @@ -122,12 +152,22 @@ def set_sampling_rate(self, value): self.settings_dict[self.sr_key] = value self.write_settings() + def get_sampling_rate(self): + '''Returns device sampling rate''' + self.load_current_settings() + return self.settings_dict.get(self.sr_key) + def set_chan_names(self, value): """Setter method for channel names for Explore Desktop""" self.load_current_settings() self.settings_dict[self.channel_name_key] = value self.write_settings() + def get_channel_names(self): + """Returns channels names""" + self.load_current_settings() + return self.settings_dict.get(self.channel_name_key) + def __str__(self): self.load_current_settings() return self.settings_dict diff --git a/src/explorepy/stream_processor.py b/src/explorepy/stream_processor.py index b090f44b..5aaf4b96 100644 --- a/src/explorepy/stream_processor.py +++ b/src/explorepy/stream_processor.py @@ -2,7 +2,9 @@ """Stream Processor module This module is responsible for processing incoming stream from Explore device and publishing data to subscribers. """ +import copy import logging +import threading import time from enum import Enum from threading import Lock @@ -22,7 +24,6 @@ CommandRCV, CommandStatus, DeviceInfo, - DeviceInfoV2, Environment, EventMarker, ExternalMarker, @@ -35,7 +36,7 @@ from explorepy.tools import ( ImpedanceMeasurement, PhysicalOrientation, - get_local_time + get_local_time, TIMESTAMP_SCALE_BLE, is_ble_device, TIMESTAMP_SCALE ) @@ -67,6 +68,10 @@ def __init__(self, debug=False): self.debug = debug self.instability_flag = False self.last_bt_unstable_time = 0 + self.last_exg_packet_timestamp = 0 + self.last_bt_drop_duration = None + self.cmd_event = threading.Event() + self.reset_timer() def subscribe(self, callback, topic): """Subscribe a function to a topic @@ -124,6 +129,7 @@ def read_device_info(self, bin_file): def stop(self): """Stop streaming""" self.is_connected = False + self.cmd_event.clear() self.parser.stop_streaming() def process(self, packet): @@ -141,14 +147,26 @@ def process(self, packet): packet = self.physical_orn.calculate(packet=packet) self.dispatch(topic=TOPICS.mapped_orn, packet=packet) elif isinstance(packet, EEG): + self.last_exg_packet_timestamp = get_local_time() + missing_timestamps = self.fill_missing_packet(packet) self._update_last_time_point(packet, received_time) self.dispatch(topic=TOPICS.raw_ExG, packet=packet) if self._is_imp_mode and self.imp_calculator: - packet_imp = self.imp_calculator.measure_imp(packet=packet) - self.dispatch(topic=TOPICS.imp, packet=packet_imp) - self.apply_filters(packet=packet) + packet_imp = self.imp_calculator.measure_imp(packet=copy.deepcopy(packet)) + if packet_imp is not None: + self.dispatch(topic=TOPICS.imp, packet=packet_imp) + try: + self.apply_filters(packet=packet) + except ValueError: + pass + # fill missing packets + if len(missing_timestamps) > 0: + for t in missing_timestamps: + packet.timestamp = t + self.dispatch(topic=TOPICS.filtered_ExG, packet=packet) + self.dispatch(topic=TOPICS.filtered_ExG, packet=packet) - elif isinstance(packet, DeviceInfo) or isinstance(packet, DeviceInfoV2): + elif isinstance(packet, DeviceInfo): self.old_device_info = self.device_info.copy() self.device_info.update(packet.get_info()) if self.is_bt_streaming: @@ -222,8 +240,8 @@ def add_filter(self, cutoff_freq, filter_type): settings_manager = SettingsManager(self.device_info["device_name"]) settings_manager.load_current_settings() n_chan = settings_manager.settings_dict[settings_manager.channel_count_key] - # print(f"{n_chan=}") - n_chan = 32 if n_chan == 16 else n_chan + if not is_ble_device() and n_chan == 16: + n_chan = 32 self.filters.append(ExGFilter(cutoff_freq=cutoff_freq, filter_type=filter_type, @@ -256,6 +274,7 @@ def configure_device(self, cmd): """ if not self.is_connected: raise ConnectionError("No Explore device is connected!") + self.start_cmd_process_thread() return self._device_configurator.change_setting(cmd) def imp_initialize(self, notch_freq): @@ -301,12 +320,13 @@ def set_marker(self, code): marker = SoftwareMarker.create(self._get_sw_marker_time(), code) self.process(marker) - def set_ext_marker(self, time_lsl, marker_string): + def set_ext_marker(self, marker_string, time_lsl=None): """Set an external marker in the stream""" logger.info(f"Setting a software marker with code: {marker_string}") - - marker = ExternalMarker.create(time_lsl, marker_string) - self.process(marker) + if time_lsl is None: + time_lsl = self._get_sw_marker_time() + ext_marker = ExternalMarker.create(marker_string=marker_string, lsl_time=time_lsl) + self.process(ext_marker) def compare_device_info(self, new_device_info): """Compare a device info dict with the current version @@ -331,26 +351,58 @@ def send_timestamp(self): self._device_configurator.send_timestamp() def update_bt_stability_status(self, current_timestamp): - if 'board_id' in self.device_info.keys(): - if self._last_packet_timestamp == 0: - return - # device is an explore plus device, check sample timestamps - timestamp_diff = current_timestamp - self._last_packet_timestamp - - # allowed time interval is two samples - allowed_time_interval = np.round(2 * (1 / self.device_info['sampling_rate']), 3) - is_unstable = timestamp_diff >= allowed_time_interval - else: - # devices is an old device, check if last sample has an earlier timestamp - is_unstable = current_timestamp < self._last_packet_timestamp - - current_time = get_local_time() - if is_unstable: - self.instability_flag = True - self.last_bt_unstable_time = current_time - else: - if current_time - self.last_bt_unstable_time > 10: - self.instability_flag = False + if not self.cmd_event.is_set(): + if 'board_id' in self.device_info.keys(): + if self._last_packet_timestamp == 0: + return + # device is an explore plus device, check sample timestamps + timestamp_diff = current_timestamp - self._last_packet_timestamp + + # allowed time interval is two samples + allowed_time_interval = np.round(2 * (1 / self.device_info['sampling_rate']), 3) + is_unstable = timestamp_diff >= allowed_time_interval + else: + # devices is an old device, check if last sample has an earlier timestamp + is_unstable = current_timestamp < self._last_packet_timestamp + + current_time = get_local_time() + + + if is_unstable: + if not self.instability_flag: + self.bt_drop_start_time = get_local_time() + self.last_bt_drop_duration = None + self.instability_flag = True + self.last_bt_unstable_time = current_time + else: + if self.instability_flag: + self.last_bt_drop_duration = np.round(get_local_time() - self.bt_drop_start_time, 3) + threading.Timer(interval=10, function=self.reset_bt_duration).start() + if current_time - self.last_bt_unstable_time > .3: + self.instability_flag = False def is_connection_unstable(self): + if get_local_time() - self.last_exg_packet_timestamp > 1.5 and self.bt_drop_start_time: + self.last_bt_drop_duration = np.round(get_local_time() - self.bt_drop_start_time, 3) return self.instability_flag + + def start_cmd_process_thread(self): + self.cmd_event.set() + self.bt_status_ignore_thread.start() + + def reset_timer(self): + self.cmd_event.clear() + self.bt_status_ignore_thread = threading.Timer(interval=2, function=self.reset_timer) + + def reset_bt_duration(self): + self.last_bt_drop_duration = None + + def fill_missing_packet(self, packet): + timestamps = np.array([]) + if self._last_packet_timestamp != 0 and self.parser.mode == 'device': + sps = np.round(1/ self.device_info['sampling_rate'], 3) + time_diff = np.round(packet.timestamp - self._last_packet_timestamp, 3) + if time_diff > sps: + missing_samples = int(time_diff / sps) + timestamps = np.linspace(self._last_packet_timestamp + sps, packet.timestamp, num=missing_samples, endpoint=True) + return timestamps[:-1] diff --git a/src/explorepy/tools.py b/src/explorepy/tools.py index f190d603..d04f405f 100644 --- a/src/explorepy/tools.py +++ b/src/explorepy/tools.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- """Some useful tools such as file recorder, heart rate estimation, etc. used in explorepy""" +import asyncio import configparser import copy import csv @@ -18,6 +19,9 @@ user_cache_dir, user_config_dir ) +from bleak import ( + BleakScanner +) from mne import ( export, io @@ -31,13 +35,18 @@ import explorepy from explorepy.filters import ExGFilter -from explorepy.packet import EEG +from explorepy.packet import ( + EEG, + BleImpedancePacket, Orientation +) from explorepy.settings_manager import SettingsManager - logger = logging.getLogger(__name__) lock = Lock() +TIMESTAMP_SCALE_BLE = 100000 +TIMESTAMP_SCALE = 10000 + MAX_CHANNELS = 32 EXG_CHANNELS = [f"ch{i}" for i in range(1, MAX_CHANNELS + 1)] EXG_UNITS = ['uV' for ch in EXG_CHANNELS] @@ -56,6 +65,10 @@ def get_local_time(): return local_clock() +def is_ble_device(): + return explorepy.get_bt_interface() == 'ble' + + def bt_scan(): """ Scan for nearby Explore devices @@ -86,6 +99,24 @@ def bt_scan(): return explore_devices +async def scan_explore_devices(): + # Start scanning for devices + device_list = [] + devices = await BleakScanner.discover(timeout=5) + for d in devices: + if d.name is None: + continue + if d.name.startswith('Explore_'): + device_list.append(d.name) + return device_list + + +def run_ble_scanner(): + device_list = asyncio.run(scan_explore_devices()) + print('got device list here{}'.format(device_list)) + return device_list + + def create_exg_recorder(filename, file_type, adc_mask, fs, do_overwrite, exg_ch=None): """ Create ExG recorder @@ -472,12 +503,6 @@ def stop(self): self._file_obj = None elif self.file_type == 'csv': self._file_obj.close() - # sort CSV rows - if "ExG" in self._file_name: - path = os.path.join(os.getcwd(), self._file_name) - data = pandas.read_csv(path, delimiter=",") - data = data.sort_values(by=['TimeStamp']) - pandas.DataFrame(data).to_csv(path, index=False) def _init_edf_channels(self): self._file_obj.setEquipment(self._device_name) @@ -510,9 +535,9 @@ def write_data(self, packet): """ time_vector, sig = packet.get_data(self._fs) - - if len(time_vector) == 1: - data = np.array(time_vector + sig)[:, np.newaxis] + if isinstance(packet, Orientation): + if len(time_vector) == 1: + data = np.array(time_vector + sig)[:, np.newaxis] else: if self._rec_time_offset is None: self._rec_time_offset = time_vector[0] @@ -676,6 +701,7 @@ def __init__(self, device_info, calib_param, notch_freq): self._filters = {} self._notch_freq = notch_freq self._add_filters() + self.packet_buffer = [] def _add_filters(self): bp_freq = self._device_info['sampling_rate'] / 4 - 1.5, self._device_info['sampling_rate'] / 4 + 1.5 @@ -684,8 +710,9 @@ def _add_filters(self): settings_manager.load_current_settings() n_chan = settings_manager.settings_dict[settings_manager.channel_count_key] # Temporary fix for 16/32 channel filters - if n_chan >= 16: - n_chan = 32 + if not is_ble_device(): + if n_chan >= 16: + n_chan = 32 self._filters['notch'] = ExGFilter(cutoff_freq=self._notch_freq, filter_type='notch', s_rate=self._device_info['sampling_rate'], @@ -704,13 +731,22 @@ def _add_filters(self): def measure_imp(self, packet): """Compute electrode impedances """ - temp_packet = self._filters['notch'].apply(input_data=packet, in_place=False) - self._calib_param['noise_level'] = self._filters['base_noise']. \ - apply(input_data=temp_packet, in_place=False).get_ptp() - self._filters['demodulation'].apply( - input_data=temp_packet, in_place=True - ).calculate_impedance(self._calib_param) - return temp_packet + self.packet_buffer.append(packet) + + if len(self.packet_buffer) < 16: + return None + else: + timestamp, _ = self.packet_buffer[0].get_data() + resized_packet = BleImpedancePacket(timestamp=timestamp, payload=None) + resized_packet.populate_packet_with_data(self.packet_buffer) + self.packet_buffer.clear() + temp_packet = self._filters['notch'].apply(input_data=resized_packet, in_place=False) + self._calib_param['noise_level'] = self._filters['base_noise']. \ + apply(input_data=temp_packet, in_place=False).get_ptp() + self._filters['demodulation'].apply( + input_data=temp_packet, in_place=True + ).calculate_impedance(self._calib_param) + return temp_packet class PhysicalOrientation: